Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a proper Filament change msg for M600 #1471

Open
rainersc opened this issue Jan 22, 2019 · 20 comments

Comments

Projects
None yet
6 participants
@rainersc
Copy link

commented Jan 22, 2019

I created myself a Printer Profile (for my MK3) that uses 2 or more Extruders by using a manual tool change GCode to change colors using M600. This allows multi color prints from Slic3r with manual M600 based filament changes (without having a MMU)
For 2 colors this works fine, but if i want to use more than 2 colors, the user would not know to which extruder/filament a change is requested.
A simple possibility to pass an additional Message like "change from [previous_extruder] to [next_extruder]"
would be able to resolve this.
Any chance to get this added?

@workinghard

This comment has been minimized.

Copy link

commented Jan 22, 2019

Please check if placing M117 "message" before M600 will work for you.

@rainersc

This comment has been minimized.

Copy link
Author

commented Jan 23, 2019

i tried m117 before posting here, but m117 does only display a message, does not wait for user input and the message is not visible in the moment where m117 is being called. so M117 does not help.
i checked as well: M1, m601/602, but noe provided a working solution

@workinghard

This comment has been minimized.

Copy link

commented Jan 23, 2019

M117 "message"
M0
M600

Should display the message and wait for button press. Once button is pressed, it will initiate M600. But I think this is not what you want because printer will sit on a perimeter and wait.

@rainersc

This comment has been minimized.

Copy link
Author

commented Jan 23, 2019

yes. there are 2 problems with that apoarch.

  1. printer does not go to the "filament change position"
  2. M0/M1 are not working good with octoprint

i still think that when calling M600 to ask for a filament change it is obvious that there should be a possibility to tell the user "which" change is required.
passing a new parameter e.g. "S change from to [next_extruder]" would give a clear indication of what is expected from the user and would be at the correct part of the workflow. if Slic3r would be enhanced as well and have a "color variable" this would allow a message to be created like "change to yellow filament"

@workinghard

This comment has been minimized.

Copy link

commented Jan 23, 2019

Agree. I would suggest to use M600 T<index> instead in order to stay marlin compliant.

@rainersc

This comment has been minimized.

Copy link
Author

commented Jan 24, 2019

one alternative way to resolve it would be if M600 would not clear out the message from a previous M117 command

@cool-RR

This comment has been minimized.

Copy link

commented Jan 26, 2019

Funny, I just had the idea for this feature while doing a 6-color print. I started writing a feature request, and saw that this one exists and was opened just 4 days ago. So count me as a +1 to this feature request.

@rainersc

This comment has been minimized.

Copy link
Author

commented Jan 27, 2019

just to explain a bit better why this would be good: i created a tool change gcode which adds these lines into the gcode for the different tool change positions:
M117 change to 1 red
M117 change to 2 black
M117 change to 0 yellow
M117 change to 1 red
M117 change to 0 yellow

but the message only gets displayed for 2-3 seconds while the extruder moves to the m600 filament change position.
If it would be still visible at the beginning of m600 this would help a lot and add more value to the printer for me.. (and everybody else that uses this profile or a similar one)

@rainersc

This comment has been minimized.

Copy link
Author

commented Mar 5, 2019

Here is the multicolor profile i am working on, which might explain why it would make sense to add this feature..
link

@rainersc

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

Thanks to the work of guy.k2, we have a working prototype with a slighltly different aproach.
He suggested a "M600 Q" parameter, which removes the initial
_M600_wait_for_user does
lcd_display_message_fullscreen_P(T(MSG_PRESS_TO_UNLOAD));
message.
This allows us to call something like

M117 Change to Yellow
M600 Q

There are 2 compiled test versions available ( for standard MK3 and for Bondtech variant).
more details can be found in this thread: https://shop.prusa3d.com/forum/user-mods-octoprint-enclosures-nozzles--f65/simple-way-to-print-in-real-multi-color-without-mm-t28186.html

@rainersc rainersc changed the title Feature Request: Message parameter for M600 Allow a proper Filament change msg for M600 Mar 7, 2019

@guykuo

This comment has been minimized.

Copy link

commented Mar 7, 2019

I'm a total newbie on github and have not learned how to properly branch and send pull requests. It's a pretty trivial bit of coding needed to implement the M600 Q parameter. Here are the relevant changes. I have commented the new/modified lines and included enough code lines around those to find the correct location in the existing files.

I would try to do a branch and submit myself, but I don't know github well enough to do so.
Anyways, this is what we have working....

in Marlin_main.cpp ===========================

=== in the case 600 statement

    case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]

	float e_shift_late = 0;
	bool automatic = false;
    	bool suppressInitialMessage = false;  //Kuo <---for M600 Q


          #ifdef FILAMENTCHANGE_YPOS
            y_position = FILAMENTCHANGE_YPOS ;
          #endif
        }

    	if(code_seen('Q')) 				//Kuo <---for M600 Q
        	{ 					//Kuo <---for M600 Q
          		suppressInitialMessage = true; 	//Kuo <---for M600 Q
        	}					//Kuo <---for M600 Q
        
	if (mmu_enabled && code_seen("AUTO"))
			automatic = true;



	gcode_M600(automatic, x_position, y_position, z_shift, e_shift_init, e_shift_late, suppressInitialMessage);  //Kuo <---for M600 Q


=== in static void gcode_M600

static void gcode_M600(bool automatic, float x_position, float y_position, float z_shift, float e_shift, float /*e_shift_late*/, bool suppressInitialMessage) //Kuo <---for M600 Q

    //Beep, manage nozzle heater and wait for user to start unload filament
    if(!mmu_enabled) M600_wait_for_user(HotendTempBckp, suppressInitialMessage); //Kuo <---for M600 Q


=== in void gcode_M600

void M600_wait_for_user(float HotendTempBckp, bool suppressInitialMessage) { //Kuo <---for M600 Q
    //kuo added suppressInitialMessage
		KEEPALIVE_STATE(PAUSED_FOR_USER);

		int counterBeep = 0;
		unsigned long waiting_start_time = millis();
		uint8_t wait_for_user_state = 0;
    
		if (!suppressInitialMessage) lcd_display_message_fullscreen_P(_T(MSG_PRESS_TO_UNLOAD));  //Kuo <---for M600 Q


in Marlin.h ===========================

void M600_load_filament();
void M600_load_filament_movements();
void M600_wait_for_user(float HotendTempBckp, bool suppressInitialMessage); //Kuo <---for M600 Q


@rainersc

This comment has been minimized.

Copy link
Author

commented Mar 7, 2019

i already tested the above change in a custom firmware that guykuo compiled for me, and i can confirm it works as expected and would be a perfect working solution for this feature request
@inquisitiveKangaroo can you perhaps help with getting this progressed?

@guykuo

This comment has been minimized.

Copy link

commented Mar 8, 2019

I learned how to create a branch and submit a request. However, I can do so only on my fork of the MK3 firmware. Does one need to be invited to gain the ability to create new branches for submittal to the MK3 repository?

@stahlfabrik

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

Yes of course. Please Read about Pull Requests

@guykuo

This comment has been minimized.

Copy link

commented Mar 8, 2019

Yes, I understand how to create a pull request, but I can only create pull requests from branches off my fork back to my fork. That keeps the MK3 repository safe.

I wish to create a branch that can be used to submit a pull request back the main repository. So I can help with this issue.

Who do I ask for permission to create a branch off the main MK3 repository?

Alternatively, is there (not so obvious) method to submit a pull request to the main MK3 repository from a branch of my fork?

@stahlfabrik

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

Yes, that is how pull requests work. You fork, you push to your fork. Then create a pull request

@guykuo

This comment has been minimized.

Copy link

commented Mar 8, 2019

EDIT:

OK I think I understand the issue. one can only create a pull request back to the main repository from my main fork, but cannot from a branch of my fork.

Next stumbling block is that my fork is primarily for supporting improve print quality using 0.9 degree steppers on x, y and e axes.

M600 Q parameter issue a totally different issue and ideally I would do just that in a separate branch. There is no way they would accept anything I submit from my fork with all the 0.9 motor support stuff.

Github only seems to support one fork in the account. So, only one issue at a time can be worked?

@stahlfabrik

This comment has been minimized.

Copy link
Contributor

commented Mar 8, 2019

You usually create a separate branch for a pull request that only has the changes you want to have pulled. Otherwise chances of getting it pulled are close to zero. :-) focus is very important

And the number of branches in your repository might be unlimited.

guykuo added a commit to guykuo/Prusa-Firmware that referenced this issue Mar 9, 2019

Implement M600 Q parameter
Added Q parameter to M600. Adding a Q parameter to end of M600 command suppresses M600's first MSG_PRESS_TO_UNLOAD.

This is desirable when using rainersc's nifty manual color change technique as described at
https://schlosshan.eu/blog/2019/03/02/prusa-i3-mk3-real-multicolour-prints-without-mmu/
and his github issue describing the need for this enhancement
prusa3d#1471

This enhancement allows message displayed by M117 to remain on screen rather than being immediately erased by M600's first MSG_PRESS_TO_UNLOAD. The follow up prompts by M600 are not suppressed. Omitting Q lets M600 work as normal. So this should not affect MMU function.

Usage:
M117 Change to yellow filament
M600 Q
@guykuo

This comment has been minimized.

Copy link

commented Mar 9, 2019

Rainer, I hope you don't mind, but I went ahead and put in a pull request for the M600 Q parameter

Had to delete my existing fork with all its 0.9 stepper mods. Create a new branch off it to implement the M600 Q and then submitted a pull request from that branch.

I will recreate my 0.9 stepper work in a new branch of my repository.

@rainersc

This comment has been minimized.

Copy link
Author

commented Mar 9, 2019

perfect! thanks a lot for your work and help on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.