Skip to content

Auto Filament Change Reworked: finally working#3638

Closed
clexpert wants to merge 17 commits intoMarlinFirmware:RCBugFixfrom
clexpert:RCBugFix
Closed

Auto Filament Change Reworked: finally working#3638
clexpert wants to merge 17 commits intoMarlinFirmware:RCBugFixfrom
clexpert:RCBugFix

Conversation

@clexpert
Copy link
Contributor

(Don't mix up with Manual filament change #3605)

Background

Months ago, someone suggested reworking (or at leats make existing function work) Auto filament change in #2926 and #2933. This function is working (as mentioned there) in Prusa's firmware and many other closed-source 3D printer. But neither of them is sufficient to be publicated for community of most used 3D firmware, with variety of printers, extruders and displays. So we started working on complete rewrite of filament change function, to make it work for us and then make it open to everyone here on GitHub.

Functions

This change rewrites Auto Filament Change controlled by G-Code M600.
The procedure of change is:

  • Retract a bit and move axis to position set by Configuration or by G-Code parameters
  • Unload filament
  • Keep beeping and wait for user to insert filament and click on button (encoder)
  • Load filament through bowden (see Configuration for details)
  • Extrude some filament and ask user either to extrude more or to resume print
  • Move axis back and continue printing
    Every step is clearly documented with information messages displayed on the display. As suggested by others, KEEP_ALIVE is also used. Simple working procedure makes it easy to change filament for everyone.

TODO list for community

  • Check behaviour on DELTA printers
  • Choose load and extrude distances for all example printers
  • Translate messages

#define AUTO_FILAMENT_CHANGE //This extrude filament until you press the button on LCD
#define AUTO_FILAMENT_CHANGE_LENGTH 0.04 //Extrusion length on automatic extrusion loop
#define AUTO_FILAMENT_CHANGE_FEEDRATE 300 //Extrusion feedrate (mm/min) on automatic extrusion loop
#define FILAMENT_CHANGE_ENABLE // Enable filament exchange menu and M600 g-code (used for runout sensor too)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep it disabled by default.

#endif

//return to normal
millis_t ms = millis();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The buzz block should be inside #if HAS_BUZZER.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clexpert if ms is not used elsewhere I would suggest:

#if HAS_BUZZER
  millis_t ms = millis();
  if (ms >= next_tick) {
    buzz(300, 2000);
    next_tick = ms + 2500; // Beep every 2.5s while waiting
  }
#endif

void lcd_buttons_update();
extern volatile uint8_t buttons; //the last checked buttons in a bit array.
#if ENABLED(FILAMENT_CHANGE_ENABLE)
enum FilamentChangeMessage {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the attributions from the enum:

enum FilamentChangeMessage {
  FILAMENT_CHANGE_MESSAGE_INIT,
  FILAMENT_CHANGE_MESSAGE_UNLOAD,
  FILAMENT_CHANGE_MESSAGE_INSERT,
  FILAMENT_CHANGE_MESSAGE_LOAD,
  FILAMENT_CHANGE_MESSAGE_EXTRUDE,
  FILAMENT_CHANGE_MESSAGE_OPTION,
  FILAMENT_CHANGE_MESSAGE_RESUME,
  FILAMENT_CHANGE_MESSAGE_STATUS
};

@jbrazio
Copy link
Contributor

jbrazio commented Apr 28, 2016

@clexpert good work this seems to be very promising, a proper process to handle filament changes on single extruder setups was really missing in Marlin.

@jbrazio
Copy link
Contributor

jbrazio commented Apr 28, 2016

@clexpert may I suggest a rebase of this PR using git rebase -i origin/RCBugFix, some of the commits could be merged together by fixup.

@clexpert
Copy link
Contributor Author

@jbrazio Thank you very much for all your quick comments. I corrected all your remarks. So I use web based github only so I cannot merge commits together.

@Spoonunit
Copy link

Is there anything in here that will prevent this from working with multiple extruders? i.e., if T1 is the active tool, that should be the tool where the retraction occurs. If a position to move to is configured, this should honor any M218 settings. Just a thought as multiple extruders aren't always multiple colors, but sometimes multiple materials (soluble support for example). Many thanks for working auto filament change whatever the response :)

@jbrazio
Copy link
Contributor

jbrazio commented Apr 28, 2016

That is a very interesting point @Spoonunit, M600 should affect the current selected tool and honor any active offset when moving to the material change position.

#ifdef FILAMENTCHANGE_ZADD
else destination[Z_AXIS] += FILAMENTCHANGE_ZADD;
#ifdef FILAMENT_CHANGE_Z_ADD
else destination[Z_AXIS] += FILAMENT_CHANGE_Z_ADD;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An improvement suggestion, this should check if the move will not go over Z-Max.

@clexpert
Copy link
Contributor Author

@jbrazio Thanks for the idea. I will check it and update today.

@clexpert
Copy link
Contributor Author

clexpert commented May 1, 2016

@jbrazio Z_MAX_POS checking is done. But I have a problem with "This branch has conflicts that must be resolved". Please, would you help me?

@jbrazio
Copy link
Contributor

jbrazio commented May 1, 2016

@clexpert This requires some git ninja skills as @thinkyhead did some refactoring on functions that are now methods and your code is still using the function names. When this is merged I'm sure @thinkyhead will resolve those conflicts or I can step in to help you out on the command line as it seems you're lacking the skills.

Do you consider this rework done thus ready to be merged ?

@clexpert
Copy link
Contributor Author

clexpert commented May 1, 2016

@jbrazio It would be nice :-) Yes, I am sure that this rework is ready to be merged. I tested it on my 3D printer without any problem. I only think that it needs test on delta printer. I think that @thinkyhead has the one.

@jbrazio
Copy link
Contributor

jbrazio commented May 2, 2016

@thinkyhead is running a Prusa i3, Delta.. @Roxy-3DPrintBoard has one and @CONSULitAS also has a Kossel I believe.

@thinkyhead
Copy link
Member

thinkyhead commented May 2, 2016

I've made a copy of this branch and will patch it up and rebase it to the latest RCBugFix code. When it's ready I will post it under a new PR.

git remote add clexpert git@github.com:clexpert/Marlin.git
git fetch clexpert
git checkout clexpert/RCBugFix -b rc_fixup_auto_filament_change
git rebase RCBugFix
...
git rebase -i RCBugFix

@CONSULitAS
Copy link
Contributor

@jbrazio
I have a modified K8200/3Drag (cartesian with E3D V6 hotend and Wade like extruder).

Would like to test asap. But i am rather busy now.

@thinkyhead
Copy link
Member

This is moved over to #3662, rebased on the latest code with excess commits squashed.

@thinkyhead thinkyhead closed this May 2, 2016
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 2016
drewmoseley pushed a commit to drewmoseley/Marlin that referenced this pull request Nov 8, 2023
TM: Consume LCD click after calibration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants