Pause at a Certain Layer
Pause a print at a chosen layer with M226 to insert a component or change filament: add it from the PrusaSlicer layer slider or as a conditional Before layer change G-code, then resume.
Some parts need something placed inside them mid-print: a magnet, a nut, a bearing, a wire, or a different filament from a given layer up. This guide shows how to make the Vision Miner 22IDEX pause at an exact layer so you can do that, and what happens when you resume.
The command the printer needs is M226 (Synchronous Pause). You insert it into the G-code from the slicer using one of the two methods below.
Why M226 and not M25
The RepRapFirmware G-code reference recommends M226 for a pause placed inside the file being printed: it first completes every move already queued, so the pause lands exactly on the layer boundary. M25 is meant for pausing from outside the file (Web Interface console or a macro) and stops as fast as it can, in the middle of the queued moves. Inside a print that can cut a line short, leave part of the layer unfinished and shift the print when it resumes.
Hot surfaces and moving parts
Read the Safety - Before You Begin article before working on your printer. The nozzle, build plate and chamber stay hot while the print is paused. Keep hands clear of the toolheads and do not force the gantry by hand.
Method 1: Layer Slider (single pause)
Quickest when you need one pause in one print.
- Slice the model, then open the Preview tab.
- Drag the vertical layer slider on the right side of the window to the layer where the pause should happen. The pause is executed before that layer is printed, so pick the first layer that would cover the inserted component.
- Click the small + button that appears next to the slider handle.
- Choose Add custom G-code.
- Enter the command and confirm:
M226- Export the G-code. The pause is stored in this G-code file only; it does not change your print profile.
Use the plus button, not the Pause option
PrusaSlicer also offers Add pause print next to the slider. That option inserts the slicer's own pause template (M601 by default), which the 22IDEX firmware does not use. Always enter M226 as custom G-code.
Method 2: Conditional G-code (repeatable pause)
Use this when the same pause should apply every time you slice with this printer profile, or when you prefer typing a layer number to dragging a slider.
- Go to Printer Settings > Custom G-code > Before layer change G-code.
- Add this line, replacing
100with your layer number:
{if layer_num == 100}M226{endif}- Slice and export.
Layer numbers start at 0, so layer_num == 100 is the 101st layer of the print. Check the layer count in the Preview slider to confirm you have the right one.
Remove the line when you are done
The conditional stays in the printer profile. If you leave it in place, every later print that reaches that layer will pause. Delete it or comment it out after the job.
What Happens at the Pause
When the printer reaches the M226 command:
- The print stops and the LEDs turn yellow, indicating the machine is paused.
- The toolhead moves away from the part so you can reach it.
- Insert the component, change filament, or do whatever the pause is for.
- Click Resume in the Web Interface (or on the touchscreen).
- The machine restores its coordinates, heats everything back to the printing temperatures, purges the nozzle and continues with the next layer.
Check temperatures before you resume
If you changed filament or adjusted anything during the pause, make sure the nozzle and bed temperatures are set correctly for the material before clicking Resume. The printer resumes with whatever temperatures are currently active.
Tips
- Keep the pause short. The part sits at chamber temperature while paused. Long pauses on high-temperature materials can weaken the bond between the layers before and after the pause. See Minimal Layer Time Settings for why.
- Leave clearance for the insert. Model the pocket slightly larger than the component and make sure the component sits below the top of the last printed layer. Anything that sticks up will be hit by the nozzle after the resume.
- Secure loose inserts. Magnets and nuts can be pulled out by the nozzle or by the purge move. A small drop of glue holds them in place.
- Multiple pauses. Method 1 can be repeated at as many layers as you need in one G-code file. In Method 2, chain conditions:
{if layer_num == 50 or layer_num == 120}M226{endif}.
Support
If you could not find an answer here, reach out to our support team.