0
$\begingroup$

Can someone show me how to add Lines to Marlin 1.1.8 ? I want to change the M400 command. In a kind like that:

M400 () { move Z + 5 if not Z MAX; Home X; printbed on MAX LENGHT}.

This coud be ported to pause and abort.

$\endgroup$
  • $\begingroup$ That should be doable, but what you want is not possible if the printer hasn't been homed yet. The printer should be homed first, else Z is unknown. Note that it not smart to let known commands do something different than default. I think in version 1.1.8, the printer will not go over the limits, so no need to check for Z max. Programmatically, you need to send (G28), G91, G1 Z5 F1000, G90, G1 X0 Ymax where Ymax needs to receive the max set in the firmware first. $\endgroup$ – 0scar Oct 30 at 9:30
  • $\begingroup$ M400 is the final command print finished so all axes are homed long before. But i dont know how to add lines of code to this function. I tried but nothing worked :( $\endgroup$ – maf Oct 30 at 10:54
  • 1
    $\begingroup$ Not necessarily, motors can be disabled, there is no guarantee the printer is homed. Maybe in your case yes, but if you override a command, you should make it generic. Maybe you could add to the question why you want to do this, this seems exactly something for an end G-code script? $\endgroup$ – 0scar Oct 30 at 11:29
  • $\begingroup$ The End Gcode is befor M400 method of marlin so FW will execude commands after the End Gcode from slicer so i need help to add lines of code to the method of m400 in marlin firmeware $\endgroup$ – maf Oct 30 at 12:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.