MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.12k stars 19.2k forks source link

M600 - Changing filament without using LCD and encoder #11281

Closed bogdanbalanescu closed 3 years ago

bogdanbalanescu commented 6 years ago

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:

  1. Issue M600
  2. The printer pauses the print job, saves the current location, raises the nozzle, moves to the parking spot, retracts the filament, waits for user to insert filament and to press the encoder (or issue M108)
  3. The user inserts the filament, then presses the encoder (or issues M108)
  4. The printer extrudes the filament, then asks the user to either continue the print or extrude more filament
  5. The user chooses one of the options. (Repeats between 4 and 5 until the user chooses to continue the print) - (User can only communicate now via the encoder, choosing one of the two options - at this point no command is executed by the printer, not even M112).
  6. The printer moves to the printing position, then continues the printing job.

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.

  1. Add these lines to Configuration_adv.h:

    if ENABLED(ADVANCED_PAUSE_FEATURE)

    define FILAMENT_CHANGE_HOST_EXCLUSIVE // Enables M601 and M602

    endif

  2. In the Marlin_main.cpp, add the following lines of code before the definition of "process_parsed_command()":

    ifdef FILAMENT_CHANGE_HOST_EXCLUSIVE

    /**

    • M601: Advanced Pause Resume Print.
    • M602: Advanced Pause Extrude More.
    • */ inline void gcode_M601() { advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_RESUME_PRINT; } inline void gcode_M602() { advanced_pause_menu_response = ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE; }

      endif

  3. 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:

    if ENABLED(FILAMENT_CHANGE_HOST_EXCLUSIVE)

    case 601: gcode_M601(); break; case 602: gcode_M602(); break;

    endif

  4. 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!

AnHardt commented 6 years ago

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.

bogdanbalanescu commented 6 years ago

@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).

bogdanbalanescu commented 6 years ago

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:

  1. In 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
  2. In 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
  3. In MarlinSerial.cpp in emergency_parser function: a. modify the description comment to:
    // 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:

  4. M600
  5. Wait for the printer to retract the filament and beep.
  6. M108
  7. Wait for the printer to extrude the filament until it stops extruding.
  8. M601 (if you want to continue printing)
  9. 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:

  1. M600 (initiated by the file)
  2. Wait for the printer to retract the filament and beep.
  3. M108
  4. 2x Fake Acknowledgement
  5. Wait for the printer to extrude the filament until it stops extruding.
  6. M601 (if you want to continue printing)
  7. 2x Fake Acknowledgement
  8. M602 (if you want to extrude more)
  9. 2x Fake Acknowledgement

I hope this helps someone! If you have any questions, please do ask.

Mooses344 commented 4 years ago

Hello good morning, I can't make it work, only the m108 works but the M601 and the M602 don't

el-quique commented 4 years ago

Hello is for Marlin 1.1.9 or 2.0.x. Thanks

PrintEngineering commented 4 years ago

I've done it.

https://www.youtube.com/watch?v=HJpfO8XifqI

InsanityAutomation commented 4 years ago

This is rather ancient, host prompt support does this with M876 to choose actions as well.

PrintEngineering commented 4 years ago

Except the emergency parser does not work for M876.

InsanityAutomation commented 4 years ago

Yes it does, I coded it myself.

PrintEngineering commented 4 years ago

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!

define EMERGENCY_PARSER

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

if (DISABLED(EMERGENCY_PARSER) || ENABLED(EMERGENCY_OVERRIDE))

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

if (DISABLED(EMERGENCY_PARSER) || ENABLED(EMERGENCY_OVERRIDE))

include "../gcode.h"

include "../../MarlinCore.h" // for wait_for_heatup, kill, quickstop_stepper

/**

/**

/**

endif // !EMERGENCY_PARSER

InsanityAutomation commented 4 years ago

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.

PrintEngineering commented 4 years ago

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.

InsanityAutomation commented 4 years ago

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.

PrintEngineering commented 4 years ago

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.

PrintEngineering commented 4 years ago

Configuration.h.txt

PrintEngineering commented 4 years ago

Configuration_adv.h.txt

PrintEngineering commented 4 years ago

/**

/**

// @section temperature

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

// // Custom Thermistor 1000 parameters //

if TEMP_SENSOR_0 == 1000

define HOTEND0_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND0_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

ifndef NOVA

#define HOTEND0_BETA                 3950    // Beta value  

else

#define HOTEND0_BETA                 4267    // Beta value  //Ryan 4267// 

endif

endif

if TEMP_SENSOR_1 == 1000

define HOTEND1_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND1_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND1_BETA 3950 // Beta value

endif

if TEMP_SENSOR_2 == 1000

define HOTEND2_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND2_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND2_BETA 3950 // Beta value

endif

if TEMP_SENSOR_3 == 1000

define HOTEND3_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND3_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND3_BETA 3950 // Beta value

endif

if TEMP_SENSOR_4 == 1000

define HOTEND4_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND4_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND4_BETA 3950 // Beta value

endif

if TEMP_SENSOR_5 == 1000

define HOTEND5_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND5_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND5_BETA 3950 // Beta value

endif

if TEMP_SENSOR_6 == 1000

define HOTEND6_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND6_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND6_BETA 3950 // Beta value

endif

if TEMP_SENSOR_7 == 1000

define HOTEND7_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define HOTEND7_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define HOTEND7_BETA 3950 // Beta value

endif

if TEMP_SENSOR_BED == 1000

define BED_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define BED_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define BED_BETA 3950 // Beta value

endif

if TEMP_SENSOR_CHAMBER == 1000

define CHAMBER_PULLUP_RESISTOR_OHMS 4700 // Pullup resistor

define CHAMBER_RESISTANCE_25C_OHMS 100000 // Resistance at 25C

define CHAMBER_BETA 3950 // Beta value

endif

// // Hephestos 2 24V heated bed upgrade kit. // https://store.bq.com/en/heated-bed-kit-hephestos2 // //#define HEPHESTOS2_HEATED_BED_KIT

if ENABLED(HEPHESTOS2_HEATED_BED_KIT)

undef TEMP_SENSOR_BED

define TEMP_SENSOR_BED 70

define HEATER_BED_INVERTING true

endif

/**

if DISABLED(PIDTEMPBED)

define BED_CHECK_INTERVAL 5000 // ms between checks in bang-bang control

if ENABLED(BED_LIMIT_SWITCHING)

#define BED_HYSTERESIS 2 // Only disable heating if T>target+BED_HYSTERESIS and enable heating if T>target-BED_HYSTERESIS

endif

endif

/**

/**

/**

if ENABLED(PIDTEMP)

// Add an experimental additional term to the heater power, proportional to the extrusion speed. // A well-chosen Kc value should add just enough power to melt the increased material volume. //#define PID_EXTRUSION_SCALING

if ENABLED(PID_EXTRUSION_SCALING)

#define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
#define LPQ_MAX_LEN 50

endif

/**

/**

// Extra options for the M114 "Current Position" report //#define M114_DETAIL // Use 'M114` for details to check planner calculations

define M114_REALTIME // Real current position based on forward kinematics

//#define M114_LEGACY // M114 used to synchronize on every call. Enable if needed.

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

if ENABLED(EXTRUDER_RUNOUT_PREVENT)

define EXTRUDER_RUNOUT_MINTEMP 190

define EXTRUDER_RUNOUT_SECONDS 30

define EXTRUDER_RUNOUT_SPEED 1500 // (mm/m)

define EXTRUDER_RUNOUT_EXTRUDE 5 // (mm)

endif

// @section temperature

// Calibration for AD595 / AD8495 sensor to adjust temperature measurements. // The final temperature is calculated as (measuredTemp * GAIN) + OFFSET.

define TEMP_SENSOR_AD595_OFFSET 0.0

define TEMP_SENSOR_AD595_GAIN 1.0

define TEMP_SENSOR_AD8495_OFFSET 0.0

define TEMP_SENSOR_AD8495_GAIN 1.0

/**

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

/**

/**

// @section extruder

/**

define EXTRUDER_AUTO_FAN_TEMPERATURE 50

define EXTRUDER_AUTO_FAN_SPEED 255 // 255 == full speed

define CHAMBER_AUTO_FAN_TEMPERATURE 30

define CHAMBER_AUTO_FAN_SPEED 255

/**

/**

// @section homing

// If you want endstops to stay on (by default) even when not homing // enable this option. Override at any time with M120, M121. //#define ENDSTOPS_ALWAYS_ON_DEFAULT

// @section extras

//#define Z_LATE_ENABLE // Enable Z the last moment. Needed if your Z driver overheats.

// Employ an external closed loop controller. Override pins here if needed. //#define EXTERNAL_CLOSED_LOOP_CONTROLLER

if ENABLED(EXTERNAL_CLOSED_LOOP_CONTROLLER)

//#define CLOSED_LOOP_ENABLE_PIN -1 //#define CLOSED_LOOP_MOVE_COMPLETE_PIN -1

endif

/**

//#define X_DUAL_STEPPER_DRIVERS

if ENABLED(X_DUAL_STEPPER_DRIVERS)

define INVERT_X2_VS_X_DIR true // Set 'true' if X motors should rotate in opposite directions

//#define X_DUAL_ENDSTOPS

if ENABLED(X_DUAL_ENDSTOPS)

#define X2_USE_ENDSTOP _XMAX_
#define X2_ENDSTOP_ADJUSTMENT  0

endif

endif

//#define Y_DUAL_STEPPER_DRIVERS

if ENABLED(Y_DUAL_STEPPER_DRIVERS)

define INVERT_Y2_VS_Y_DIR true // Set 'true' if Y motors should rotate in opposite directions

//#define Y_DUAL_ENDSTOPS

if ENABLED(Y_DUAL_ENDSTOPS)

#define Y2_USE_ENDSTOP _YMAX_
#define Y2_ENDSTOP_ADJUSTMENT  0

endif

endif

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

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

if NUM_Z_STEPPER_DRIVERS > 1

//#define Z_MULTI_ENDSTOPS

if ENABLED(Z_MULTI_ENDSTOPS)

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

endif

endif

/**

endif // DUAL_X_CARRIAGE

// Activate a solenoid on the active extruder with M380. Disable all with M381. // Define SOL0_PIN, SOL1_PIN, etc., for each extruder that has a solenoid. //#define EXT_SOLENOID

// @section homing

// Homing hits each endstop, retracts by these distances, then does a slower bump.

define X_HOME_BUMP_MM 2

define Y_HOME_BUMP_MM 2

define Z_HOME_BUMP_MM 1

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

define QUICK_HOME // If homing includes X and Y, do a diagonal move initially

//#define HOMING_BACKOFF_MM { 2, 2, 2 } // (mm) Move away from the endstops after homing

// When G28 is called, this option will make Y home before X //#define HOME_Y_BEFORE_X

// Enable this if X or Y can't home without homing the other axis first. //#define CODEPENDENT_XY_HOMING

if ENABLED(BLTOUCH)

/**

endif // BLTOUCH

/**

// @section motion

define AXIS_RELATIVE_MODES { false, false, false, false }

// Add a Duplicate option for well-separated conjoined nozzles //#define MULTI_NOZZLE_DUPLICATION

// By default pololu step drivers require an active high signal. However, some high power drivers require an active low signal as step.

define INVERT_X_STEP_PIN false

define INVERT_Y_STEP_PIN false

define INVERT_Z_STEP_PIN false

define INVERT_E_STEP_PIN false

// Default stepper release if idle. Set to 0 to deactivate. // Steppers will shut down DEFAULT_STEPPER_DEACTIVE_TIME seconds after the last move when DISABLEINACTIVE? is true. // Time can be set by M18 and M84.

define DEFAULT_STEPPER_DEACTIVE_TIME 120

define DISABLE_INACTIVE_X true

define DISABLE_INACTIVE_Y true

define DISABLE_INACTIVE_Z true // Set to false if the nozzle will fall down on your printed part when print has finished.

define DISABLE_INACTIVE_E true

define DEFAULT_MINIMUMFEEDRATE 0.0 // minimum feedrate

define DEFAULT_MINTRAVELFEEDRATE 0.0

//#define HOME_AFTER_DEACTIVATE // Require rehoming after steppers are deactivated

// Minimum time that a segment needs to take if the buffer is emptied

define DEFAULT_MINSEGMENTTIME 20000 // (ms)

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

define SLOWDOWN

if ENABLED(SLOWDOWN)

define SLOWDOWN_DIVISOR 2

endif

// Frequency limit // See nophead's blog for more info // Not working O //#define XY_FREQUENCY_LIMIT 15

// Minimum planner junction speed. Sets the default minimum speed the planner plans for at the end // of the buffer and all stops. This should not be much greater than zero and should only be changed // if unwanted behavior is observed on a user's machine when running at very slow speeds.

define MINIMUM_PLANNER_SPEED 0.05 // (mm/s)

// // Backlash Compensation // Adds extra movement to axes on direction-changes to account for backlash. // //#define BACKLASH_COMPENSATION

if ENABLED(BACKLASH_COMPENSATION)

// Define values for backlash distance and correction. // If BACKLASH_GCODE is enabled these values are the defaults.

define BACKLASH_DISTANCE_MM { 0, 0, 0 } // (mm)

define BACKLASH_CORRECTION 0.0 // 0.0 = no correction; 1.0 = full correction

// Set BACKLASH_SMOOTHING_MM to spread backlash correction over multiple segments // to reduce print artifacts. (Enabling this is costly in memory and computation!) //#define BACKLASH_SMOOTHING_MM 3 // (mm)

// Add runtime configuration and tuning of backlash values (M425) //#define BACKLASH_GCODE

if ENABLED(BACKLASH_GCODE)

// Measure the Z backlash when probing (G29) and set with "M425 Z"
#define MEASURE_BACKLASH_WHEN_PROBING

#if ENABLED(MEASURE_BACKLASH_WHEN_PROBING)
  // When measuring, the probe will move up to BACKLASH_MEASUREMENT_LIMIT
  // mm away from point of contact in BACKLASH_MEASUREMENT_RESOLUTION
  // increments while checking for the contact to be broken.
  #define BACKLASH_MEASUREMENT_LIMIT       0.5   // (mm)
  #define BACKLASH_MEASUREMENT_RESOLUTION  0.005 // (mm)
  #define BACKLASH_MEASUREMENT_FEEDRATE    Z_PROBE_SPEED_SLOW // (mm/m)
#endif

endif

endif

/**

/**

/**

// Microstep setting (Only functional when stepper driver microstep pins are connected to MCU.

define MICROSTEP_MODES { 16, 16, 16, 16, 16, 16 } // [1,2,4,8,16]

/**

// Use an I2C based DIGIPOT (e.g., Azteeg X3 Pro) //#define DIGIPOT_I2C

if ENABLED(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)

/**

//#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster

define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 MKS SBASE: 5

// Actual motor currents in Amps. The number of entries must match DIGIPOT_I2C_NUM_CHANNELS. // These correspond to the physical drivers, so be mindful if the order is changed.

define DIGIPOT_I2C_MOTOR_CURRENTS { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 } // AZTEEG_X3_PRO

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

// @section lcd

if EITHER(ULTIPANEL, EXTENSIBLE_UI)

define MANUAL_FEEDRATE { 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

endif

// Change values more rapidly when the encoder is rotated faster

define ENCODER_RATE_MULTIPLIER

if ENABLED(ENCODER_RATE_MULTIPLIER)

define ENCODER_10X_STEPS_PER_SEC 30 // (steps/s) Encoder rate for 10x speed

define ENCODER_100X_STEPS_PER_SEC 80 // (steps/s) Encoder rate for 100x speed

endif

// Play a beep when the feedrate is changed from the Status Screen //#define BEEP_ON_FEEDRATE_CHANGE

if ENABLED(BEEP_ON_FEEDRATE_CHANGE)

define FEEDRATE_CHANGE_BEEP_DURATION 10

define FEEDRATE_CHANGE_BEEP_FREQUENCY 440

endif

if HAS_LCD_MENU

// Include a page of printer information in the LCD Main Menu //#define LCD_INFO_MENU

if ENABLED(LCD_INFO_MENU)

//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages

endif

// BACK menu items keep the highlight at the top //#define TURBO_BACK_MENU_ITEM

/**

endif // HAS_LCD_MENU

// Scroll a longer status message into view //#define STATUS_MESSAGE_SCROLLING

// On the Info Screen, display XY with one decimal place when possible //#define LCD_DECIMAL_SMALL_XY

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

// Add an 'M73' G-code to set the current percentage

define LCD_SET_PROGRESS_MANUALLY

// Show the E position (filament used) during printing

define LCD_SHOW_E_TOTAL

if ENABLED(SHOW_BOOTSCREEN)

define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)

endif

if HAS_GRAPHICAL_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)

//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits //#define SHOW_REMAINING_TIME // Display estimated time to completion

if ENABLED(SHOW_REMAINING_TIME)

//#define USE_M73_REMAINING_TIME     // Use remaining time from M73 command instead of estimation
//#define ROTATE_PROGRESS_DISPLAY    // Display (P)rogress, (E)lapsed, and (R)emaining time

endif

endif

if HAS_CHARACTER_LCD && EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)

define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing

if ENABLED(LCD_PROGRESS_BAR)

#define PROGRESS_BAR_BAR_TIME 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

endif

if ENABLED(SDSUPPORT)

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

/**

endif // SDSUPPORT

/**

/**

endif // HAS_GRAPHICAL_LCD

// // Additional options for DGUS / DWIN displays //

if HAS_DGUS_LCD

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

endif // HAS_DGUS_LCD

// // Touch UI for the FTDI Embedded Video Engine (EVE) //

if ENABLED(TOUCH_UI_FTDI_EVE)

// Display board used //#define LCD_FTDI_VM800B35A // FTDI 3.5" with FT800 (320x240) //#define LCD_4DSYSTEMS_4DLCD_FT843 // 4D Systems 4.3" (480x272) //#define LCD_HAOYU_FT800CB // Haoyu with 4.3" or 5" (480x272) //#define LCD_HAOYU_FT810CB // Haoyu with 5" (800x480) //#define LCD_ALEPHOBJECTS_CLCD_UI // Aleph Objects Color LCD UI

// Correct the resolution if not using the stock TFT panel. //#define TOUCH_UI_320x240 //#define TOUCH_UI_480x272 //#define TOUCH_UI_800x480

// Mappings for boards with a standard RepRapDiscount Display connector //#define AO_EXP1_PINMAP // AlephObjects CLCD UI EXP1 mapping //#define AO_EXP2_PINMAP // AlephObjects CLCD UI EXP2 mapping //#define CR10_TFT_PINMAP // Rudolph Riedel's CR10 pin mapping //#define 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

endif

// // FSMC Graphical TFT //

if ENABLED(FSMC_GRAPHICAL_TFT)

//#define TFT_MARLINUI_COLOR 0xFFFF // White //#define TFT_MARLINBG_COLOR 0x0000 // Black //#define TFT_DISABLED_COLOR 0x0003 // Almost black //#define TFT_BTCANCEL_COLOR 0xF800 // Red //#define TFT_BTARROWS_COLOR 0xDEE6 // 11011 110111 00110 Yellow //#define TFT_BTOKMENU_COLOR 0x145F // 00010 100010 11111 Cyan

endif

// // ADC Button Debounce //

if HAS_ADC_BUTTONS

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

endif

// @section safety

/**

// @section lcd

/**

ifndef ABL

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

endif

// @section extruder

/**

define LIN_ADVANCE

if ENABLED(LIN_ADVANCE)

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

endif

// @section leveling

/**

/**

if EITHER(MESH_BED_LEVELING, AUTO_BED_LEVELING_UBL)

// Override the mesh area if the automatic (max) area is too large //#define MESH_MIN_X MESH_INSET //#define MESH_MIN_Y MESH_INSET //#define MESH_MAX_X X_BED_SIZE - (MESH_INSET) //#define MESH_MAX_Y Y_BED_SIZE - (MESH_INSET)

endif

/**

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 ARC_SUPPORT // Disable this feature to save ~3226 bytes

if ENABLED(ARC_SUPPORT)

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

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

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

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

define N_ARC_CORRECTION 25 // Number of interpolated segments between corrections

define ARC_P_CIRCLES // Enable the 'P' parameter to specify complete circles

//#define CNC_WORKSPACE_PLANES // Allow G2/G3 to operate in XY, ZX, or YZ planes

endif

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

define BEZIER_CURVE_SUPPORT

/**

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

define MIN_STEPS_PER_SEGMENT 4

/**

/**

/**

// @section temperature

// Control heater 0 and heater 1 in parallel. //#define HEATERS_PARALLEL

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

// @section hidden

// The number of linear motions that can be in the plan at any give time. // THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2 (e.g. 8, 16, 32) because shifts and ors are used to do the ring-buffering.

if ENABLED(SDSUPPORT)

define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller

else

define BLOCK_BUFFER_SIZE 32 // maximize block buffer

endif

// @section serial

// The ASCII buffer for serial input

define MAX_CMD_SIZE 96

define BUFSIZE 4

// Transmission to Host Buffer Size // To save 386 bytes of PROGMEM (and TX_BUFFER_SIZE+3 bytes of RAM) set to 0. // To buffer a simple "ok" you need 4 bytes. // For ADVANCED_OK (M105) you need 32 bytes. // For debug-echo: 128 bytes for the optimal speed. // Other output doesn't need to be that speedy. // :[0, 2, 4, 8, 16, 32, 64, 128, 256]

define TX_BUFFER_SIZE 0

// Host Receive Buffer Size // Without XON/XOFF flow control (see SERIAL_XON_XOFF below) 32 bytes should be enough. // To use flow control, set this buffer size to at least 1024 bytes. // :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048] //#define RX_BUFFER_SIZE 1024

if RX_BUFFER_SIZE >= 1024

// Enable to have the controller send XON/XOFF control characters to // the host to signal the RX buffer is becoming full. //#define SERIAL_XON_XOFF

endif

// Add M575 G-code to change the baud rate

define BAUD_RATE_GCODE

if ENABLED(SDSUPPORT)

// Enable this option to collect and display the maximum // RX queue usage after transferring a file to SD. //#define SERIAL_STATS_MAX_RX_QUEUED

// Enable this option to collect and display the number // of dropped bytes after a file transfer to SD. //#define SERIAL_STATS_DROPPED_RX

endif

// Enable an emergency-command parser to intercept certain commands as they // enter the serial receive buffer, so they cannot be blocked. // Currently handles M108, M112, M410 // Does not work on boards using AT90USB (USBCON) processors!

define EMERGENCY_PARSER

//Override restrictions of EMERGENCY_PARSER to allow M108 and M876 emulation without Marlin Mode Capable LCD

define EMERGENCY_OVERRIDE

// Bad Serial-connections can miss a received command by sending an 'ok' // Therefore some clients abort after 30 seconds in a timeout. // Some other clients start sending commands while receiving a 'wait'. // This "wait" is only sent when the buffer is empty. 1 second is a good value here.

define NO_TIMEOUTS 1000 // Milliseconds //fix ?

// Some clients will have this feature soon. This could make the NO_TIMEOUTS unnecessary. //#define ADVANCED_OK

// Printrun may have trouble receiving long strings all at once. // This option inserts short delays between lines of serial output.

define SERIAL_OVERRUN_PROTECTION

// @section extras

/**

/**

/**

/**

// @section tmc

/**

endif // TMC26X

// @section tmc_smart

/**

endif // HAS_TRINAMIC_CONFIG

// @section L64XX

/**

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

/**

endif // HAS_L64XX

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

if ENABLED(EXPERIMENTAL_I2CBUS)

define I2C_SLAVE_ADDRESS 0 // Set a value from 8 to 127 to act as a slave

endif

// @section extras

/**

/**

/**

/**

if ENABLED(FILAMENT_WIDTH_SENSOR)

define FILAMENT_SENSOR_EXTRUDER_NUM 0 // Index of the extruder that has the filament sensor. :[0,1,2,3,4]

define MEASUREMENT_DELAY_CM 14 // (cm) The distance from the filament sensor to the melting chamber

define FILWIDTH_ERROR_MARGIN 1.0 // (mm) If a measurement differs too much from nominal width ignore it

define MAX_MEASUREMENT_DELAY 20 // (bytes) Buffer size for stored measurements (1 byte per cm). Must be larger than MEASUREMENT_DELAY_CM.

define DEFAULT_MEASURED_FILAMENT_DIA DEFAULT_NOMINAL_FILAMENT_DIA // Set measured to nominal initially

// Display filament width on the LCD status line. Status messages will expire after 5 seconds. //#define FILAMENT_LCD_DISPLAY

endif

/**

/**

/**

/**

/**

if DISABLED(NO_VOLUMETRICS)

/**

/**

/**

/**

if ENABLED(FASTER_GCODE_PARSER)

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

endif

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

/**

// Enable and set a (default) feedrate for all G0 moves

define G0_FEEDRATE 9000 // (mm/m)

ifdef G0_FEEDRATE

define VARIABLE_G0_FEEDRATE // The G0 feedrate is set by F in G0 motion mode

endif

/**

/**

/**

/**

/**

/**

//#define I2C_POSITION_ENCODERS

if ENABLED(I2C_POSITION_ENCODERS)

define I2CPE_ENCODER_CNT 1 // The number of encoders installed; max of 5

                                                        // encoders supported currently.

define I2CPE_ENC_1_ADDR I2CPE_PRESET_ADDR_X // I2C address of the encoder. 30-200.

define I2CPE_ENC_1_AXIS X_AXIS // Axis the encoder module is installed on. <X|Y|Z|E>_AXIS.

define I2CPE_ENC_1_TYPE I2CPE_ENC_TYPE_LINEAR // Type of encoder: I2CPE_ENC_TYPE_LINEAR -or-

                                                        // I2CPE_ENC_TYPE_ROTARY.

define I2CPE_ENC_1_TICKS_UNIT 2048 // 1024 for magnetic strips with 2mm poles; 2048 for

                                                        // 1mm poles. For linear encoders this is ticks / mm,
                                                        // for rotary encoders this is ticks / revolution.

//#define I2CPE_ENC_1_TICKS_REV (16 200) // Only needed for rotary encoders; number of stepper // steps per full revolution (motor steps/rev microstepping) //#define I2CPE_ENC_1_INVERT // Invert the direction of axis travel.

define I2CPE_ENC_1_EC_METHOD I2CPE_ECM_MICROSTEP // Type of error error correction.

define I2CPE_ENC_1_EC_THRESH 0.10 // Threshold size for error (in mm) above which the

                                                        // printer will attempt to correct the error; errors
                                                        // smaller than this are ignored to minimize effects of
                                                        // measurement noise / latency (filter).

define I2CPE_ENC_2_ADDR I2CPE_PRESET_ADDR_Y // Same as above, but for encoder 2.

define I2CPE_ENC_2_AXIS Y_AXIS

define I2CPE_ENC_2_TYPE I2CPE_ENC_TYPE_LINEAR

define I2CPE_ENC_2_TICKS_UNIT 2048

//#define I2CPE_ENC_2_TICKS_REV (16 * 200) //#define I2CPE_ENC_2_INVERT

define I2CPE_ENC_2_EC_METHOD I2CPE_ECM_MICROSTEP

define I2CPE_ENC_2_EC_THRESH 0.10

define I2CPE_ENC_3_ADDR I2CPE_PRESET_ADDR_Z // Encoder 3. Add additional configuration options

define I2CPE_ENC_3_AXIS Z_AXIS // as above, or use defaults below.

define I2CPE_ENC_4_ADDR I2CPE_PRESET_ADDR_E // Encoder 4.

define I2CPE_ENC_4_AXIS E_AXIS

define I2CPE_ENC_5_ADDR 34 // Encoder 5.

define I2CPE_ENC_5_AXIS E_AXIS

// Default settings for encoders which are enabled, but without settings configured above.

define I2CPE_DEF_TYPE I2CPE_ENC_TYPE_LINEAR

define I2CPE_DEF_ENC_TICKS_UNIT 2048

define I2CPE_DEF_TICKS_REV (16 * 200)

define I2CPE_DEF_EC_METHOD I2CPE_ECM_NONE

define I2CPE_DEF_EC_THRESH 0.1

//#define I2CPE_ERR_THRESH_ABORT 100.0 // Threshold size for error (in mm) error on any given // axis after which the printer will abort. Comment out to // disable abort behavior.

define I2CPE_TIME_TRUSTED 10000 // After an encoder fault, there must be no further fault

                                                        // for this amount of time (in ms) before the encoder
                                                        // is trusted again.

/**

endif // I2C_POSITION_ENCODERS

/**

/**

/**

/**

if EITHER(WIFISUPPORT, ESP3D_WIFISUPPORT)

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

/**

/**

endif // PRUSA_MMU2

/**

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

define PINS_DEBUGGING

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

InsanityAutomation commented 4 years ago

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.

PrintEngineering commented 4 years ago

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

Configuration_adv.h.txt Configuration.h.txt

PrintEngineering commented 4 years ago

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*/
PrintEngineering commented 4 years ago

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

PrintEngineering commented 4 years ago

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
InsanityAutomation commented 4 years ago

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.

PrintEngineering commented 4 years ago

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.

InsanityAutomation commented 4 years ago

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.

PrintEngineering commented 4 years ago

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

PrintEngineering commented 4 years ago

NOTE: there was an error in my configuration_adv.h where the extruder fan was not defined.

foosel commented 4 years ago

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:

image

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:

image

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.

PrintEngineering commented 4 years ago

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.

thinkyhead commented 4 years ago

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
PrintEngineering commented 4 years ago

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_RUNOUT\nok\n", got: "ok\nok\n" 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

github-actions[bot] commented 4 years ago

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.

Roxy-3D commented 4 years ago

I've forwarded some details to @foosel over discord.

Awesome! I'm assuming he's an Octoprint guy?

Bad assumption.

PrintEngineering commented 4 years ago

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.

Papa-LF commented 4 years ago

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

PrintEngineering commented 4 years ago

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.

Papa-LF commented 4 years ago

Sweet!

Roxy-3D commented 4 years ago

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.

PrintEngineering commented 4 years ago

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

Papa-LF commented 4 years ago

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

PrintEngineering commented 4 years ago

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

Papa-LF commented 4 years ago

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 image V1.0.2

The last piece is enabling the Advanced Pause Feature - which I cannot find in V1.0.2 image

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.

PrintEngineering commented 4 years ago

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

Roxy-3D commented 4 years ago

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.

Papa-LF commented 4 years ago

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

github-actions[bot] commented 3 years ago

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.

github-actions[bot] commented 3 years ago

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.