With this free CNC milling CAM simulator and G code generator you can build one complete operation for a 3-axis vertical machining center: pick the material group, enter the stock size and the work zero (G54), define the feature to machine (face, pocket, slot, hole, thread, contour) with its dimensions, then choose the tool and the depth of cut. The tool calculates speed and feed, generates the toolpath, writes generic ISO/FANUC-style G code with a plain-English explanation on every line, and simulates material removal live in 3D and 2D. You can download the finished program as a TXT file.
What does this CNC milling simulator do?
In traditional CNC programming training the student memorises the code first and only later works out why the toolpath came out that way. Here the order is reversed: you describe the part and the operation, the tool does what a CAM system does behind the scenes, and it shows you the toolpath and the matching CNC milling G codes at the same time. Click a line in the code panel and the tool jumps to that point in the simulation; as the simulation runs, the active block is highlighted. That turns topics such as the difference between G00 and G01, G43 H tool length compensation, the R plane, the G81 and G83 canned cycles and cancelling a cycle with G80 into motion you can watch rather than text you have to trust.
How to use it: six steps
- Material: choose one of the ISO 513 main groups — P steel, M stainless steel, K cast iron, N aluminium, S heat-resistant and titanium alloys, H hardened materials. No grade or brand code is asked for.
- Stock and zero: enter the length, width and thickness of the block, then pick the G54 zero from five positions (bottom-left corner, the other corners, or the centre). Z0 is always the top face of the stock. Change the zero and you can see straight away how the coordinates in the program change.
- Feature: click a label on the part to choose what to machine — flat face and edge, pocket, slot, hole, thread, profile. Each feature lists its operation types and then asks for the dimensions.
- Tool and cuts: pick the tool family that suits the feature (face mill, solid carbide end mill, shoulder/slot mill, carbide drill, indexable insert drill, centre drill, countersink, tap), then enter the diameter and the number of flutes or inserts. The axial depth of cut, stepover, R plane, peck depth and clearance Z are yours to set — the program never assigns them for you.
- Result board: vc and fz (or fn) come from catalogue averages; n and vf are calculated. You can overwrite any value and everything recalculates instantly. Number of Z passes, metal removal rate, maximum chip thickness, cutting power and torque are shown as well.
- Code and simulation: the program is generated and the simulation plays. You get play, pause, stop, single block, step forward and back, a scrub bar and a speed selector. If a rapid move passes through material you get a collision warning. Copy the code or download it as TXT.
Supported milling and drilling operations
| Feature | Operation | Codes generated |
|---|---|---|
| Flat face and edge | Face milling (zigzag / one-way), shoulder milling | G00, G01 |
| Closed rectangular pocket, circular pocket, open pocket | G01, G02, G03 | |
| Slot | Closed slot, open slot, through slot | G01 |
| Hole | Drilling, centre (spot) drilling, countersinking | G81, G82, G83, G80, G98/G99 |
| Thread | Tapping (tap drill size shown automatically) | G84, G80 |
| Profile | Outside contour milling, corner radius, finish pass | G01, G02 |
Every program opens with a safe start block: G21 G17 G90 G40 G49 G80, then G54, tool change T1 M6, spindle S… M3 and tool length compensation G0 G43 H1 Z…. It ends with M9 M5 G49 and M30. This is the common core of ISO 6983 controls — FANUC and Mitsubishi among them — and you are expected to adapt it to your own control.
Where do the speed and feed values come from?
For the ISO material group and tool family you chose, the tool uses an average cutting speed (vc) and feed per tooth (fz) — feed per revolution (fn) for drills, the pitch for taps. These are starting values, not figures computed for one specific insert, grade or coating. Spindle speed and table feed follow the classic formulas:
| Quantity | Formula | Unit |
|---|---|---|
| Spindle speed n | n = (1000 × vc) / (π × D) | rpm |
| Table feed vf (milling) | vf = fz × z × n | mm/min |
| Table feed vf (drilling) | vf = fn × n | mm/min |
| Tapping feed | vf = pitch × n | mm/min |
| Metal removal rate Q | Q = (ap × ae × vf) / 1000 | cm³/min |
| Cutting power Pc | Pc = (ap × ae × vf × kc) / (60 × 10⁶) | kW |
Frequently asked questions
Can I send the generated code straight to my machine?
No — adapt it first. The code uses generic ISO 6983 / FANUC-style syntax. Your control may need different start blocks, a different tool change macro, a different rigid tapping command (M29 on FANUC, G63.1 on Mitsubishi) and different clearance heights. Tool lengths, the work zero and the workholding are set at the machine. Always dry run a new program.
Why are there only six material groups?
The goal is to teach programming logic, not to be a cutting-data catalogue. The six ISO 513 groups (P, M, K, N, S, H) are enough to pick a sensible starting value, and you can overwrite it on the result board to match your own grade.
Can I chain several operations together?
No — the tool is deliberately single-operation. Finish one operation, download the code, then use "Start over" for the next one. That keeps it obvious which inputs produced which program.
What happens if the cutter is wider than the pocket?
You get a warning. The tool also checks for an inside corner radius smaller than the tool radius, a slot narrower than the cutter, a depth greater than the stock thickness, hole coordinates outside the stock, and deep holes that call for G83 instead of G81.
How does it work out the tap drill size?
It uses the standard rule for metric threads, "major diameter − pitch", and shows it on screen — about Ø8.5 mm for M10 × 1.5, for example. For tolerance tables and detail see our tapping techniques and tap drill size calculator.
Note
The speed and feed values in this tool are averages taken per material group; they are not calculated for a specific tool, insert or coating. Recalculate them from your own tool catalogue. Use the CNC turning, milling and drilling speed and feed calculator, the drilling speed and feed calculator for hole making, and check whether your machine actually delivers the required torque with the CNC spindle torque calculator.
Disclaimer
Mentor CNC Milling CAM is a training simulator only. The NC program, tool suggestions, cutting values, power/torque and time estimates it produces are educational starting values; their accuracy, suitability and safety are not guaranteed for any particular machine, control, tool, fixture or workpiece. Before running the program on a real machine it must be reviewed by a qualified instructor or operator and dry run. Mentor CNC cannot be held responsible for machine damage, tool breakage, scrapped parts or injury arising from the use of this tool.