Hello!
I am trying to change the filament using the M600 command without an LCD screen and an encoder. The way I want to do it, is calling other M commands when the printer asks for input.
I have done some modifications to Marlin in an attempt to achieve this (which I will describe further below), but I have failed to achieve my goal. However, in doing so, I have discovered something which I would call a bug, but could possibly be an expected behavior. At some point during the M600, Marlin doesn't accept any command, not even M112 Emergency Stop, which could be dangerous, because I guess anyone could use this command when operating the printer from a very big distance if they notice a danger.
The way M600 works right now is:
The way I want M600 to work is to let the user make the choice proposed at points 4 and 5, by using either the encoder, or by issuing M601 Resume Print or M602 Extrude More.
In the following I will describes the steps I took into adding M601 and M602 commands.
#define FILAMENT_CHANGE_HOST_EXCLUSIVE // Enables M601 and M602
In the Marlin_main.cpp, add the following lines of code before the definition of "process_parsed_command()":
/**
In the Marlin_main.cpp, in the "process_parsed_command()" function, in the "case: 'M'" of the main switch statement, add the following lines of code at the end:
case 601:
gcode_M601();
break;
case 602:
gcode_M602();
break;
In the Marlin_main.cpp, in the "get_serial_commands()" function, after the "#endif#" of the "#if DISABLED(EMERGENCY_PARSER)", add these lines:
if (strcmp(command, "M601") == 0) { advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; }
if (strcmp(command, "M602") == 0) { advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; }
After implementing M601 and M602, the expected behavior is that I could change the filament without using the LCD and the encoder. I can now issue these commands when the printer says "busy: processing", but when the printer says "busy: paused for user" (which it does right when it asks to continue printing or extrude more) I cannot issue any command.
I have tracked down where I think it makes the printer pause for user, and it's in Marlin_main.cpp, in the "static void resume_print(...)" function, this block:
// Show "Extrude More" / "Resume" menu and wait for reply
KEEPALIVE_STATE(PAUSED_FOR_USER);
wait_for_user = false;
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION);
while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
KEEPALIVE_STATE(IN_HANDLER);
I have tried to make "wait_for_user" true, but it does not seem to solve the issue.
Is there any way to make Marlin not enter the "busy: paused for user" state, and instead to only stay in the "busy: processing" state while it asks to continue printing or extrude more? (this way I could call those M601 and M602 commands, and probably it would solve the issue).
Also, is it an expected behavior for Marlin not to accept any commands at some points? Not even those from the EMERGENCY_PARSER section?
Any input on this is greatly appreciated. Thanks!
Start with looking up how pingpong (ok) protocol works.
Think about how poisening an regularly sent M105 is.
Think about a M600 in mid of a file.
Look up what the emergency command parser is about.
Realize that needs support by the hosts - it needs to violate the protocol by purpose - i don't know about any host currently doing that. (except a stupid terminal program - always violating the protocol and likely to overfill the RX buffer)
Look up what M108 and wait_for_user
really does.
Redesign M601/602. Integrate them into the emergency command parser.
Step on the feet of the host developers.
Sorry. Currently you are far away from a working concept.
@AnHardt
Thanks. You gave me a lot to think about, and study.
Currently I cannot test anything, as I will not have access to a 3D printer for the week, but I will get back as soon as possible with the solution (or other questions).
Hello! Sorry for the long wait. It took us a little more to figure out how the host was also working and to test the solution a bit. To change the filament using a host exclusively, one could follow these steps:
Configuration_adv.h
enable EMERGENCY_PARSER
(make sure to also update the related comment to include M601
and M602
).// Added support for M601 & M602 (changing filament related)
#define EMERGENCY_PARSER
enum.h
make enum e_parser_state
look like this (this adds support for the two commands):#if ENABLED(EMERGENCY_PARSER)
enum e_parser_state {
state_RESET,
state_N,
state_M,
state_M1,
state_M10,
state_M108,
state_M11,
state_M112,
state_M4,
state_M41,
state_M410,
state_M6,
state_M60,
state_M601,
state_M602,
state_IGNORE // to '\n'
};
#endif
// Currently looking for: M108, M112, M410, M601, M602
b. in the switch(state), modify case state_M like this:
case state_M:
switch (c) {
case ' ': break;
case '1': state = state_M1; break;
case '4': state = state_M4; break;
case '6': state = state_M6; break;
default: state = state_IGNORE;
}
break;
c. in the switch(state), add these cases before case state_IGNORE:
case state_M6:
state = (c == '0') ? state_M60 : state_IGNORE;
break;
case state_M60:
switch (c) {
case '1': state = state_M601; break;
case '2': state = state_M602; break;
default: state = state_IGNORE;
}
break;
d. in the switch(state), in the default case, there is another switch(state) case, add these cases before the inner default case:
case state_M601:
advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT;
SERIAL_PROTOCOL("M601 reached");
SERIAL_EOL();
break;
case state_M602:
advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE;
SERIAL_PROTOCOL("M602 reached");
SERIAL_EOL();
break;
After just these steps, M601 and M602 should work in such a way you don't need an encoder to change the filament any more.
We have successfully tested this with hosts such as Pronterface and OctoPrint.
In Pronterface, changing filament works as follows:
M600
M108
M601
(if you want to continue printing)M602
(if you want to extrude more)In OctoPrint, the host waits for an "ok" before sending the next command, and because M600 only sends this "ok" when the whole procedure is finished, "Fake Acknowledgement" is required. When having M600 inside a file, we noticed 2 "Fake Acknowledgement" is needed after each of the commands (M108, M601, M602), and only 1 "Fake Acknowledgement" was sufficient when M600 was explicitly sent by us. For instance:
M600
(initiated by the file)M108
M601
(if you want to continue printing)M602
(if you want to extrude more)I hope this helps someone! If you have any questions, please do ask.
Hello good morning, I can't make it work, only the m108 works but the M601 and the M602 don't
Hello is for Marlin 1.1.9 or 2.0.x. Thanks
I've done it.
This is rather ancient, host prompt support does this with M876 to choose actions as well.
Except the emergency parser does not work for M876.
Yes it does, I coded it myself.
Then it has a bug. It doesn't work when in a busy state waiting for user during an M600 event. I had to overrride all occurrences of #if (DISABLED(EMERGENCY_PARSER) to get it to work in the context of this post. So if you could make a permanent change to the code so we don't have to modify it that would be greatly appreciated! I have an Artillery Sidewinder and our TFT does not have an encoder. I had to jump through hoops to get the runout script working with the TFT and Octoprint.
// 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!
Notice how these commands are all disabled #if emergency parser is enabled. Is it possible this is supposed to say enabled instead of disabled??? I added the EMERGENCY_OVERRIDE parameter:
/*******gcode.cpp********/
#if (DISABLED(EMERGENCY_PARSER) || ENABLED(EMERGENCY_OVERRIDE))
case 108: M108(); break; // M108: Cancel Waiting
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
#endif
#else
case 108: case 112: case 410:
#if ENABLED(HOST_PROMPT_SUPPORT)
case 876:
#endif
break;
#endif
/*******gcode.h********/
static void M108();
static void M112();
static void M410();
#if ENABLED(HOST_PROMPT_SUPPORT)
static void M876();
#endif
#endif
/*******queue.cpp********/
#if (DISABLED(EMERGENCY_PARSER) || ENABLED(EMERGENCY_OVERRIDE))
// Process critical commands early
if (strcmp(command, "M108") == 0) {
wait_for_heatup = false;
#if HAS_LCD_MENU
wait_for_user = false;
#endif
}
if (strcmp(command, "M112") == 0) kill(M112_KILL_STR, nullptr, true);
if (strcmp(command, "M410") == 0) quickstop_stepper();
#endif
/*******M108_M112_M410.cpp********/
/**
/**
/**
What platform are you on? That code makes it run in the normal parser, not the emergency parser. If its getting there at all then the emergency parser is not active at all.
Im just getting things caught back up to date, most of my branches are 2-3mo old right now, after all the pandemic mayhem so its possible it was broken again in the interim.
The TFT on that machine is a serial streamer and can interfere with octoprint. It has no direct interface to Marlin and talks on the same serial channel as USB. It can at times cause random issues when one of its commands injects in the middle of what octoprint is sending.
I'm running 2.0.5.3 on an MKS Gen L board with an Mkstft_28 clone. I have no encoder and the same serial port is used for both the TFT and the USB cable that plugs into the computer to run octoprint. So having to share the serial port has been a challenge but host actions have saved the day so far. They allow me to remotely remotely parse runout events from the TFT. I had to enable an LCD to be able to activate the family of features associated with advanced pause, so I chose reprap discount smart controller but I'm not using any of the encoder pins. I'm using LCD support as a Trojan horse to activate the M600 features.
Shouldnt need an LCD enabled if emergency parser is enabled. I have a few machines with no LCD enabled but M600 is on just based on host prompt and emergency parser. Ive got the same machine, ill update the code and test a few configurations over the next day or two. In the meantime, post youre config files and ill glance for anything obvious.
Awesome I appreciate the help. Maybe the lcd support is actually causing me the problem in the first place! I will upload the configuration files momentarily.
/**
/**
// @section temperature
//===========================================================================
//=============================Thermal Settings ============================
//===========================================================================
//
// Custom Thermistor 1000 parameters
//
#define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#ifndef NOVA
#define HOTEND0_BETA 3950 // Beta value
#else
#define HOTEND0_BETA 4267 // Beta value //Ryan 4267//
#endif
#define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND1_BETA 3950 // Beta value
#define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND2_BETA 3950 // Beta value
#define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND3_BETA 3950 // Beta value
#define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND4_BETA 3950 // Beta value
#define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND5_BETA 3950 // Beta value
#define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND6_BETA 3950 // Beta value
#define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define HOTEND7_BETA 3950 // Beta value
#define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define BED_BETA 3950 // Beta value
#define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor
#define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
#define CHAMBER_BETA 3950 // Beta value
//
// Hephestos 2 24V heated bed upgrade kit.
// https://store.bq.com/en/heated-bed-kit-hephestos2
//
//#define HEPHESTOS2_HEATED_BED_KIT
#undef TEMP_SENSOR_BED
#define TEMP_SENSOR_BED 70
#define HEATER_BED_INVERTING true
/**
#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
#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
/**
#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 THERMAL_PROTECTION_BED_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_BED_HYSTERESIS 2 // Degrees Celsius
/**
/**
#define THERMAL_PROTECTION_CHAMBER_PERIOD 20 // Seconds
#define THERMAL_PROTECTION_CHAMBER_HYSTERESIS 2 // Degrees Celsius
/**
// 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
/**
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
//#define 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_FACTOR255+DEFAULT_Kf
#define PID_FAN_SCALING_AT_MIN_SPEED 6.0 //=PID_FAN_SCALING_LIN_FACTORPID_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.0PID_FAN_SCALING_AT_MIN_SPEED-PID_FAN_SCALING_AT_FULL_SPEEDPID_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
#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
/**
#define AUTOTEMP_OLDWEIGHT 0.98
// Extra options for the M114 "Current Position" report
//#define M114_DETAIL // Use 'M114` for details to check planner calculations
//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.
// Show Temperature ADC value
// Enable for M105 to include ADC values read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
/**
// 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
#define EXTRUDER_RUNOUT_MINTEMP 190
#define EXTRUDER_RUNOUT_SECONDS 30
#define EXTRUDER_RUNOUT_SPEED 1500 // (mm/m)
#define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm)
// @section temperature
// Calibration for AD595 / AD8495 sensor to adjust temperature measurements.
// The final temperature is calculated as (measuredTemp * GAIN) + OFFSET.
/**
//#define CONTROLLER_FAN_PIN -1 // Set a custom pin for the controller fan
//#define CONTROLLER_FAN_USE_Z_ONLY // With this option only the Z axis is considered
#define CONTROLLERFAN_SPEED_MIN 0 // (0-255) Minimum speed. (If set below this value the fan is turned off.)
#define CONTROLLERFAN_SPEED_ACTIVE 255 // (0-255) Active speed, used when any motor is enabled
#define CONTROLLERFAN_SPEED_IDLE 0 // (0-255) Idle speed, used when motors are disabled
#define CONTROLLERFAN_IDLE_TIME 60 // (seconds) Extra time to keep the fan running after disabling motors
//#define CONTROLLER_FAN_EDITABLE // Enable M710 configurable settings
#if ENABLED(CONTROLLER_FAN_EDITABLE)
#define CONTROLLER_FAN_MENU // Enable the Controller Fan submenu
#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
/**
/**
//#define FAST_PWM_FAN_FREQUENCY 31400
//#define USE_OCR2A_AS_TOP
// @section extruder
/**
/**
/**
//#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
// @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
//#define CLOSED_LOOP_ENABLE_PIN -1
//#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1
/**
//#define 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 X2_ENDSTOP_ADJUSTMENT 0
#endif
//#define 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 Y2_ENDSTOP_ADJUSTMENT 0
#endif
//
// For Z set the number of stepper drivers
//
//#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
/**
#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
// 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 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
/**
// Safety: The probe needs time to recognize the command.
// Minimum command delay (ms). Enable and increase if needed.
#define BLTOUCH_DELAY 200
/**
// 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
/**
/**
/**
/**
// Safety: Enable voltage mode settings in the LCD menu.
//#define BLTOUCH_LCD_VOLTAGE_MENU
/**
// Define probe X and Y positions for Z1, Z2 [, Z3 [, Z4]]
// If not defined, probe limits will be used.
// Override with 'M422 S
//#define Z_STEPPER_ALIGN_XY { { 10, 190 }, { 100, 10 }, { 190, 190 } }
/**
// Provide Z stepper positions for more rapid convergence in bed alignment.
// Requires triple stepper drivers (i.e., set NUM_Z_STEPPER_DRIVERS to 3)
//#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 farther out than the test point.
#define Z_STEPPER_ALIGN_AMP 1.0 // Use a value > 1.0 NOTE: This may cause instability!
#endif
// On a 300mm bed a 5% grade would give a misalignment of ~1.5cm
#define G34_MAX_GRADE 1 // (%) Maximum incline that G34 will handle
#define Z_STEPPER_ALIGN_ITERATIONS 5 // Number of iterations to apply during alignment
#define Z_STEPPER_ALIGN_ACC 0.02 // Stop iterating early if the accuracy is better than this
#define RESTORE_LEVELING_AFTER_G34 // Restore leveling after G34 is done?
// After G34, re-home Z (G28 Z) or just calculate it from the last probe heights?
// Re-homing might be more precise in reproducing the actual 'G28 Z' homing height, especially on an uneven bed.
#define HOME_AFTER_G34
// @section motion
// 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.
// 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 HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated
// Minimum time that a segment needs to take if the buffer is emptied
// Slow down the machine if the look ahead buffer is (by default) half full.
// Increase the slowdown divisor for larger buffer sizes.
#define SLOWDOWN_DIVISOR 2
// 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.
//
// Backlash Compensation
// Adds extra movement to axes on direction-changes to account for backlash.
//
//#define 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
/**
#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 the pin to read during calibration
#ifndef CALIBRATION_PIN
//#define CALIBRATION_PIN -1 // Define here to override the default pin
#define CALIBRATION_PIN_INVERTING false // Set to true to invert the custom pin
//#define CALIBRATION_PIN_PULLDOWN
#define CALIBRATION_PIN_PULLUP
#endif
/**
/**
// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.
/**
// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro)
//#define DIGIPOT_I2C
/**
//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster
// 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.
//===========================================================================
//=============================Additional Features===========================
//===========================================================================
// @section lcd
#define MANUAL_FEEDRATE { 5060, 5060, 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
// Change values more rapidly when the encoder is rotated faster
#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
// Play a beep when the feedrate is changed from the Status Screen
//#define BEEP_ON_FEEDRATE_CHANGE
#define FEEDRATE_CHANGE_BEEP_DURATION 10
#define FEEDRATE_CHANGE_BEEP_FREQUENCY 440
// 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
/**
// 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
// Show the E position (filament used) during printing
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
//#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
#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//2000 // (ms) Amount of time to show the bar
#define PROGRESS_BAR_MSG_TIME 0//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
// The standard SD detect circuit reads LOW when media is inserted and HIGH when empty.
// Enable this option and set to HIGH if your SD cards are incorrectly detected.
//#define SD_DETECT_STATE HIGH
#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")
#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
/**
// 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
/**
// 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
/**
/**
/**
/**
/**
* 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
/**
// Add an optimized binary file transfer mode, initiated with 'M28 B1'
//#define BINARY_FILE_TRANSFER
/**
/**
/**
// 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
// Swap the CW/CCW indicators in the graphics overlay
//#define OVERLAY_GFX_REVERSE
/**
//#define LIGHTWEIGHT_UI
#if ENABLED(LIGHTWEIGHT_UI)
#define STATUS_EXPIRE_SECONDS 20
#endif
#endif
/**
// 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
//
// Additional options for DGUS / DWIN displays
//
#define DGUS_SERIAL_PORT 3
#define DGUS_BAUDRATE 115200
#define DGUS_RX_BUFFER_SIZE 128
#define DGUS_TX_BUFFER_SIZE 48
//#define DGUS_SERIAL_STATS_RX_BUFFER_OVERRUNS // Fix Rx overrun situation (Currently only for AVR)
#define DGUS_UPDATE_INTERVAL_MS 500 // (ms) Interval between automatic screen updates
#if EITHER(DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY)
#define DGUS_PRINT_FILENAME // Display the filename during printing
#define DGUS_PREHEAT_UI // Display a preheat screen during heatup
#if ENABLED(DGUS_LCD_UI_FYSETC)
//#define DGUS_UI_MOVE_DIS_OPTION // Disabled by default for UI_FYSETC
#else
#define DGUS_UI_MOVE_DIS_OPTION // Enabled by default for UI_HIPRECY
#endif
#define DGUS_FILAMENT_LOADUNLOAD
#if ENABLED(DGUS_FILAMENT_LOADUNLOAD)
#define DGUS_FILAMENT_PURGE_LENGTH 10
#define DGUS_FILAMENT_LOAD_LENGTH_PER_TIME 0.5 // (mm) Adjust in proportion to DGUS_UPDATE_INTERVAL_MS
#endif
#define DGUS_UI_WAITING // Show a "waiting" screen between some screens
#if ENABLED(DGUS_UI_WAITING)
#define DGUS_UI_WAITING_STATUS 10
#define DGUS_UI_WAITING_STATUS_PERIOD 8 // Increase to slower waiting status looping
#endif
#endif
//
// Touch UI for the FTDI Embedded Video Engine (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 S6_TFT_PINMAP // FYSETC S6 pin mapping
//#define OTHER_PIN_LAYOUT // Define pins manually below
#if ENABLED(OTHER_PIN_LAYOUT)
// 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
//
// 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
//
// ADC Button Debounce
//
#define ADC_BUTTON_DEBOUNCE_DELAY 16 // (ms) Increase if buttons bounce or repeat too fast
// @section safety
/**
//#define WATCHDOG_RESET_MANUAL
// @section lcd
/**
//#define INTEGRATED_BABYSTEPPING // EXPERIMENTAL integration of babystepping into the Stepper ISR
//#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
#else
#define BABYSTEP_ZPROBE_OFFSET // Combine M851 Z and Babystepping
#endif
#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
// @section extruder
/**
//#define EXTRA_LIN_ADVANCE_K // Enable for second linear advance constants
#define LIN_ADVANCE_K 0.13 // Unit: mm compression per 1mm/s extruder speed
//#define LA_DEBUG // If enabled, this will generate debug information output over USB.
// @section leveling
/**
//#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
/**
//#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
// 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)
/**
#define G29_MAX_RETRIES 3
#define G29_HALT_ON_FAILURE
/**
/**
// Enable thermal first layer compensation using bed and probe temperatures
#define PROBE_TEMP_COMPENSATION
// Add additional compensation depending on hotend temperature
// Note: this values cannot be calibrated and have to be set manually
#if ENABLED(PROBE_TEMP_COMPENSATION)
// Max temperature that can be reached by heated bed.
// This is required only for the calibration process.
#define PTC_MAX_BED_TEMP BED_MAXTEMP
// Park position to wait for probe cooldown
#define PTC_PARK_POS_X 0.0F
#define PTC_PARK_POS_Y 0.0F
#define PTC_PARK_POS_Z 100.0F
// Probe position to probe and wait for probe to reach target temperature
#define PTC_PROBE_POS_X 90.0F
#define PTC_PROBE_POS_Y 100.0F
// Enable additional compensation using hotend temperature
// Note: this values cannot be calibrated automatically but have to be set manually
//#define USE_TEMP_EXT_COMPENSATION
#endif
// @section extras
//
// G60/G61 Position Save and Return
//
//#define SAVED_POSITIONS 1 // Each saved position slot costs 12 bytes
//
// G2/G3 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
// Support for G5 with XYZE destination and IJPQ offsets. Requires ~2666 bytes.
/**
//#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.
// Moves (or segments) with fewer steps than this will be joined with the next move
/**
/**
/**
// @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
#define BLOCK_BUFFER_SIZE 32 // maximize block buffer
// @section serial
// The ASCII buffer for serial input
// 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]
// 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
// 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
// Add M575 G-code to change the baud rate
// 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
// 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!
//Override restrictions of EMERGENCY_PARSER to allow M108 and M876 emulation without Marlin Mode Capable LCD
// 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.
// 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.
// @section extras
/**
/**
#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
/**
// 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
#if ENABLED(TOOLCHANGE_NO_RETURN)
//#define EVENT_GCODE_AFTER_TOOLCHANGE "G12X" // G-code to run after tool-change is complete
#endif
// 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
/**
/**
#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 70 // (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 30 // (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 30 // (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 20 // (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 1000 // (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 FILAMENT_UNLOAD_PURGE_FEEDRATE 25 // (mm/s) feedrate to purge before unload
#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)
// @section tmc
/**
#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_Z4(TMC26X)
#define Z4_MAX_CURRENT 1000
#define Z4_SENSE_RESISTOR 91
#define Z4_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
#if AXIS_DRIVER_TYPE_E6(TMC26X)
#define E6_MAX_CURRENT 1000
#define E6_SENSE_RESISTOR 91
#define E6_MICROSTEPS 16
#endif
#if AXIS_DRIVER_TYPE_E7(TMC26X)
#define E7_MAX_CURRENT 1000
#define E7_SENSE_RESISTOR 91
#define E7_MICROSTEPS 16
#endif
// @section tmc_smart
/**
pins_MYBOARD.h
file. (e.g., RAMPS 1.4 uses AUX3X_CS_PIN 53
, Y_CS_PIN 49
, etc.).#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(Z4)
#define Z4_CURRENT 800
#define Z4_CURRENT_HOME Z4_CURRENT
#define Z4_MICROSTEPS 16
#define Z4_RSENSE 0.11
#define Z4_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
#if AXIS_IS_TMC(E6)
#define E6_CURRENT 800
#define E6_MICROSTEPS 16
#define E6_RSENSE 0.11
#define E6_CHAIN_POS -1
#endif
#if AXIS_IS_TMC(E7)
#define E7_CURRENT 800
#define E7_MICROSTEPS 16
#define E7_RSENSE 0.11
#define E7_CHAIN_POS -1
#endif
/**
/**
/**
/**
/**
/**
/**
#if ENABLED(MONITOR_DRIVER_STATUS)
#define CURRENT_STEP_DOWN 50 // [mA]
#define REPORT_CURRENT_CHANGE
#define STOP_ON_ERROR
#endif
/**
#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 Z4_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
#define E6_HYBRID_THRESHOLD 30
#define E7_HYBRID_THRESHOLD 30
/**
#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
/**
/**
/**
// @section L64XX
/**
//#define L6470_CHITCHAT // Display additional status info
#if AXIS_IS_L64XX(X)
#define X_MICROSTEPS 128 // Number of microsteps (VALID: 1, 2, 4, 8, 16, 32, 128) - L6474 max is 16
#define X_OVERCURRENT 2000 // (mA) Current where the driver detects an over current
// L6470 & L6474 - VALID: 375 x (1 - 16) - 6A max - rounds down
// POWERSTEP01: VALID: 1000 x (1 - 32) - 32A max - rounds down
#define X_STALLCURRENT 1500 // (mA) Current where the driver detects a stall (VALID: 31.25 * (1-128) - 4A max - rounds down)
// L6470 & L6474 - VALID: 31.25 * (1-128) - 4A max - rounds down
// POWERSTEP01: VALID: 200 x (1 - 32) - 6.4A max - rounds down
// L6474 - STALLCURRENT setting is used to set the nominal (TVAL) current
#define X_MAX_VOLTAGE 127 // 0-255, Maximum effective voltage seen by stepper - not used by L6474
#define X_CHAIN_POS -1 // Position in SPI chain, 0=Not in chain, 1=Nearest MOSI
#define X_SLEW_RATE 1 // 0-3, Slew 0 is slowest, 3 is fastest
#endif
#if AXIS_IS_L64XX(X2)
#define X2_MICROSTEPS 128
#define X2_OVERCURRENT 2000
#define X2_STALLCURRENT 1500
#define X2_MAX_VOLTAGE 127
#define X2_CHAIN_POS -1
#define X2_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Y)
#define Y_MICROSTEPS 128
#define Y_OVERCURRENT 2000
#define Y_STALLCURRENT 1500
#define Y_MAX_VOLTAGE 127
#define Y_CHAIN_POS -1
#define Y_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Y2)
#define Y2_MICROSTEPS 128
#define Y2_OVERCURRENT 2000
#define Y2_STALLCURRENT 1500
#define Y2_MAX_VOLTAGE 127
#define Y2_CHAIN_POS -1
#define Y2_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Z)
#define Z_MICROSTEPS 128
#define Z_OVERCURRENT 2000
#define Z_STALLCURRENT 1500
#define Z_MAX_VOLTAGE 127
#define Z_CHAIN_POS -1
#define Z_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Z2)
#define Z2_MICROSTEPS 128
#define Z2_OVERCURRENT 2000
#define Z2_STALLCURRENT 1500
#define Z2_MAX_VOLTAGE 127
#define Z2_CHAIN_POS -1
#define Z2_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Z3)
#define Z3_MICROSTEPS 128
#define Z3_OVERCURRENT 2000
#define Z3_STALLCURRENT 1500
#define Z3_MAX_VOLTAGE 127
#define Z3_CHAIN_POS -1
#define Z3_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(Z4)
#define Z4_MICROSTEPS 128
#define Z4_OVERCURRENT 2000
#define Z4_STALLCURRENT 1500
#define Z4_MAX_VOLTAGE 127
#define Z4_CHAIN_POS -1
#define Z4_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E0)
#define E0_MICROSTEPS 128
#define E0_OVERCURRENT 2000
#define E0_STALLCURRENT 1500
#define E0_MAX_VOLTAGE 127
#define E0_CHAIN_POS -1
#define E0_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E1)
#define E1_MICROSTEPS 128
#define E1_OVERCURRENT 2000
#define E1_STALLCURRENT 1500
#define E1_MAX_VOLTAGE 127
#define E1_CHAIN_POS -1
#define E1_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E2)
#define E2_MICROSTEPS 128
#define E2_OVERCURRENT 2000
#define E2_STALLCURRENT 1500
#define E2_MAX_VOLTAGE 127
#define E2_CHAIN_POS -1
#define E2_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E3)
#define E3_MICROSTEPS 128
#define E3_OVERCURRENT 2000
#define E3_STALLCURRENT 1500
#define E3_MAX_VOLTAGE 127
#define E3_CHAIN_POS -1
#define E3_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E4)
#define E4_MICROSTEPS 128
#define E4_OVERCURRENT 2000
#define E4_STALLCURRENT 1500
#define E4_MAX_VOLTAGE 127
#define E4_CHAIN_POS -1
#define E4_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E5)
#define E5_MICROSTEPS 128
#define E5_OVERCURRENT 2000
#define E5_STALLCURRENT 1500
#define E5_MAX_VOLTAGE 127
#define E5_CHAIN_POS -1
#define E5_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E6)
#define E6_MICROSTEPS 128
#define E6_OVERCURRENT 2000
#define E6_STALLCURRENT 1500
#define E6_MAX_VOLTAGE 127
#define E6_CHAIN_POS -1
#define E6_SLEW_RATE 1
#endif
#if AXIS_IS_L64XX(E7)
#define E7_MICROSTEPS 128
#define E7_OVERCURRENT 2000
#define E7_STALLCURRENT 1500
#define E7_MAX_VOLTAGE 127
#define E7_CHAIN_POS -1
#define E7_SLEW_RATE 1
#endif
/**
#if ENABLED(MONITOR_L6470_DRIVER_STATUS)
#define KVAL_HOLD_STEP_DOWN 1
//#define L6470_STOP_ON_ERROR
#endif
// @section i2cbus
//fix check out later
// I2C Master ID for LPC176x LCD and Digital Current control
// Does not apply to other peripherals based on the Wire library.
//
//#define I2C_MASTER_ID 1 // Set a value from 0 to 2
/**
//#define EXPERIMENTAL_I2CBUS
#define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave
// @section extras
/**
// 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)
/**
/**
#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
/**
#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
/**
#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
/**
/**
/**
/**
/**
/**
/**
/**
G29 O
Mesh Output./**
//#define GCODE_QUOTED_STRINGS // Support for quoted string parameters
/**
// Enable and set a (default) feedrate for all G0 moves
#define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode
/**
/**
#define GCODE_MACROS_SLOTS 5 // Up to 10 may be used
#define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro
/**
//#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 "G28nG29 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) "nG28nG29"
#define USER_DESC_5 "Home & Info"
#define USER_GCODE_5 "G28nM503"
/**
#define HOST_PROMPT_SUPPORT
/**
/**
//#define 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.
#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.
/**
// Use a rolling average to identify persistant errors that indicate skips, as opposed to vibration and noise.
#define I2CPE_ERR_ROLLING_AVERAGE
/**
#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
//#define INVERT_JOY_X // Enable if X direction is reversed
//#define INVERT_JOY_Y // Enable if Y direction is reversed
//#define INVERT_JOY_Z // Enable if Z direction is reversed
// Use M119 with JOYSTICK_DEBUG to find reasonable values after connecting:
#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 }
/**
#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 // Test pattern at startup: 0=none, 1=sweep, 2=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
/**
#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.
/**
//#define NANODLP_ALL_AXIS // Enables "Z_move_comp" output on any axis move.
// Default behavior is limited to Z axis only.
/**
//#define WEBSUPPORT // Start a webserver (which may include auto-discovery)
//#define OTASUPPORT // Support over-the-air firmware updates
//#define WIFI_CUSTOM_COMMAND // Accept feature config commands (e.g., WiFi ESP3D) from the host
/**
/**
// 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
/**
#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
// @section develop
//
// M100 Free Memory Watcher to debug memory usage
//
//#define M100_FREE_MEMORY_WATCHER
//
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
//
// Enable Marlin dev mode which adds some special commands
//#define MARLIN_DEV_MODE
My branch FWIW - https://github.com/InsanityAutomation/Marlin/tree/ArtilleryX1_2.0_Devel
Can try this and see if it works as-is if youd like before I get a chance to run some tests myself. Rebased it so its current. Day job is calling so I wont be back to this till late tonight.
I see that you don't have the default configuration set up for the Sidewinder, but I did notice your description for EMERGENCY_PARSER now lists M876, PROMISING!
/**
OK, I have tried this version of Marlin and disabled LCD support instead of adding EMERGENCY_OVERRIDE and the behavior is definitely different, which could be from disabling LCD support, or it could be from differences in the backend code. I did notice changes to the syntax of some expressions but nothing caught my attention offhand that would be functionally different for this behavior. For example, this new way to implement conditionals: TERN_(O,A). I don't like it personally, and I wonder what it accomplishes.
Action notifications no longer occur at the start of a print "//action:notification Printing..." or the end "//action:notification Artillery Sidewinder X1 Ready". I need these notifications to tell the TFT when to switch modes for an Octoprint session!
And under this configuration, when I respond to the "//action:prompt_begin Nozzle Parked" dialog, it does not stay paused for the Purge More/Continue Dialog, it just continues printing after acknowledging the Nozzle Parked dialog. (And a side note about that dialog: it calls for M108 but M108 was kicking me out of the M600 script in the 2.0.5.3 I was running before. I experimented to find that an M876 S0 did the trick and got me, functionally, to the Purge More dialog, but that doesn't work here.) The strange thing is that it displays the Purge More/Continue Dialog, but it just continues with the print like the dialog doesn't exist and doesn't take the appropriate actions upon acknowledging the M876 S0 or M876 S1.
/THESE RESPONSES RESULT IN NO ACTION!!! THERE IS NO FURTHER PURGING ON M876 S0 AND IF A PRINT IS IN SESSION IT WILL ALREADY HAVE RESUMED BY THE TIME THESE DIALOGS APPEAR/
Send: M876 S0
Recv: //action:prompt_end
Recv: //action:prompt_begin Paused
Recv: //action:prompt_button PurgeMore
Recv: //action:prompt_button Continue
Recv: //action:prompt_show
Recv: M876 Responding PROMPT_FILAMENT_RUNOUT
Recv: ok
[...]
Send: M876 S0
Recv: //action:prompt_end
Recv: //action:prompt_begin Paused
Recv: //action:prompt_button PurgeMore
Recv: //action:prompt_button Continue
Recv: //action:prompt_show
Recv: M876 Responding PROMPT_FILAMENT_RUNOUT
Recv: ok
[...]
Send: M876 S1
Recv: M876 Responding PROMPT_FILAMENT_RUNOUT
Recv: ok
It appears that part of Marlin thinks the M600 script is complete as soon as it receives the Nozzle Parked response, and the main gcode execution thread resumes, but another function is still handling the dialogs as if the print is still paused because it is supposed to be. I am thinking it has to do with this configuration failing to hold a BUSY state to stop the host from sending new gcode. That, of course, doesn't necessarily solve the fact that Purge More doesn't work, but it would be half of a solution.
Here are my current configuration files, this should make it relatively easy to test later on. I am using the X+ position for #define FIL_RUNOUT_PIN 2, otherwise it is configured for a stock setup.
If you want in depth details about how I got it working properly I couldn't say everything I need to say here, it's too much information. But if you have 12min to watch my video I think you'll understand where I am coming from.
https://www.youtube.com/watch?v=HJpfO8XifqI
I would very much like a permanent solution to this so no modification of Marlin is necessary on the backend! Whether that be help configuring something differently or changes to the repository!
Here are the changes that I found necessary to the previous build of Marlin:
//=============================================================================
//================================ Configuration.h ===============================
//=============================================================================
#define FILAMENT_RUNOUT_SENSOR
/*Self-explanatory. This is the foundation for everything we are doing.*/
#define FIL_RUNOUT_PIN 2 //MKS GEN L 1.0 X_MAX PIN
/*This assigns the FILAMENT_RUNOUT_SENSOR to the X+ pin (D2) of the MKS GEN L board. We will have to move the runout sensor from the TFT to this location in order to use it from both the TFT and Octoprint*/
/**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
/*This is important because Marlin will not monitor the runout sensor unless the print timer is running, so enabling this feature will allow us to activate the print timer while printing from the TFT.*/
/////////////////////////NOT USED FOR THIS TEST#define REPRAP_DISCOUNT_SMART_CONTROLLER
/*This allows us to enable the family of features necessary to activate the M600 scripts*/
//=============================================================================
//============================== Configuration_adv.h =============================
//=============================================================================
// 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
/*Note that this feature does not handle M876 in this description*/
/**
* 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
/*Both if these would probably work wonderfully if we were using a different serial port for the TFT*/
UPDATE FROM PRELIMINARY TESTING:
After enabling LCD support, behavior went back to normal, even without the EMERGENCY_OVERRIDE, so this is definitely an improvement over the previous version! No more backend modification necessary, just some Trojan horse action on the LCD support. It's not as elegant as I'd like, but it does work!
(I also enabled #define LCD_SET_PROGRESS_MANUALLY for later use. I want to display Octoprint progress on the TFT in the future.)
This behavior is also new, but the print did resume successfully afterwards:
Recv: //action:paused
Printer signalled that it paused, switching state...
Changing monitoring state from "Printing" to "Pausing"
Recv: //action:prompt_end
Recv: //action:prompt_begin Pause
Recv: //action:prompt_button Dismiss
Recv: //action:prompt_show
Recv: T:215.31 /215.00 B:59.96 /60.00 @:35 B@:19
Recv: echo:busy: processing
Recv: T:215.00 /215.00 B:60.05 /60.00 @:40 B@:16
Recv: echo:busy: processing
Recv: T:214.73 /215.00 B:59.99 /60.00 @:44 B@:18
Send: N2783 M876 S0*87
Recv: M876 Responding PROMPT_GCODE_INFO
Recv: echo:busy: processing
Recv: T:214.92 /215.00 B:60.02 /60.00 @:40 B@:17
Recv: echo:busy: processing
Recv: T:215.00 /215.00 B:59.97 /60.00 @:39 B@:18
Recv: T:214.88 /215.00 B:60.00 /60.00 @:40 B@:17
Recv: echo:busy: processing
Recv: T:214.92 /215.00 B:59.99 /60.00 @:39 B@:18
Recv: T:214.92 /215.00 B:59.99 /60.00 @:39 B@:18
Communication timeout while printing, trying to trigger response from printer. Configure long running commands or increase communication timeout if that happens regularly on specific commands or long moves.
Recv: echo:busy: processing
FYI, I noticed when rebasing my configs got blown out, so you may have seen a default config there. Its up correctly now. They were sitting in my offline changes not pushed. As the error suggests, have you increased the octoprint communication timeout, and set the checkbox that it is not the exclusive host? I just flashed my machine and ill be testing shortly.
I wasn't that concerned about the timeout at the moment. It may just be that the M600 is a long command process when the user is not present to handle the dialogs. If that's the case I couldn't avoid that error unless I completely disabled timeout error management.
I'll look for the exclusive host checkbox now.
Let me know how testing goes. I'm particularly interested in whether or not you can get the PurgeMore dialog to work without enabling LCD support.
Ive confirmed the issue is related to the Octoprint queue not Marlin. Ive forwarded some details to @foosel over discord. Once M876 is actually sent by the host, its processed however something is causing it to not jump the queue (maybe something in the capability report?) So we may need some info from that side.
Awesome! I'm assuming he's an Octoprint guy? If so, could you ask if he could update the parser for Host Prompt support so that Dialogs are automatically cleared when ack_seen("//action:prompt_end")? When I clear a dialog from the TFT I'd like it to clear from Octoprint at the same time. Unless that's what "the checkbox that it is not the exclusive host" does (I haven't gotten around to that yet).
NOTE: there was an error in my configuration_adv.h where the extruder fan was not defined.
Ive forwarded some details to @foosel over discord.
Thanks, but I'll also need an octoprint.log
and a serial.log
, otherwise all of this is just blind guessing. I just tested the functionality and it jumps the queue just fine over here if configured accordingly:
2020-06-22 09:20:10,458 - octoprint.util.comm - INFO - Force-sending M876 to the printer
Note that I have that still default to false
in current release versions and it will only force send if there's an S
parameter in the line (so a selection has been made), NOT when signaling general support with the P1
parameter during capability exchange.
Also note that your way of setting it as a emergency command here:
works just fine on my end as well:
2020-06-22 09:25:40,314 - octoprint.util.comm - INFO - Force-sending M876 to the printer
Important for this is that the firmware reports Cap:EMERGENCY_PARSER:1
which I saw in the example that you shot me over discord.
I'm assuming he's an Octoprint guy?
She.
To clarify the issue, it is independent of Octoprint and happens any time the M600 script is run.
If I do not define an LCD controller, PurgeMore/Continue selections do nothing at all. Print immediately resumes after the Nozzle Parked dialog. If I define an LCD controller, all operates as expected.
To be honest, knowing that I would not have access to M73 without defining an LCD controller sort of makes me glad this is an issue. I do plan to incorporate the option for the TFT to display a print percentage, even from Octoprint. So at this point I just thought you should be aware that it is not functioning the way you said it is supposed to earlier in the thread.
And on another note, while printing from Octoprint it would be nice to know what z height the printer is at. I have modified M155 to autoreport XYZE just like an M114 and it seems to work well but maybe you have a better idea.
Ultimately, it would be more elegant to autoreport M114 and release M73 for use without LCD support, in addition to negating the need for defining an LCD for our setups, but I do have it running to my satisfaction so no harm no foul if that doesn't happen. I'm just glad the new branched don't require backend mods to run M600!
Or maybe I can convince foosel to add an option to echo XYZ coordinates and print progress % while printing! That would limit the functionality to Octoprint, but that's all people talk about using anyway.
Or maybe I can convince foosel to add an option…
OctoPrint has a complete library of plugins to add extra behaviors.
If I do not define an LCD controller, PurgeMore/Continue selections do nothing at all
See if it helps to make this change in Conditionals_adv.h
…
- #if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS)
+ #if ANY(EXTENSIBLE_UI, NEWPANEL, EMERGENCY_PARSER, HAS_ADC_BUTTONS, HOST_PROMPT_SUPPORT)
#define HAS_RESUME_CONTINUE 1
#endif
No joy, behavior the same:
Send: M109 S180
echo:busy: processing
ok
wait
T:179.65 /180.00 B:22.50 /0.00 @:16 B@:0
X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
Send: M600
//action:paused
//action:prompt_end
//action:prompt_begin Pause
//action:prompt_button Dismiss
//action:prompt_show
T:177.23 /180.00 B:22.54 /0.00 @:52 B@:0 W:?
T:177.21 /180.00 B:22.46 /0.00 @:52 B@:0
X:0.00 Y:0.00 Z:0.00 E:-2.00 Count X:0 Y:0 Z:0
echo:busy: processing
echo:Insert filament and send M108 <-----M108 doesn't work. M876 S0 does.
//action:prompt_end
//action:prompt_begin Nozzle Parked
//action:prompt_button Continue
//action:prompt_show
echo:busy: paused for user
T:180.77 /180.00 B:22.62 /0.00 @:31 B@:0
X:0.00 Y:0.00 Z:0.00 E:-72.00 Count X:0 Y:0 Z:0
Send: M876 S0
M876 Responding PROMPT_FILAMENT_RUNOUT_CONTINUE
T:180.63 /180.00 B:22.58 /0.00 @:33 B@:0
X:0.00 Y:0.00 Z:0.00 E:-42.00 Count X:0 Y:0 Z:0
echo:busy: processing
//action:prompt_end
//action:prompt_begin Paused
//action:prompt_button PurgeMore
//action:prompt_button Continue
//action:prompt_show
//action:resumed
Send: M876 S0
ok <----expected: "M876 Responding PROMPT_FILAMENT_RUNOUTnokn", got: "oknokn"
ok
wait <--------------------STILL NO FILAMENT ON PURGE MORE, NO LONGER "busy:"
T:178.85 /180.00 B:22.58 /0.00 @:49 B@:0
X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
//action:prompt_end
//action:prompt_begin Paused
//action:prompt_button PurgeMore
//action:prompt_button Continue
//action:prompt_show
M876 Responding PROMPT_FILAMENT_RUNOUT
ok
T:178.94 /180.00 B:22.58 /0.00 @:48 B@:0
X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
wait
<--------------------STILL NO FILAMENT ON PURGE MORE
Send: M876 S0
//action:prompt_end
//action:prompt_begin Paused
//action:prompt_button PurgeMore
//action:prompt_button Continue
//action:prompt_show
M876 Responding PROMPT_FILAMENT_RUNOUT
ok
T:179.94 /180.00 B:22.46 /0.00 @:39 B@:0
X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
wait
Send: M876 S1
M876 Responding PROMPT_FILAMENT_RUNOUT
ok
T:181.15 /180.00 B:22.62 /0.00 @:28 B@:0
X:0.00 Y:0.00 Z:0.00 E:0.00 Count X:0 Y:0 Z:0
wait
This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.
I've forwarded some details to @foosel over discord.
Awesome! I'm assuming he's an Octoprint guy?
Bad assumption.
I've forwarded some details to @foosel over discord.
Awesome! I'm assuming he's an Octoprint guy?
Bad assumption.
Thanks I'm sure that was necessary. I've already spoken to her about it.
Found this thread - strongly believe it will answer the problems I have with my recently installed run-out sensor.
Hopefully the thread will stay in place till I get project completed.
Lowell
Found this thread - strongly believe it will answer the problems I have with my recently installed run-out sensor.
Lowell
I am able to get full functionality, even with the quirk that I have to define an LCD controller without actually having one. Luckily my board has enough memory to pull it off for now.
Sweet!
I am able to get full functionality, even with the quirk that I have to define an LCD controller without actually having one. Luckily my board has enough memory to pull it off for now.
One thing I considered doing was allowing the user to specify an endstop switch to substitute as a click of the LCD Panel's encoder wheel. That way, people without an LCD can still give the system a 'click' to indicate they are past a particular phase of the filament change sequence.
It really should not be much code or complexity to do that. But the thing that has kept it from happening is so few printers are missing an LCD Panel now days.
Host prompt support is more than capable of handling the situation. It would just be nice if it could be fully operational without defining an LCD controller. the entire artillery 3D printer line is lacking an encoder and they just released version 5 of The Sidewinder exactly the same
For the sake of discussion - I have an LCD on my MakerGear M2 Dual Rev E. The challenge has been incorporating the Run-Out switch into the code.
I've looked but a code modification/installation thread eludes me. I am currently close - but not close enough.
Lowell
Can you put the sensor on the main board?
The next best option is to have the lcd send an M600 when the filament runs out
Yes, the sensor is on the mainboard - the RAMBo board and the board supports the function, I have narrowed down the issue to the version of Marlin loaded on the system
V1.0.2
The last piece is enabling the Advanced Pause Feature - which I cannot find in V1.0.2
All that said I would love to upgrade to a newer version of Marlin - but am skeptical I can get all the settings correct, and MakerGear has no path forward for that upgrade at this time - to my knowledge.
I am unfamiliar with that system or it's limitations. You may want to keep an eye on free memory if it running Marlin 1.0 though
All that said I would love to upgrade to a newer version of Marlin - but am skeptical I can get all the settings correct, and MakerGear has no path forward for that upgrade at this time - to my knowledge.
You might try doing a M503 and see how complete of a dump of all the settings you get. Because if you get a fairly complete dump of all the magic numbers... Turning on or off what ever other features you want should be fairly tame.
Thanks for that advice - nice to see folks still want to share their madd
skillsets.
I'll do some more digging and kick the idea around some more. I'm going to
touch base with the technical team that makes the printer and see what
information I can drag out of them.
Take Care - be safe...
(my results)
SENT: M503
READ: echo:Steps per unit:
Steps per unit:
READ: echo: M92 X88.88 Y88.88 Z1007.70 E471.50
M92 X88.88 Y88.88 Z1007.70 E471.50
READ: echo:Maximum feedrates (mm/s):
Maximum feedrates (mm/s):
READ: echo: M203 X200.00 Y200.00 Z10.30 E25.00
M203 X200.00 Y200.00 Z10.30 E25.00
READ: echo:Maximum Acceleration (mm/s2):
Maximum Acceleration (mm/s2):
READ: echo: M201 X1000 Y1000 Z50 E2000
M201 X1000 Y1000 Z50 E2000
READ: echo:Acceleration: S=acceleration, T=retract acceleration
Acceleration: S=acceleration, T=retract acceleration
READ: echo: M204 S2000.00 T3000.00
M204 S2000.00 T3000.00
READ: echo:Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s)
READ: echo: M205 S0.00 T0.00 B20000 X4.00 Z0.40 E1.00
M205 S0.00 T0.00 B20000 X4.00 Z0.40 E1.00
READ: echo:Home offset (mm):
Home offset (mm):
READ: echo: M206 X11.11 Y0.00 Z10.97
M206 X11.11 Y0.00 Z10.97
READ: echo:PID settings:
PID settings:
READ: echo: M301 P25.89 I1.94 D86.53
M301 P25.89 I1.94 D86.53
READ: ok
This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hello! Sorry for the long wait. It took us a little more to figure out how the host was also working and to test the solution a bit. To change the filament using a host exclusively, one could follow these steps:
Configuration_adv.h
enableEMERGENCY_PARSER
(make sure to also update the related comment to includeM601
andM602
).enum.h
make enume_parser_state
look like this (this adds support for the two commands):a. modify the description comment to:
b. in the switch(state), modify case state_M like this:
c. in the switch(state), add these cases before case state_IGNORE:
d. in the switch(state), in the default case, there is another switch(state) case, add these cases before the inner default case:
After just these steps, M601 and M602 should work in such a way you don't need an encoder to change the filament any more.
We have successfully tested this with hosts such as Pronterface and OctoPrint.
In Pronterface, changing filament works as follows:
M600
M108
M601
(if you want to continue printing)M602
(if you want to extrude more)In OctoPrint, the host waits for an "ok" before sending the next command, and because M600 only sends this "ok" when the whole procedure is finished, "Fake Acknowledgement" is required. When having M600 inside a file, we noticed 2 "Fake Acknowledgement" is needed after each of the commands (M108, M601, M602), and only 1 "Fake Acknowledgement" was sufficient when M600 was explicitly sent by us. For instance:
M600
(initiated by the file)M108
M601
(if you want to continue printing)M602
(if you want to extrude more)I hope this helps someone! If you have any questions, please do ask.