Slicer adding multiple code lines and M420 S1 not working
Hi,
I see that Prusa Slicer has started adding multiple same lines at the start of the Gcode and the custom command of M420 S1 is also not being taken in consideration when the print starts.
Where are those lines getting generated from?
Attaching the Gcode File and also pasting the starting lines below:
; generated by PrusaSlicer 2.9.0 on 2025-02-08 at 00:52:46 UTC ; ; external perimeters extrusion width = 0.48mm; perimeters extrusion width = 0.48mm; infill extrusion width = 0.48mm; solid infill extrusion width = 0.48mm; top infill extrusion width = 0.48mm; first layer extrusion width = 0.48mm ; external perimeters extrusion width = 0.48mm; perimeters extrusion width = 0.48mm; infill extrusion width = 0.48mm; solid infill extrusion width = 0.48mm; top infill extrusion width = 0.48mm; first layer extrusion width = 0.48mm ; external perimeters extrusion width = 0.48mm; perimeters extrusion width = 0.48mm; infill extrusion width = 0.48mm; solid infill extrusion width = 0.48mm; top infill extrusion width = 0.48mm; first layer extrusion width = 0.48mm ; external perimeters extrusion width = 0.48mm; perimeters extrusion width = 0.48mm; infill extrusion width = 0.48mm; solid infill extrusion width = 0.48mm; top infill extrusion width = 0.48mm; first layer extrusion width = 0.48mm M190 S70 ; set bed temperature and wait for it to be reachedM104 S210 ; set temperature;TYPE:CustomG28 ; home all axesG1 Z5 F5000 ; lift nozzleM420 S1;M109 S210 ; set temperature and wait for it to be reachedG21 ; set units to millimetersG90 ; use absolute coordinatesM82 ; use absolute distances for extrusionG92 E0; Filament gcodeM420 S1M107;LAYER_CHANGE;Z:0.25;HEIGHT:0.25G1 E-12 F2400G1 Z.25 F7800G1 X102.255 Y41.27G1 E.00001 F2400;TYPE:Skirt/Brim;WIDTH:0.48G1 F1800G1 X103.046 Y39.602 E.10635G1 X103.704 Y38.507 E.17994G1 X104.449 Y37.469 E.25354G1 X105.765 Y35.983 E.36789G1 X106.706 Y35.119 E.44148G1 X107.713 Y34.334 E.51504G1 X109.273 Y33.347 E.62139
RE: Slicer adding multiple code lines and M420 S1 not working
Gcode is of little use. We would need to see a copy of your saved Prusa Slicer project file that is generating the gcode. File>Save Project as. That will save a .3mf file that will also contain a copy of the 3 profiles you have selected. Its basically a snapshot.
Take the 3mf and then ZIP it up and attach it here. Needs to be zipped or the forum will silently just drop the file. Same way it dropped your gcode file from your original post.
RE: Slicer adding multiple code lines and M420 S1 not working
Hey,
Thank you very much for your reply.
Will share the said file in some time.
-Siddharth
RE: Slicer adding multiple code lines and M420 S1 not working
attaching the 3MF file!
RE: Slicer adding multiple code lines and M420 S1 not working
Hate to say it but no file attached. You did zip it ? As the post edit window is only a few minutes long its always best to double check that your post has everything after you click add reply.
RE: Slicer adding multiple code lines and M420 S1 not working
Oh
Let me check again!
RE: Slicer adding multiple code lines and M420 S1 not working
attaching hevo.zip
RE: Slicer adding multiple code lines and M420 S1 not working
You have an M420 S1 in your Printers>Custom Gcode>Start Gcode block.
You ALSO have a M420 S1 in your Filaments>Custom Gcode field. So of course its adding it twice, thats what you are set up to do.
As for the command not being applied, well the command is in there so if its not working then then would be something to check on your printers firmware. Once the gcode is passed to the printer then theres nothing else the slicer can do.
You do have a valid mesh saved on the printer don't you ? As S1 just enables the mesh but you need a valid one saved into eeprom for it to be loaded.
Personally I would also add in explicit temperature commands to the start gcode rather than relying on the Emit Temperature commands automatically tickbox. That way you get them exactly where you want in the start sequence rather than wherever PS feels like placing them.
RE: Slicer adding multiple code lines and M420 S1 not working
hi,
thank you for the reply. working on the firmware to check which type of bed leveling should i use for my 350x350 mm bed.
I was using the #define AUTO_BED_LEVELING_BILINEAR from Marlin but that does to seem to work for the M420 as I did use the G29 and probed the bed and saved it using M500 before starting the print.
also the last para is a bit difficult for me to understand as i am not very fluent with GCode yet but trying to surely learn!