You’ve sliced the model, the layer preview looks tidy, and you’re one click from committing six hours of machine time and a spool of filament. This is exactly the moment a pre-flight g-code check tool earns its keep. A quick simulation and sanity check of your finished G-code catches the silent mistakes — wrong bed temperature, a Z offset that drifted, broken toolpaths after a manual edit — before they turn into a fused mess on the bed or a nozzle ploughing into the plate.
The principle is borrowed straight from CNC machining. The basic purpose of a G-code simulator is to give you a way to see how the machine will move before it moves for real. On a machine that interacts with the physical world — a 3D printer, a CNC mill, a robot arm — any programming mistake can damage the part, the machine itself, or worse. The only alternative to checking first is debugging on the hardware, and by then it’s too late.
This is exactly why we built the check into the slicer itself. Our free ATN Slicer for Windows is a fork of OrcaSlicer with the pre-flight engine built in — bad settings, unsupported mid-air geometry and over-melt on short layers get flagged the moment you slice, right beside the G-code preview, before you waste filament.
What a pre-flight G-code check tool actually does
A G-code viewer or simulator lets you visualise and verify a print before starting it. Load the file and it parses the toolpaths, animates the movements layer by layer, and pulls out the numbers that matter. A good tool automatically detects layer height, nozzle temperature, bed temperature and print speed straight from the file, so you can confirm your settings are what you intended — not what you assumed.
You also get the practical stats: estimated print time, total filament length and weight, number of layers, and overall print dimensions, all parsed directly from the G-code commands. Catching a part that’s printing 2 mm too tall, or a filament estimate that says you’re 30 g short on the spool, costs you ten seconds now instead of a failed print later.
Even though almost nobody hand-writes G-code these days — we lean on slicers and CAM — there’s still a huge benefit to checking the program before loading it into the machine. Slicers have bugs. Profiles drift. Start G-code does things you forgot about. A pre-flight check is standard workflow, not paranoia. With the ATN Slicer the check happens automatically as part of slicing, so the workflow becomes a single step instead of two.
The pre-flight checklist: what to verify every time
Here’s the short list worth running before any print that matters. We’ve built a more detailed version into our G-code pre-flight checklist, but the essentials are:
- Temperatures match your filament. PLA wants a bed around 50–60°C and a hotend roughly 190–220°C. PETG wants 70–80°C on the bed and around 220–250°C at the nozzle. These are broad ballpark ranges — always defer to the spec printed on your filament’s box, not a generic chart.
- Z offset and first layer. Confirm your Z offset is set correctly and eyeball the first layer in the preview. This is the single biggest predictor of whether a print sticks.
- Orientation and dimensions. Check the part is the right way up, the overall size is correct, and there are no unexpected gaps or missing supports.
- Travel moves. Most viewers let you show or hide non-printing movements. Toggle them on to spot potential stringing zones, or off to focus on the extrusion paths.
- Extrusion mode. Look for an M82 (absolute) or M83 (relative) near the top of the file. This one’s subtle but high-impact — more on it below.
If you’re chasing first-layer adhesion specifically, our guide to the best first layer settings in PrusaSlicer gives you exact values to slot into the profile before you even reach the pre-flight stage.
The extrusion mode trap
Most slicers default to absolute extrusion, where the extruder value keeps climbing throughout the file. Some printers or profiles switch to relative extrusion with M83. If you’ve inserted any custom extrusion commands — a manual purge, a tweak to a layer — you have to match the current mode. Mixing absolute and relative values causes over- or under-extrusion in the moves that follow, and it’s the kind of fault that won’t show up until the print is already underway.
Where viewers can mislead you
A pre-flight tool is only as good as the data it parses, and G-code doesn’t carry all of it. The PrusaSlicer standalone viewer, for example, works hard to estimate extrusion widths, layer heights, move types and layer counts — but the raw G-code doesn’t contain all of that natively, so the viewer augments it with slicer comments and educated guesses. That’s fine until something goes wrong in the estimation.
A few documented gotchas worth knowing:
- The preview can lie about temperatures. There’s a known PrusaSlicer bug where the viewer mis-reports the first-layer temperature while the actual generated G-code is correct. If a number looks wrong, cross-check the raw text of the file before you go editing anything.
- Start G-code can override your hardware Z offset. Cura users have reported that a purge line in the Start G-code causes the print to begin noticeably higher than expected; remove the Start G-code and the hardware Z offset is honoured again. It’s version-specific and anecdotal, but it explains a lot of mystery first-layer gaps.
- G28 resets Z=0. Almost every printer definition puts a G28 (auto-home) in the start-up G-code, which resets the Z=0 location. If your Z endstop switch isn’t perfectly repeatable, that reset can shift your first-layer height between prints even though nothing on the bed moved.
The takeaway: a visual preview is a sanity check, not a guarantee. When the display and the raw G-code disagree, the raw G-code wins.
Editing G-code safely after a pre-flight check
Sometimes the check reveals something you want to fix by hand. Do it carefully. A single wrong command can drive the nozzle beyond the bed or disable temperature control entirely. The rules that keep you out of trouble:
- Always edit a copy. Keep the original file intact so you can fall back to a known-good version.
- Keep layer markers intact. Removing a layer marker or breaking an extrusion reset is one of the most common ways to corrupt a file.
- Re-preview after every edit. Re-open the file in the viewer and look for broken toolpaths or unusual travel moves. The ATN Slicer displays G-code directly in the preview tab — the same place OrcaSlicer shows it, since ATN is Orca-based — and re-runs the pre-flight check automatically on re-slice. PrusaSlicer or a standalone viewer will do the visual part if you prefer, but you lose the automatic re-check. This is the easiest way to catch your own mistakes before printing.
Beyond a viewer: a tool that tells you what’s wrong
A plain G-code viewer shows you the movements. It won’t tell you that your retraction is too low for PETG, or that your bed temp is going to warp a wide flat part. That’s the gap our G-code checker is built to close: a rule-based Pre-flight tool that parses your file and flags the settings most likely to cause a failure, in plain English, with the exact values to change. The same engine ships inside the ATN Slicer, so on Workshop you get the Diagnose and Ask AI panels right beside the G-code preview — no separate upload step. For a walkthrough of the whole routine, see our G-code Pre-Flight Checker checklist.
It pairs naturally with our other two tools. If a print does fail, the vision-AI Diagnose tool reads a photo of the failure and returns slicer-specific fixes — applied directly in the ATN Slicer, or as downloadable .ini patches for PrusaSlicer and OrcaSlicer — and the open-ended Ask chat handles the “why” questions a rule checker can’t. For more on what AI can and can’t do here, see our look at the best AI tool to analyse failed prints. For the recurring headaches, we’ve got targeted guides too: fixing warping and the PETG stringing fix in OrcaSlicer. The fastest way to put all of this to work is to download the free ATN Slicer for Windows and let it flag the failure the moment you slice.
FAQ
Do I need a pre-flight check if my slicer already shows a preview?
Yes. The slicer preview shows what the slicer intended; a pre-flight check verifies the actual G-code that will run, including start G-code, temperatures and extrusion mode. Slicer bugs and profile drift mean the two don’t always agree — and the G-code is what your printer obeys. The ATN Slicer closes that gap by running the check on the generated G-code automatically, the moment you slice.
What’s the most common thing a pre-flight check catches?
Wrong temperatures for the loaded filament and an off first layer caused by Z offset. Both are quick to spot and the cheapest possible failures to prevent. Mismatched extrusion mode after a manual edit is a close third.
Can a pre-flight tool check G-code I’ve edited by hand?
It can, and you should re-run it after every edit. Re-previewing the file is the easiest way to catch broken toolpaths, stray travel moves or a missing layer marker before the printer acts on them. In the ATN Slicer the check re-runs automatically each time you re-slice.
Is checking the G-code enough to guarantee a good print?
No tool guarantees a perfect print — hardware repeatability, adhesion and filament condition all play a part. A pre-flight check removes the avoidable, predictable failures so the only variables left are physical ones.