Chapter IX

Program, Set Up, and Operate CNC and EDM Equipment

Red Seal Practice study guide with diagrams.

Programming, Setting Up, and Operating CNC and EDM Equipment

Introduction to Numerical Control and Electrical Discharge Machining

The modern Tool and Die Maker must master two families of computer-controlled machines: CNC (Computer Numerical Control) machining centers and EDM (Electrical Discharge Machining) machines. These machines make it possible to achieve tolerances on the order of ±0.005 mm and surface finishes of 0.2 µm Ra, which are impossible to obtain with conventional machining.

The reference standard for machine tools in Canada is CSA B149.1 (Canadian Electrical Code, Part I) for electrical aspects, and ISO 6983 (G and M codes) for programming. The Red Seal exam requires a thorough understanding of operating principles, cutting parameters, fixed cycles, and setup procedures.

Fundamental Principles of CNC Machines

Coordinate Systems and Axes

A CNC machine uses a Cartesian coordinate system. The main axes are:

X: horizontal axis (generally longitudinal)
Y: horizontal axis (transversal)
Z: vertical axis (spindle)
A, B, C: rotary axes around X, Y, Z respectively

The machine reference point (home position) is the absolute origin point of the machine, generally detected by limit switches or encoders. The work zero point is defined by the operator using a probe, dial indicator, or a preset tooling system.

Essential rule: the work offset (G54 to G59) must be verified before every operation. An error of 0.01 mm on the offset can result in scrapping a precision part.

Types of CNC Machines in Tool and Die Making

Machine TypeAxesTypical ApplicationsTypical Accuracy
Vertical Machining Center (VMC)3 to 5 axesDies, punches, plates±0.005 mm
Horizontal Machining Center (HMC)4 to 5 axesComplex molds, prismatic parts±0.008 mm
CNC Lathe2 to 3 axesEjectors, cylindrical cores±0.005 mm
CNC Grinding Machine3 axesCutting surfaces, ground punches±0.002 mm
Wire EDM Machine4 to 5 axesPrecision cutting, complex shapes±0.003 mm
Sinker EDM Machine3 axesMold cavities, internal shapes±0.005 mm

CNC Programming: G and M Codes

Program Structure

A CNC program follows the ISO 6983 standard (formerly RS-274D). Each block (line) contains addresses followed by numerical values. The typical structure:

O0001 (PROGRAM NUMBER 1)

N10 G90 G21 G17 G40 G49 G80

N20 G54

N30 M06 T01 (TOOL CHANGE)

N40 S1200 M03

N50 G43 H01 Z50.0

N60 G00 X0 Y0

N70 G01 Z-5.0 F100

...

N100 M30

Essential G Codes for the Tool and Die Maker

CodeFunctionDetails and Pitfalls
G00Rapid positioningDo not cut in G00; non-linear path
G01Linear interpolationFeed rate F in mm/min
G02/G03Circular interpolation (CW/CCW)Requires I, J, K or R; check direction
G17/G18/G19XY/XZ/YZ planeG17 is the default; change for helical machining
G20/G21Inches/millimeters**Frequent error**: forgetting G21 at the start of a program
G28Return to reference pointAlways retract the tool before G28
G40/G41/G42Cutter radius compensationG41 = left, G42 = right; check cutting direction
G43/G44Tool length compensationG43 = positive, G44 = negative; use H
G54-G59Work coordinate offsetsVerify the correct offset is active
G73/G83Drilling cycle (chip breaking/peck)G83 with Q = depth per pass
G76Rigid tapping cycleRequires a compression tap holder
G80Cancel fixed cycleAlways cancel before a new positioning
G90/G91Absolute/incremental positioningG90 is the default; G91 for repetitions
G94/G95Feed in mm/min or mm/revG95 for threading

Essential M Codes

CodeFunctionRemarks
M00Program stopManual restart required
M01Optional stopActive if the switch is engaged
M02End of programDoes not rewind
M03/M04Spindle clockwise/counterclockwiseM04 for left-hand tools
M05Spindle stop
M06Tool changeWait for complete spindle stop
M08/M09Coolant ON/OFFCheck pressure before machining
M30End of program with rewindReturn to the beginning of the program
M98/M99Subprogram call/returnUse for repetitions

Cutting Calculations for CNC

The cutting speed (Vc) in m/min is calculated:

Vc = (π × D × N) / 1000

Where:

D = tool or workpiece diameter (mm)
N = rotational speed (rpm)

To find the rotational speed:

N = (Vc × 1000) / (π × D)

Example: 10 mm end mill in tool steel (Vc = 25 m/min):

N = (25 × 1000) / (π × 10) = 25000 / 31.42 = 796 rpm

The feed rate (F) in mm/min:

F = N × fz × Z

Where:

fz = feed per tooth (mm/tooth)
Z = number of teeth

Example: 2-flute end mill, fz = 0.05 mm/tooth, N = 796 rpm:

F = 796 × 0.05 × 2 = 79.6 mm/min

Cutter Radius Compensation

Radius compensation (G41/G42) is mandatory for machining precise contours. The compensation radius D is entered in the offset table. The programmed path is that of the theoretical profile; the machine offsets the tool by radius D perpendicular to the path.

Compensation rules:

53.Activate compensation on a straight line before the contour (approach move)
54.Deactivate on a straight line after the contour (exit move)
55.The compensation radius must be smaller than the minimum radius of curvature of the profile
56.Verify that the compensation direction matches the cutting direction (right-hand cutter = G42)

Classic pitfall: if the compensation radius is too large for the profile's radius of curvature, the machine generates an alarm (compensation interference). The solution is to reduce the D radius or modify the program.

Electrical Discharge Machining (EDM)

Physical Principles

EDM uses controlled electrical discharges to remove material. The principle relies on:

61.Dielectric: insulating fluid (oil or deionized water) that fills the gap between the electrode and the workpiece
62.Discharge: a voltage of 80 to 300 V is applied; the dielectric ionizes, creating a plasma channel
63.Erosion: the local temperature reaches 8000 to 12000 °C, vaporizing a micro-particle of material
64.Flush: the dielectric evacuates the eroded particles

The discharge frequency varies from 1 kHz to 500 kHz depending on the desired finish. The capacitance (capacitor) controls the energy of each discharge.

Critical EDM Parameters

ParameterSymbolEffect on Machining
Intensity (current)I (A)Material removal rate and roughness
Pulse durationTon (µs)Crater depth
Pulse pauseToff (µs)Particle evacuation
VoltageU (V)Spark gap distance
Frequencyf (Hz)Surface finish
CapacitanceC (µF)Energy per discharge

Fundamental relationship: surface roughness (Ra) is proportional to discharge energy:

Ra ≈ K × (I × Ton)^(1/3)

Where K is a constant depending on the material.

Types of EDM

Sinker EDM

The electrode (generally graphite or copper) is machined to the negative shape of the cavity. The electrode descends vertically into the workpiece.

Applications:

Injection mold cavities
Stamping dies
Complex internal shapes
Sharp internal corners (impossible with milling)

Electrodes:

Graphite: fast machining, good conductivity, but fragile
Copper: better finish, more resistant, but slower machining
Copper-tungsten: for fine details, very wear-resistant

Electrode wear: typical volumetric wear is 0.1 to 1% of the removed volume. For finishing operations, wear can reach 5 to 10%.

Wire EDM

A brass or copper wire (diameter 0.1 to 0.3 mm) passes through the workpiece. The wire is continuously unrolled and serves as the electrode.

Applications:

Cutting hardened steel plates
Complex profiles in dies
Precision parts with tolerances of ±0.003 mm
Draft angles (with tilting axes)

Wire-specific parameters:

Wire tension (0.5 to 2 kg)
Wire feed speed (1 to 10 m/min)
Dielectric pressure (deionized water)
Water conductivity (10 to 20 µS/cm)

Calculations for EDM

The machining time in sinker EDM:

T = V / (MRR)

Where:

V = volume of material to remove (mm³)
MRR = material removal rate (mm³/min)

The material removal rate depends on the intensity:

MRR ≈ K × I

Where K ≈ 0.5 to 2 mm³/min/A depending on the material and configuration.

Example: Cavity of 20 × 15 × 10 mm in hardened steel (K = 1.0 mm³/min/A) with I = 10 A:

V = 20 × 15 × 10 = 3000 mm³

MRR = 1.0 × 10 = 10 mm³/min

T = 3000 / 10 = 300 min = 5 hours

Pitfall: this calculation ignores finishing time (which is slower) and flushing time. The actual time is generally 1.5 to 2 times greater.

Setup and Operating Procedures

Machine Preparation

112.Machine inspection: oil levels, hydraulic pressure, guide condition
113.Workpiece mounting: vise, chuck, clamps, or modular fixturing system
114.Workpiece alignment: use a dial indicator or electronic probe
115.Work zero setup: define G54 from the reference surfaces
116.Tool mounting: verify clamping, length, radius
117.Dry run: execute the program in dry run mode with the tool retracted

Work Offset Setup

The accuracy of the work offset determines the accuracy of the part. Methods:

MethodAccuracyTimeRisk
Dial indicator±0.01 mm5-10 minLow
Electronic probe±0.002 mm2-3 minLow
Manual contact (paper)±0.05 mm1 minHigh
Laser preset system±0.001 mm30 sLow

Recommended procedure:

122.Secure the probe in the spindle
123.Position the probe near the surface to be measured
124.Approach slowly (probing speed: 50-100 mm/min)
125.Record the position in the G54 offset
126.Repeat for the other axes
127.Verify by measuring a known dimension

Program Verification

Before starting production, the operator must:

130.Graphical simulation: verify the tool paths on the screen
131.Dry run: execute with the tool retracted (Z = 50 mm above)
132.First part: machine with reduced finishing passes
133.Measurement: check critical dimensions with a micrometer or CMM
134.Adjustment: modify compensation offsets if necessary

Safety and Standards

CNC Safety

Machine guards: never remove them during operation
Emergency stop: know the location and operation
Lockout: follow the lockout/tagout procedure in accordance with CSA Z460 (Lockout)
Personal protective equipment: safety glasses, safety shoes, hearing protection

EDM Safety

Electrical hazard: EDM machines operate at high voltage (up to 300 V)
Fire hazard: oil-based dielectric is flammable; respect safety distances
Fumes: EDM produces toxic fumes; use adequate ventilation
Drowning hazard: never immerse your hands in the dielectric tank during operation

Applicable Canadian Standards

StandardApplication
**CSA B149.1**Canadian Electrical Code, Part I – electrical installations
**CSA Z460**Lockout and control of hazardous energies
**CSA Z432**Safeguarding of machinery
**ISO 6983**CNC programming (G and M codes)
**ISO 230**Machine tool accuracy testing

Troubleshooting and Problem Solving

Common CNC Problems

SymptomProbable CauseSolution
Rough surfaceCutting speed too highReduce N or increase F
Abnormal noiseFeed rate too highReduce F or increase N
Dimension out of toleranceIncorrect work offsetCheck G54 and compensations
Rapid tool wearSpeed too high or insufficient coolantReduce Vc, check M08
Overload alarmsExcessive depth of cutReduce depth or number of passes
Incorrect tool pathIncorrect radius compensationCheck G41/G42 and D

Common EDM Problems

SymptomProbable CauseSolution
Melted electrodeIntensity too high or insufficient flushReduce I, increase Toff
Burned surfaceDirty dielectricChange the filter, purge the tank
Slow machining speedIncorrect water conductivityAdjust conductivity (10-20 µS/cm)
Broken wire (wire EDM)Wire tension too high or speed too slowReduce tension, increase speed
Workpiece deformationInternal stressesMachine in successive passes, plan supports

Parameter Optimization

CNC Machining Strategies

For machining hardened tool steel (45-60 HRC):

OperationVc (m/min)fz (mm/tooth)Depth (mm)Coolant
Roughing (carbide end mill)60-800.05-0.100.5-1.0Abundant
Semi-finishing80-1000.03-0.050.2-0.5Abundant
Finishing100-1200.01-0.030.05-0.2Abundant
Super-finishing120-1500.005-0.010.01-0.05Abundant

Golden rule: for finishing operations, the depth of cut must be at least equal to the tool radius to avoid rubbing.

EDM Strategies

OperationIntensity (A)Ton (µs)Toff (µs)Resulting Ra (µm)
Roughing20-50100-30030-10010-20
Semi-finishing5-1520-5010-303-8
Finishing1-55-205-151-3
Super-finishing0.1-11-52-100.2-1

Principle: always start with roughing at high intensity, then progressively reduce for finishing. Each finishing pass removes approximately 0.1 to 0.2 mm of material.

Exam Tips and Answer Strategies

Typical Red Seal Questions

163.Cutting speed calculation: know how to use the formula Vc = (π × D × N) / 1000
164.Parameter selection: know how to select parameters suited to the material and operation
165.Code identification: recognize G and M codes and their functions
166.Safety: know CSA standards and lockout procedures
167.Troubleshooting: identify the causes of surface and dimensional defects

Problem-Solving Method

For calculation questions, follow this method:

170.Identify the data: note all given values
171.Choose the formula: determine which formula applies
172.Check the units: convert everything to mm and minutes
173.Calculate step by step: do not skip steps
174.Verify the result: is it plausible? (a speed of 10000 rpm for a 10 mm end mill is unlikely)

Frequent Exam Pitfalls

Confusing G02 and G03: G02 = clockwise, G03 = counterclockwise (viewed from the positive axis)
Forgetting unit conversion: formulas use mm, not meters
Confusing feed per tooth and feed per revolution: F = N × fz × Z (not F = N × fz)
Ignoring the number of teeth: a 4-flute end mill advances 2 times faster than a 2-flute end mill
Confusing G54 and G28: G54 = work offset, G28 = machine return

Summary

CNC: master G and M codes, speed and feed calculations, radius compensation, and work offset procedures
EDM: understand electrical discharge principles, parameters (I, Ton, Toff), and the differences between sinker and wire
Calculations: Vc = (π × D × N) / 1000, F = N × fz × Z, MRR ≈ K × I
Safety: comply with CSA B149.1, CSA Z460 (lockout), and CSA Z432 (machine safeguarding)
Accuracy: typical tolerances are ±0.005 mm for CNC and ±0.003 mm for EDM
Troubleshooting: know how to identify and correct common surface, dimensional, and operational problems

Pitfalls to Avoid

189.Not checking the work offset before machining – this is the #1 cause of out-of-tolerance parts
190.Forgetting G21 (millimeters) at the start of a program – a part programmed in inches but machined in mm is destroyed
191.Using G00 for cutting – rapid positioning is not linear and can break the tool
192.Neglecting radius compensation for precise contours – without G41/G42, the profile is offset by the tool radius
193.Choosing an EDM intensity that is too high for finishing – roughness increases with discharge energy
194.Ignoring electrode wear in EDM – volumetric wear can reach 10% in finishing
195.Not checking water conductivity in wire EDM – incorrect conductivity affects speed and quality
196.Forgetting to cancel fixed cycles (G80) – an uncancelled fixed cycle can drill an unwanted hole
197.Confusing cutting speed (Vc) and rotational speed (N) – Vc is in m/min, N is in rpm
198.Not performing a dry run before the first part – an incorrect program can damage the machine or the part
199.Using insufficient coolant for hardened steel machining – excessive heat destroys carbide
200.Not following lockout procedures – a machine under maintenance can start during intervention

Ready to test this chapter?

Practice with exam-aligned questions and timed simulations.

Start Practicing Free