Notifications
Clear all

Wrongly implemented M600 command  

  RSS
krzysztof.kl
(@krzysztof-kl)
New Member
Wrongly implemented M600 command

Hi,

I have checked for the implementation of M600 command. I need to specify in what XY position i want to change my filament, but at the moment I cannot do that easily.

Form source file:
// M600 - Pause for filament change X[pos] Y[pos] Z[relative lift] E[initial retract] L[later retract distance for removal]

So when i add this line to the gcode file:
M600 X200 Y200
i expect the change to occur at position 200,200
Instead, extruder tries to move 200,200 from current position which of course result in hitting the end of XY axis, skipped steps and failed print.
Is this the correct behavior of M600 command?

I have found part of the source file that is responsible for that behavior:


if(code_seen('X'))
{
target[X_AXIS]+= code_value();
}
else
{
#ifdef
target[X_AXIS]= FILAMENTCHANGE_XPOS ;
#endif
}

As we can see, when I do not specify the X position, the position is set to FILAMENTCHANGE_XPOS, but when I do, X position is increased by the value I have specified.

Am I understanding it wrongly and this is a proper behavior or is it a bug in firmware?

Best regards
Chris.

Posted : 20/04/2017 10:42 pm
JeffJordan
(@jeffjordan)
Member Moderator
Re: Wrongly implemented M600 command

you have to set the M600 command inside your gcode file exactly at the position where you want to change the filament.
for example after you've switched to the layer of a distinct height:
...
G1 E-0.8000 F1800
G1 Z1.600 F1002
; layer 5, Z = 1
; inner perimeter
M204 S1200
G1 X47.743 Y31.948 F4800
G1 Z1.000 F1002
M600 ;change to black
;G1 E0.8000 F1800
G1 X48.625 Y32.830 E0.0467 F2160
G1 X48.625 Y38.820 E0.2242
...

if you just insert the M600 there, the toolhead will move to the right corner (as defined by the values for the filamentchange-positions), at a decent height where you shouldn't get into any problems with your object.

but if you apply any coordinates at the M600 command, the printhead does it's move relative to the actual position (as you can as well determine from your posted code snippet: target[X_AXIS]+= code_value() ).

this behaviour is as intended. if you try to apply absolute positions, it's very likely that you drive your printhead accidentially through a printed object (which will not only cause damage at the printed part). so the "relative" positioning is a little bit safer... but obviously not proof against overriding the axis limits.

so why not simply adding a test that limit's the value to the max possible for the questioned axis ?

dem inscheniör is' nix zu schwör...

Posted : 20/04/2017 11:06 pm
krzysztof.kl
(@krzysztof-kl)
New Member
Topic starter answered:
Re: Wrongly implemented M600 command

What I am trying to do is to have multiple spots during one print where the filament change should be made (for instance (0, 0); (100,0); (200,0)). There is no problem with hitting already printed part because prior to XY movement, the nozzle is lifted on the Z axis. Even when Z lift did not happen, the M600 command can be executed when the nozzle is in the far left corner and therefore it will travel to the near right corner trough all the print bed (which could lead to the same hitting situation).

But nevertheless, if this is working as designed, I will simply add G0/G1 X0 Y0 command prior to the M600 X200 Y200 command (or try to calculate relative distance from the last command with X and Y defined).

Best regards
Chris

Posted : 21/04/2017 5:20 pm
Share: