There are times when you want your printer to stop printing, let you insert magnets or some other goodies into the print, and then continue printing. This approach gives you a sleek way of embedding various "foreign" objects into your prints. However, the user experience of such activity is often sub-optimal. While you have even muddle through the task with a filament change command, I wanted to make adequate support for such actions.
There is the M601
G-code that PrusaSlicer can insert for you. But that approach does not work with Octoprint, and I don't know why (M600
color change works without any issues). But even when while running from SD card, the M601
experience is suboptimal, as can be seen in the comment section of the Prusa Knowlage Base.
Here is a video of the improved magnet insertion that I envision:
and here is a G-code that approximately does that:
M300 S150 P300; beep
G91 ; relative movements
G1 Z5 ; Z up 5mm
G90 ; back to absolute
G1 X10.000 Y200.000 E0 F3000; park
M1; pause
M105; reheat?
G28 Y; home Y (in case the intervention shifted it)
G1 X10.000 Y10.000 E0 F3000; park for priming
G91 ; relative movements
G1 Z15; Z up 15mm
G90 ; back to absolute
G92 E0; reset extruder
G1 E30 F150; prime
G92 E0; reset extruder
G91 ; relative movements
; M300 S150 P300; beep (does not work as expected)
G1 X2.000 E0 F60; 2s move
G90 ; back to absolute
The first part is simple:
- beep, to get the user's attention
- move the extruder 5mm up;
- park it in the back left corner of the build plate;
- pause the print.
At this point, we have easy access to the printed object. The print has to be resumed from Octoprint, though. It would be nice to resume prints from the printer's menu, but I didn't figure out how to do that yet. After resuming, the following events occur:
- first, we use
M105
to return the printing temperature? I saw this G-code often in other approaches, but honestly, I don't understand it. As for me, the temperature of the hot ent is stable through the whole process, but remove this command at your own risk; - we home the Y-axis (heat bed), as our manipulations with magnets could nudge the bed a little bit;
- we park the extruder in the front left corner and move it up by 10 more millimeters;
- the printer extrudes some filament to ensure that there is no air pocket left after the filament oozing out during the pause;
- there is a short 2 seconds movement along the X-axis to indicate that the extruded filament should be removed. I tried to beep here, but as a result, that beep occurs imediately when resuming the print…
After all these steps, the printing continues.
Of course, many improvements can be made. If you are going to run this close to the top of the printer's build volume, the extruder will crash when rising. It would be good to have beeps upon purging. It would be good to cool down the nozzle during the pause, re-heat it, and prime. But I think that this is already an excellent first step. You can just paste the code into the "Add custom G-Code" action of PrusaSlicer.
But ideally I'd expect that M601
could work like this.