bigtreetech / BIGTREETECH-SKR-V1.3

32bit board with LPC1768, support marlin2.0 and smoothieware, support lcd2004/12864, On-board TMC2130 SPI interface and TMC2208 UART interface no additional wiring is required
1.01k stars 1.15k forks source link

Dual Z Axis motors not insync #503

Closed siegfriedgreg closed 3 years ago

siegfriedgreg commented 3 years ago

I have configured Marlin 2.0 bugfix for a SKR v1.4 Turbo with TMC 2208 v3.0 drivers. I am running in the parts of a cr-10s 500. I have had success running both z motors with the single tmc stepper and wanted to add a driver and get the dual z leveling option. I have reconfigured marlin for the other driver, and compiled, with the second stepper moving about twice as fast. Any help would be appreciated, as it was supposedly asked and solved in another thread.

EDIT: M122 Response. Recv: X Y Z Z2 E Recv: Enabled false false false false false Recv: Set current 700 800 700 700 700 Recv: RMS current 673 795 673 1215 673 Recv: MAX current 949 1121 949 1713 949 Recv: Run current 21/31 25/31 21/31 21/31 21/31 Recv: Hold current 10/31 12/31 10/31 10/31 10/31 Recv: CS actual 10/31 12/31 10/31 0/31 10/31 Recv: PWM scale Recv: vsense 1=.18 1=.18 1=.18 0=.325 1=.18 Recv: stealthChop true true true false true Recv: msteps 32 32 32 256 32 Recv: interp true true true false true Recv: tstep max max max 0 max Recv: PWM thresh. Recv: [mm/s] Recv: OT prewarn false false false false false Recv: triggered Recv: OTP false false false false false Recv: pwm scale sum 12 14 12 0 12 Recv: pwm scale auto 0 0 0 0 0 Recv: pwm offset auto 36 36 36 0 36 Recv: pwm grad auto 14 14 14 0 14 Recv: off time 3 3 3 0 3 Recv: blank time 24 24 24 16 24 Recv: hysteresis Recv: -end -1 -1 -1 -3 -1 Recv: -start 1 1 1 1 1 Recv: Stallguard thrs Recv: uStep count 36 36 36 0 36 Recv: DRVSTATUS X Y Z Z2 E Recv: sg_result Recv: stst * Recv: olb Recv: ola Recv: s2gb Recv: s2ga Recv: otpw Recv: ot Recv: 157C Recv: 150C Recv: 143C Recv: 120C Recv: s2vsa Recv: s2vsb Recv: Driver registers: Recv: X 0xC0:0A:00:00 Recv: Y 0xC0:0C:00:00 Recv: Z 0xC0:0A:00:00 Recv: Z2 0x00:00:00:00 Bad response! Recv: E 0xC0:0A:00:00 Recv: Recv: Recv: Testing X connection... OK Recv: Testing Y connection... OK Recv: Testing Z connection... OK Recv: Testing Z2 connection... Error: All LOW Recv: Testing E connection... OK Recv: ok P15 B3

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/**

pragma once

define CONFIGURATION_H_VERSION 020008

define STRING_CONFIG_H_AUTHOR "(GSieg v6, CR-10 S5)"

define CUSTOM_MACHINE_NAME "Bertha-5"

define SERIAL_PORT -1

define SERIAL_PORT_2 0

define BAUDRATE 115200

ifndef MOTHERBOARD

define MOTHERBOARD BOARD_BTT_SKR_V1_4_TURBO

endif

define EXTRUDERS 1

define DEFAULT_NOMINAL_FILAMENT_DIA 1.75

//#define CUSTOM_VERSION_FILE Version.h // Path from the root directory (no quotes) // 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

//#define PSU_CONTROL //#define PSU_NAME "Power Supply"

if ENABLED(PSU_CONTROL)

define PSU_ACTIVE_STATE LOW // Set 'LOW' for ATX, 'HIGH' for X-Box

//#define PSU_DEFAULT_OFF // Keep power off until enabled directly with M80 //#define PSU_POWERUP_DELAY 250 // (ms) Delay for the PSU to warm up to full power

//#define PSU_POWERUP_GCODE "M355 S1" // G-code to run after power-on (e.g., case light on) //#define PSU_POWEROFF_GCODE "M355 S0" // G-code to run before power-off (e.g., case light off)

//#define AUTO_POWER_CONTROL // Enable automatic control of the PS_ON pin

if ENABLED(AUTO_POWER_CONTROL)

#define AUTO_POWER_FANS         // Turn on PSU if fans need power
#define AUTO_POWER_E_FANS
#define AUTO_POWER_CONTROLLERFAN
#define AUTO_POWER_CHAMBER_FAN
//#define AUTO_POWER_E_TEMP        50 // (°C) Turn on PSU if any extruder is over this temperature
//#define AUTO_POWER_CHAMBER_TEMP  30 // (°C) Turn on PSU if the chamber is over this temperature
#define POWER_TIMEOUT              30 // (s) Turn off power if the machine is idle for this duration
//#define POWER_OFF_DELAY          60 // (s) Delay of poweroff after M81 command. Useful to let fans run for extra time.

endif

endif

//=========================================================================== //============================= Thermal Settings ============================ //===========================================================================

define TEMP_SENSOR_0 1

define TEMP_SENSOR_BED 11

// 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 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 300

define BED_MAXTEMP 135

//=========================================================================== //============================= PID Settings ================================ //===========================================================================

// 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_PARAMS_PER_HOTEND // Uses separate PID parameters for each extruder (useful for mismatched extruders) // Set/get with gcode: M301 E[extruder number, 0-2]

if ENABLED(PID_PARAMS_PER_HOTEND)

// Specify between 1 and HOTENDS values per array.
// If fewer than EXTRUDER values are provided, the last element will be repeated.
#define DEFAULT_Kp_LIST {  22.20,  22.20 }
#define DEFAULT_Ki_LIST {   1.08,   1.08 }
#define DEFAULT_Kd_LIST { 114.00, 114.00 }

else

#define DEFAULT_Kp  22.20
#define DEFAULT_Ki   1.08
#define DEFAULT_Kd 114.00

endif

endif // PIDTEMP

//=========================================================================== //====================== PID > Bed Temperature Control ====================== //===========================================================================

define PIDTEMPBED

//#define BED_LIMIT_SWITCHING

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

// FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.

endif // PIDTEMPBED

if EITHER(PIDTEMP, PIDTEMPBED)

//#define PID_DEBUG // Sends debug data to the serial port. Use 'M303 D' to toggle activation. //#define PID_OPENLOOP // 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_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.

endif

define PREVENT_COLD_EXTRUSION

define EXTRUDE_MINTEMP 180

define PREVENT_LENGTHY_EXTRUDE

define EXTRUDE_MAXLENGTH 800

//=========================================================================== //======================== Thermal Runaway Protection ======================= //===========================================================================

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

//=========================================================================== //============================== Endstop Settings =========================== //===========================================================================

define USE_XMIN_PLUG

define USE_YMIN_PLUG

define USE_ZMIN_PLUG

// Enable pullup for all endstops to prevent a floating state

define ENDSTOPPULLUPS

// 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

define X_DRIVER_TYPE TMC2208

define Y_DRIVER_TYPE TMC2208

define Z_DRIVER_TYPE TMC2208

define Z2_DRIVER_TYPE TMC2208

define E0_DRIVER_TYPE TMC2208

// 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 // Threshold from 2-7 //#define ENDSTOP_NOISE_THRESHOLD 2 // Check for stuck or disconnected endstops during homing moves. //#define DETECT_BROKEN_ENDSTOP

//============================================================================= //============================== Movement Settings ============================ //=============================================================================

//#define DISTINCT_E_FACTORS // X, Y, Z, E0 [, E1[, E2...]]

define DEFAULT_AXIS_STEPS_PER_UNIT { 160, 160, 800, 280 } // My Setup

// X, Y, Z, E0 [, E1[, E2...]]

define DEFAULT_MAX_FEEDRATE { 300, 300, 5, 25 }

// X, Y, Z, E0 [, E1[, E2...]]

define DEFAULT_MAX_ACCELERATION { 300, 300, 100, 5000 }

define DEFAULT_ACCELERATION 150 // X, Y, Z and E acceleration for printing moves

define DEFAULT_RETRACT_ACCELERATION 150 // E acceleration for retracts

define DEFAULT_TRAVEL_ACCELERATION 500 // X, Y, Z acceleration for travel (non printing) moves

//#define CLASSIC_JERK

if ENABLED(CLASSIC_JERK)

define DEFAULT_XJERK 5.0

define DEFAULT_YJERK 5.0

define DEFAULT_ZJERK 0.4

//#define TRAVEL_EXTRA_XYJERK 0.0 // Additional jerk allowance for all travel moves

//#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

if DISABLED(CLASSIC_JERK)

define JUNCTION_DEVIATION_MM 0.02 // (mm) Distance from real junction edge

define JD_HANDLE_SMALL_SEGMENTS // Use curvature estimation instead of just the junction angle

                                  // for small segments (< 1mm) with large junction angles (> 135°).

endif

define S_CURVE_ACCELERATION

//=========================================================================== //============================= Z Probe Options ============================= //===========================================================================

//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

define USE_PROBE_FOR_Z_HOMING

define Z_MIN_PROBE_PIN P0_10 // Pin 10 for BTT SKRv1.4Turbo

define BLTOUCH

define NOZZLE_TO_PROBE_OFFSET { -42, -8, -2.62 }

define PROBING_MARGIN 10

// X and Y axis travel speed (mm/min) between probes

define XY_PROBE_SPEED (133*60)

// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)

define Z_PROBE_SPEED_FAST (4*60)

// Feedrate (mm/min) for the "accurate" probe of each point

define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)

define MULTIPLE_PROBING 2

//#define EXTRA_PROBING 1

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

//#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) //#define WAIT_FOR_HOTEND // Wait for hotend to heat back up between probes (to improve accuracy & prevent undertemp extrudes)

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

// Require minimum nozzle and/or bed temperature for probing //#define PREHEAT_BEFORE_PROBING

if ENABLED(PREHEAT_BEFORE_PROBING)

define PROBING_NOZZLE_TEMP 120 // (°C) Only applies to E0 at this time

define PROBING_BED_TEMP 50

endif

// 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

// Disable axis steppers immediately when they're not being stepped. // 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

// Turn off the display blinking that warns about possible accuracy reduction //#define DISABLE_REDUCED_ACCURACY_WARNING

// @section extruder

define DISABLE_E false // Disable the extruder when not stepping

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 // Creality with Micro-Swiss

// 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 500 //

define Y_BED_SIZE 500 //

// 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 500

/**

// 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

/**

//=========================================================================== //=============================== Bed Leveling ============================== //===========================================================================

//#define AUTO_BED_LEVELING_3POINT //#define AUTO_BED_LEVELING_LINEAR

define AUTO_BED_LEVELING_BILINEAR

//#define AUTO_BED_LEVELING_UBL //#define MESH_BED_LEVELING

define RESTORE_LEVELING_AFTER_G28

//#define ENABLE_LEVELING_AFTER_G28

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

if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)

#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.

endif

// 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)

/**

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

endif // 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

// 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 5

define MANUAL_Y_HOME_POS 5

//#define MANUAL_Z_HOME_POS 0

define Z_SAFE_HOMING

if ENABLED(Z_SAFE_HOMING)

define Z_SAFE_HOMING_X_POINT ((X_BED_SIZE)/2) // X point for Z homing

define Z_SAFE_HOMING_Y_POINT ((Y_BED_SIZE)/2) // Y point for Z homing

endif

// Homing speeds (mm/min)

define HOMING_FEEDRATE_MM_M { (2060), (2060), (4*60) }

// Validate that endstops are triggered on homing moves

define VALIDATE_HOMING_ENDSTOPS

//============================================================================= //============================= Additional Features =========================== //=============================================================================

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.

define EEPROM_BOOT_SILENT // Keep M503 quiet and only give errors during first load

if ENABLED(EEPROM_SETTINGS)

//#define EEPROM_AUTO_INIT // Init EEPROM automatically on any errors.

endif

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

// // G20/G21 Inch mode support // //#define INCH_MODE_SUPPORT

// // M149 Set temperature units support // //#define TEMPERATURE_UNITS_SUPPORT

// @section temperature

// // Preheat Constants - Up to 5 are supported without changes //

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 "NYL"

define PREHEAT_2_TEMP_HOTEND 250

define PREHEAT_2_TEMP_BED 80

define PREHEAT_2_FAN_SPEED 0 // Value from 0 to 255

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_MAX_POS - 20), 10 }

//#define NOZZLE_PARK_X_ONLY // X move only is required to park //#define NOZZLE_PARK_Y_ONLY // Y move only is required to park

define NOZZLE_PARK_Z_RAISE_MIN 2 // (mm) Always raise Z by at least this distance

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

define PRINTJOB_TIMER_AUTOSTART

//#define PRINTCOUNTER

if ENABLED(PRINTCOUNTER)

define PRINTCOUNTER_SAVE_INTERVAL 60 // (minutes) EEPROM save interval during print

endif

//============================================================================= //============================= LCD and SD support ============================ //=============================================================================

define LCD_LANGUAGE en

//#define DISPLAY_CHARSET_HD44780 JAPANESE

define DISPLAY_CHARSET_HD44780 WESTERN

// 0 or 1 for Prusa.

define LCD_INFO_SCREEN_STYLE 0

define SDSUPPORT

//#define SD_CHECK_AND_RETRY //#define NO_LCD_MENUS //#define SLIM_LCD_MENUS //#define ENCODER_PULSES_PER_STEP 4 //#define ENCODER_STEPS_PER_MENU_ITEM 1 //#define REVERSE_ENCODER_DIRECTION //#define REVERSE_MENU_DIRECTION //#define REVERSE_SELECT_DIRECTION //#define INDIVIDUAL_AXIS_HOMING_MENU

define SPEAKER

//#define LCD_FEEDBACK_FREQUENCY_DURATION_MS 2 //#define LCD_FEEDBACK_FREQUENCY_HZ 5000

//============================================================================= //======================== LCD / Controller Selection ========================= //======================== (Character-based LCDs) ========================= //=============================================================================

//#define REPRAP_DISCOUNT_SMART_CONTROLLER

//============================================================================= //======================= LCD / Controller Selection ======================= //========================= (Graphical LCDs) ======================== //=============================================================================

define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER // CR-10s S5 Settings

//#define CR10_STOCKDISPLAY // Ender-3 Settings

//#define BQ_LCD_SMART_CONTROLLER //#define LCD_FOR_MELZI //#define MKS_LCD12864 //#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 //#define FYSETC_GENERIC_12864_1_1 // Larger display with basic ON/OFF backlight.

//============================================================================= //=============================== Extra Features ============================== //=============================================================================

// 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

// Support for Adafruit NeoPixel LED driver

define NEOPIXEL_LED

if ENABLED(NEOPIXEL_LED)

define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (defined in Adafruit_NeoPixel.h)

define NEOPIXEL_PIN P1_24 // LED driving pin

//#define NEOPIXEL2_TYPE NEOPIXEL_TYPE //#define NEOPIXEL2_PIN 5

define NEOPIXEL_PIXELS 20 // Number of LEDs in the strip. (Longest strip when NEOPIXEL2_SEPARATE is disabled.)

//#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Disable to change all LEDs at once.

define NEOPIXEL_BRIGHTNESS 130 // Initial brightness (0-255)

define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup

// Support for second Adafruit NeoPixel LED driver controlled with M150 S1 ... //#define NEOPIXEL2_SEPARATE

if ENABLED(NEOPIXEL2_SEPARATE)

#define NEOPIXEL2_PIXELS      15  // Number of LEDs in the second strip
#define NEOPIXEL2_BRIGHTNESS 127  // Initial brightness (0-255)
#define NEOPIXEL2_STARTUP_TEST    // Cycle through colors at startup

else

//#define NEOPIXEL2_INSERIES      // Default behavior is NeoPixel 2 in parallel

endif

// 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 //#define NEOPIXEL_BKGD_ALWAYS_ON // Keep the backlight on when other NeoPixels are off

endif

if ANY(BLINKM, RGB_LED, RGBW_LED, PCA9632, PCA9533, NEOPIXEL_LED)

define PRINTER_EVENT_LEDS

endif

// (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

// Edit servo angles with M281 and save to EEPROM with M500 //#define EDITABLE_SERVO_ANGLES

/**

/**

pragma once

define CONFIGURATION_ADV_H_VERSION 020008

// Up To 25 could be defined, model dependent. //#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

//=========================================================================== //============================= Thermal Settings ============================ //===========================================================================

define THERMOCOUPLE_MAX_ERRORS 15

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_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

// // Heated Bed Bang-Bang options //

if DISABLED(PIDTEMPBED)

define BED_CHECK_INTERVAL 5000 // (ms) Interval between checks in bang-bang control

if ENABLED(BED_LIMIT_SWITCHING)

#define BED_HYSTERESIS 2        // (°C) Only set the relevant heater state when ABS(T-target) > BED_HYSTERESIS

endif

endif

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

define WATCH_TEMP_PERIOD 40 // Seconds

define WATCH_TEMP_INCREASE 2 // Degrees Celsius

endif

if ENABLED(THERMAL_PROTECTION_BED)

define THERMAL_PROTECTION_BED_PERIOD 40 // Seconds

define THERMAL_PROTECTION_BED_HYSTERESIS 4 // Degrees Celsius

/**

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

//#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

define AUTOTEMP

if ENABLED(AUTOTEMP)

define AUTOTEMP_OLDWEIGHT 0.98

// Turn on AUTOTEMP on M104/M109 by default using proportions set here //#define AUTOTEMP_PROPORTIONAL

if ENABLED(AUTOTEMP_PROPORTIONAL)

#define AUTOTEMP_MIN_P      0 // (°C) Added to the target temperature
#define AUTOTEMP_MAX_P      5 // (°C) Added to the target temperature
#define AUTOTEMP_FACTOR_P   1 // Apply this F parameter by default (overridden by M104/M109 F)

endif

endif

/**

// 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

// EXTRUDER COOLING FAN PIN SETTINGS. -1 For Off

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 E6_AUTO_FAN_PIN -1

define E7_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

define FANMUX0_PIN -1

define FANMUX1_PIN -1

define FANMUX2_PIN -1

// // For Z set the number of stepper drivers //

define NUM_Z_STEPPER_DRIVERS 2 // (1-4) Z options change based on how many

if NUM_Z_STEPPER_DRIVERS > 1

// Enable if Z motor direction signals are the opposite of Z1 //#define INVERT_Z2_VS_Z_DIR //#define INVERT_Z3_VS_Z_DIR //#define INVERT_Z4_VS_Z_DIR

//#define Z_MULTI_ENDSTOPS

if ENABLED(Z_MULTI_ENDSTOPS)

#define Z2_USE_ENDSTOP          _XMAX_
#define Z2_ENDSTOP_ADJUSTMENT   0
#if NUM_Z_STEPPER_DRIVERS >= 3
  #define Z3_USE_ENDSTOP        _YMAX_
  #define Z3_ENDSTOP_ADJUSTMENT 0
#endif
#if NUM_Z_STEPPER_DRIVERS >= 4
  #define Z4_USE_ENDSTOP        _ZMAX_
  #define Z4_ENDSTOP_ADJUSTMENT 0
#endif

endif

endif

//#define SENSORLESS_BACKOFF_MM { 2, 2 } // (mm) Backoff from endstops before sensorless homing

define HOMING_BUMP_MM { 5, 5, 2 } // (mm) Backoff from endstops after first bump

define HOMING_BUMP_DIVISOR { 2, 2, 4 } // Re-Bump Speed Divisor (Divides the Homing Feedrate)

//#define HOMING_BACKOFF_POST_MM { 2, 2, 2 } // (mm) Backoff from endstops after homing

define QUICK_HOME // If G28 contains XY do a diagonal move first

//#define HOME_Y_BEFORE_X // If G28 contains XY home Y before X //#define HOME_Z_FIRST // Home Z first. Requires a Z-MIN endstop (not a probe). //#define CODEPENDENT_XY_HOMING // If X/Y can't home without homing Y/X first

if ENABLED(BLTOUCH)

//#define BLTOUCH_DELAY 500

define BLTOUCH_FORCE_SW_MODE

define BLTOUCH_SET_5V_MODE

//#define BLTOUCH_FORCE_MODE_SET //#define BLTOUCH_HS_MODE //#define BLTOUCH_LCD_VOLTAGE_MENU

endif // BLTOUCH

// Z Steppers Auto-Alignment

define Z_STEPPER_AUTO_ALIGN

if ENABLED(Z_STEPPER_AUTO_ALIGN)

// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]] // If not defined, probe limits will be used. // Override with 'M422 S X Y' //#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } } /**

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

/**

// If the Nozzle or Bed falls when the Z stepper is disabled, set its resting position here. //#define Z_AFTER_DEACTIVATE Z_HOME_POS

// Default Minimum Feedrates for printing and travel moves

define DEFAULT_MINIMUMFEEDRATE 0.0 // (mm/s) Minimum feedrate. Set with M205 S.

define DEFAULT_MINTRAVELFEEDRATE 0.0 // (mm/s) Minimum travel feedrate. Set with M205 T.

// Minimum time that a segment needs to take as the buffer gets emptied

define DEFAULT_MINSEGMENTTIME 20000 // (µs) Set with M205 B.

// Slow down the machine if the lookahead buffer is (by default) half full. // Increase the slowdown divisor for larger buffer sizes.

define SLOWDOWN

if ENABLED(SLOWDOWN)

define SLOWDOWN_DIVISOR 2

endif

/**

// 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)

/**

// Microstep settings (Requires a board with pins named X_MS1, X_MS2, etc.) //#define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]

//=========================================================================== //=============================Additional Features=========================== //===========================================================================

if EITHER(IS_ULTIPANEL, EXTENSIBLE_UI)

define MANUAL_FEEDRATE { 5060, 5060, 460, 260 } // (mm/min) Feedrates for manual moves along X, Y, Z, E from panel

define FINE_MANUAL_MOVE 0.025 // (mm) Smallest manual move (< 0.1mm) applying to Z on most machines

if IS_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

// Add Probe Z Offset calibration to the Z Probe Offsets menu

if HAS_BED_PROBE

//#define PROBE_OFFSET_WIZARD
#if ENABLED(PROBE_OFFSET_WIZARD)
  //
  // Enable to init the Probe Z-Offset when starting the Wizard.
  // Use a height slightly above the estimated nozzle-to-probe Z offset.
  // For example, with an offset of -5, consider a starting height of -4.
  //
  //#define PROBE_OFFSET_WIZARD_START_Z -4.0

  // Set a convenient position to do the calibration (probing point and nozzle/bed-distance)
  //#define PROBE_OFFSET_WIZARD_XY_POS { X_CENTER, Y_CENTER }
#endif

endif

// 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

// Add a mute option to the LCD menu //#define SOUND_MENU_ITEM

/**

endif // HAS_LCD_MENU

if HAS_DISPLAY

// The timeout (in ms) to return to the status screen from sub-menus //#define LCD_TIMEOUT_TO_STATUS 15000

if ENABLED(SHOW_BOOTSCREEN)

#define BOOTSCREEN_TIMEOUT 4000      // (ms) Total Duration to display the boot screen(s)
#if EITHER(HAS_MARLINUI_U8GLIB, TFT_COLOR_UI)
  #define BOOT_MARLIN_LOGO_SMALL     // Show a smaller Marlin logo on the Boot Screen (saving lots of flash)
#endif

endif

// 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

// 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

endif

if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && ANY(HAS_MARLINUI_U8GLIB, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, EXTENSIBLE_UI)

//#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

if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI)

//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits

endif

if EITHER(HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)

//#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

endif

if ENABLED(SDSUPPORT)

define SD_PROCEDURE_DEPTH 1 // Increase if you need more nested M32 calls

define SD_FINISHED_STEPPERRELEASE true // Disable steppers when SD Print is finished

define SD_FINISHED_RELEASECOMMAND "M84" // Use "M84XYE" to keep 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 NO_SD_AUTOSTART // Remove auto#.g file support completely to save some Flash, SRAM //#define MENU_ADDAUTOSTART // Add a menu option to run auto#.g files

//#define BROWSE_MEDIA_ON_INSERT // Open the file browser when media is inserted

define EVENT_GCODE_SD_ABORT "G27" // G-code to run on SD Abort Print (e.g., "G28XY" or "G27")

if ENABLED(PRINTER_EVENT_LEDS)

#define PE_LEDS_COMPLETED_TIME  (30*60) // (seconds) Time to keep the LED "done" color before restoring normal illumination

endif

// Continue after Power-Loss (Creality3D)

define POWER_LOSS_RECOVERY

if ENABLED(POWER_LOSS_RECOVERY)

#define PLR_ENABLED_DEFAULT   false // Power Loss Recovery enabled by default. (Set with 'M413 Sn' & M500)
//#define BACKUP_POWER_SUPPLY       // Backup power / UPS to move the steppers on power loss
//#define POWER_LOSS_RECOVER_ZHOME  // Z homing is needed for proper recovery. 99.9% of the time this should be disabled!
//#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. Set to -1 to disable default pin on boards without module.
//#define POWER_LOSS_STATE     HIGH // State of pin indicating power loss
//#define POWER_LOSS_PULLUP         // Set pullup / pulldown as appropriate for your sensor
//#define POWER_LOSS_PULLDOWN
//#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

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

// Allow international symbols in long filenames. To display correctly, the // LCD's font must contain the characters. Check your selected LCD language. //#define UTF_FILENAME_SUPPORT

// 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

endif // SDSUPPORT

if HAS_MARLINUI_U8GLIB

// Show SD percentage next to the progress bar

define DOGM_SD_PERCENT

// Save many cycles by drawing a hollow frame or no frame on the Info Screen //#define XYZ_NO_FRAME

define XYZ_HOLLOW_FRAME

// Enable to save many cycles by drawing a hollow frame on Menu Screens

define MENU_HOLLOW_FRAME

// A bigger font is available for edit items. Costs 3120 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_BIG_EDIT_FONT

// A smaller font may be used on the Info Screen. Costs 2434 bytes of PROGMEM. // Western only. Not available for Cyrillic, Kana, Turkish, Greek, or Chinese. //#define USE_SMALL_INFOFONT

// Swap the CW/CCW indicators in the graphics overlay //#define OVERLAY_GFX_REVERSE

if ENABLED(U8GLIB_ST7920)

// 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

//#define LIGHTWEIGHT_UI
#if ENABLED(LIGHTWEIGHT_UI)
  #define STATUS_EXPIRE_SECONDS 20
#endif

endif

/**

endif // HAS_MARLINUI_U8GLIB

// // Specify additional languages for the UI. Default specified by LCD_LANGUAGE. //

if ANY(DOGLCD, TFT_COLOR_UI, TOUCH_UI_FTDI_EVE)

//#define LCD_LANGUAGE_2 fr //#define LCD_LANGUAGE_3 de //#define LCD_LANGUAGE_4 es //#define LCD_LANGUAGE_5 it

ifdef LCD_LANGUAGE_2

//#define LCD_LANGUAGE_AUTO_SAVE // Automatically save language to EEPROM on change

endif

endif

// // Classic UI Options //

if TFT_SCALED_DOGLCD

//#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

// // ADC Button Debounce //

if HAS_ADC_BUTTONS

define ADC_BUTTON_DEBOUNCE_DELAY 16 // Increase if buttons bounce or repeat too fast

endif

// @section safety

define USE_WATCHDOG

if ENABLED(USE_WATCHDOG)

//#define WATCHDOG_RESET_MANUAL

endif

define BABYSTEPPING

if ENABLED(BABYSTEPPING)

//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR //#define BABYSTEP_WITHOUT_HOMING //#define BABYSTEP_ALWAYS_AVAILABLE // Allow babystepping at all times (not just during movement). //#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_MILLIMETER_UNITS // Specify BABYSTEPMULTIPLICATOR(XY|Z) in mm instead of micro-steps

define BABYSTEP_MULTIPLICATOR_Z 1 // (steps or mm) Steps or millimeter distance for each Z babystep

define BABYSTEP_MULTIPLICATOR_XY 10 // (steps or mm) Steps or millimeter distance for each Z babystep

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 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

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.

define EXPERIMENTAL_SCURVE // Enable this option to permit S-Curve Acceleration

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

if BOTH(AUTO_BED_LEVELING_UBL, EEPROM_SETTINGS)

//#define OPTIMIZED_MESH_STORAGE // Store mesh with less precision to save EEPROM space

endif

/**

endif

// // G2/G3 Arc Support //

define ARC_SUPPORT // Disable this feature to save ~3226 bytes

if ENABLED(ARC_SUPPORT)

define MM_PER_ARC_SEGMENT 1 // (mm) Length (or minimum length) of each arc segment

//#define ARC_SEGMENTS_PER_R 1 // Max segment length, MM_PER = Min

define MIN_ARC_SEGMENTS 24 // Minimum number of segments in a complete circle

//#define ARC_SEGMENTS_PER_SEC 50 // Use feedrate to choose segment length (with MM_PER_ARC_SEGMENT as the minimum)

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 //#define SF_ARC_FIX // Enable only if using SkeinForge with "Arc Point" fillet procedure

endif

// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.

define BEZIER_CURVE_SUPPORT

/**

/**

// Moves (or segments) with fewer steps than this will be joined with the next move

define MIN_STEPS_PER_SEGMENT 6

//=========================================================================== //================================= Buffers ================================= //===========================================================================

// @section motion

// The number of linear moves that can be in the planner at once. // The value of BLOCK_BUFFER_SIZE must be a power of 2 (e.g. 8, 16, 32)

if BOTH(SDSUPPORT, DIRECT_STEPPING)

define BLOCK_BUFFER_SIZE 8

elif ENABLED(SDSUPPORT)

define BLOCK_BUFFER_SIZE 16

else

define BLOCK_BUFFER_SIZE 16

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

/**

// 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

// For serial echo, the number of digits after the decimal point //#define SERIAL_FLOAT_PRECISION 4

// @section extras

/**

/**

if HAS_TRINAMIC_CONFIG

define HOLD_MULTIPLIER 0.5 // Scales down the holding current from run current

/**

endif // HAS_TRINAMIC_CONFIG

/**

/**

/**

/**

if DISABLED(NO_VOLUMETRICS)

/**

// Extra options for the M114 "Current Position" report

define M114_DETAIL // Use 'M114` for details to check planner calculations

//#define M114_REALTIME // Real current position based on forward kinematics //#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.

//#define REPORT_FAN_CHANGE // Report the new fan speed when changed by M106 (and others)

/**

/**

if ENABLED(FASTER_GCODE_PARSER)

//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters

endif

//#define MEATPACK // Support for MeatPack G-code compression (https://github.com/scottmudge/OctoPrint-MeatPack)

//#define GCODE_CASE_INSENSITIVE // Accept G-code sent to the firmware in lowercase

//#define REPETIER_GCODE_M360 // Add commands originally from Repetier FW

/**

/**

// @section develop

// // M100 Free Memory Watcher to debug memory usage // //#define M100_FREE_MEMORY_WATCHER

// // M42 - Set pin states // //#define DIRECT_PIN_CONTROL

// // M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe // //#define PINS_DEBUGGING

// Enable Marlin dev mode which adds some special commands //#define MARLIN_DEV_MODE

/**

siegfriedgreg commented 3 years ago

**** SOLVED ****

My problem was I purchased a board with 4 drivers pre-soldered with the j2 jumper bridged. The extra driver for the second z motor was purchased without said j2 jumper being bridged. For future reference; if the word "Bottom" is on the top side and legible, then the lower two pads of the j2 jumper need to be bridged. Hopefully that clears it up!