I recently tried to change the filament in the middle of a print from the LCD and it failed. It seemed to try to home the print head in the X,Y direction, but told the motors to go beyond the 0,0 point. There was lots of clicking and I had to turn the printer off. Has anyone successfully changed the filament using the LCD while printing?
Here are more details on what I did:
- Print from SD Card -> Use gcode params -> select "file.gcode" and start printing
- Tune -> Change Filament
It appears to try to move the Y beyond 0 and starts missing steps on the motor. If I let it continue, it won't go back to the right spot and resume printing. Clearly something is broken in this feature.
The Tune-> Change Filament menu item appears to be in ultralcd.cpp
static void lcd_tune_menu()
{
[....]
#ifdef FILAMENTCHANGEENABLE
MENU_ITEM(gcode, MSG_FILAMENTCHANGE, PSTR("M600"));
#endif
END_MENU();
}
And all it appears to do is send a parameter-less M600 command.
In Marlin_main.cpp, the M600 command is defined as:
// M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
and that command is processed in the 'M' case statement further down. There appears to be a bug in the X parameter. It should be absolute, but it's relative:
case 600: //Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]
{
[....]
//move xy
if(code_seen('X'))
{
target[X_AXIS]+= code_value();
}
else
{
#ifdef FILAMENTCHANGE_XPOS
target[X_AXIS]= FILAMENTCHANGE_XPOS ;
#endif
}
[....]
This line should not have a + in it:
target[X_AXIS]+= code_value();
it should read:
target[X_AXIS]= code_value();
Which is what the Y axis does and is also consistent with the X-axis default on the 'else' side of the 'if'.
While that appears to be a bug, this does not explain the problem I am seeing.
If the LCD is sending a parameter-less M600, then it should be using the default values which are Configuration_adv.h:
#ifdef ULTIPANEL
#define FILAMENTCHANGEENABLE
#ifdef FILAMENTCHANGEENABLE
#define FILAMENTCHANGE_XPOS 100
#define FILAMENTCHANGE_YPOS 100
#define FILAMENTCHANGE_ZADD 10
#define FILAMENTCHANGE_FIRSTRETRACT -0
#define FILAMENTCHANGE_FINALRETRACT -200
#define FILAMENTCHANGE_FEEDRATE 600
#endif
#endif
Do those values even make sense on a Materia101? When I have more time, I'm going to try to modify the firmware, but I wanted to check to see if others are having this problem as well.
Thanks in advance for responses. I'm not sure if this post belongs here or should be over on github.
- John