How to Wire a CNC Machine
A practical guide for maintenance engineers, electricians and shop owners bringing a new or relocated CNC into service. It covers incoming power, protective earth, bonding, the control cabinet, spindle and VFD wiring, and the checks to run before the first cut. Read it and you can judge whether your site and your crew are ready, or whether you need a licensed electrician and a machine builder on site.

In this article
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Key takeaways
Match the machine nameplate to your site supply
Wiring starts long before a cable is uncoiled. Read the machine nameplate and the electrical drawing from the builder: rated voltage, number of phases, frequency, full-load current, recommended breaker and the short-circuit current the cabinet can withstand. Compare those numbers with the supply you actually have at the wall. A machine built for 400 V / 50 Hz will not behave on 480 V / 60 Hz without a transformer or a drive parameter change.
Then measure. A clamp meter and a phase rotation meter tell you more than the utility bill. Record the supply voltage at the disconnect with the shop running, not at 6 a.m. when the shop is empty. Note voltage imbalance between phases. A 2% imbalance is usually tolerable for the machine but hard on a spindle drive. If your imbalance is worse, call the utility before you call the machine builder.
Size the feeder from the nameplate current, not from the breaker that happens to be in the panel. Cable ampacity tables depend on installation method, ambient temperature and how many conductors share a duct. A feeder that runs at 70–80% of its ampacity at 30 °C ambient is a reasonable target for a machine that runs two shifts.
Decide now where the disconnect, the transformer and the machine sit relative to each other. Long runs of motor cable create voltage spikes at the motor terminals from VFD switching. The manufacturer's maximum cable length in the manual is not a suggestion; exceeding it usually means adding an output reactor or a dv/dt filter.
- 1Nameplate vs. supplyVoltage, phase, frequency and current must line up before the feed is ordered.
- 2Measure under loadRecord voltage and imbalance with the shop running, not idle.
- 3Feeder sizingSize from nameplate current and installation conditions, not habit.
Bringing power to the cabinet
The incoming feed lands at a main disconnect or an isolation transformer. Many shops add a line reactor or an isolation transformer ahead of the machine. Both protect sensitive electronics from line spikes and harmonics from other equipment, but they are not a substitute for a correct earth. A transformer with a floating secondary is a common mistake; the secondary must be bonded to the same protective earth as the machine frame.
Terminate the feed with the correct torque on the lugs. Loose lugs heat up, and heat changes resistance, which changes current sharing between phases. Follow the torque value printed on the lug or in the cabinet drawing. Use ferrules on fine-stranded cable. Do not shorten a shielded cable's drain wire to save time; it is part of the circuit.
Inside the cabinet, split the loads. Drives, servo amplifiers and the spindle inverter are noisy. The controller, I/O power supply, encoders and communication boards are quiet. Give each group its own breaker or fuse block and its own terminal rows. When a fault appears later, this separation is what lets you isolate it in minutes instead of hours.
Label every conductor at both ends with the wire number from the drawing. The next person in the cabinet may be you at 2 a.m. during a production run. Numbered wire and a printed drawing turn a two-hour fault hunt into a ten-minute one.
- 1Transformer secondaryBond it to protective earth; never leave it floating.
- 2Torque lugsUse the value on the lug or drawing, and recheck after the first heat cycle.
- 3Split the loadsNoisy drives and clean control power get separate protection.
Protective earth and bonding
Protective earth is not a noise fix; it is a life-safety circuit. Its job is to carry fault current long enough to trip the breaker. That means low impedance, not just continuity. A long thin green wire back to a distant panel may measure a few ohms with a multimeter, but it will not clear a fault fast enough. Keep the earth conductor at least the cross-section the drawing calls for, and keep the run short.
Bond the machine frame, the cabinet enclosure, the door, the transformer core and the motor housings to a single earth point. Use star washers on painted panels so the bond bites through the coating. If the cabinet has a painted door with a keypad and a display, a braided bonding strap from door to body is standard practice. A door hinge is not a reliable conductor.
Shielded cable is bonded, not just connected. Clamp the shield to the cabinet backplate with a 360° clamp at the entry point. Pigtail connections, where the shield is twisted into a wire and landed on a terminal, destroy the high-frequency path you paid for. The shield should be bonded at both ends for motor cables and at one end for analog signals, unless the drive manual says otherwise.
Watch out for ground loops. Two earth paths at different potentials push current through the shield, and that current shows up as noise on encoder feedback. If you see a ground loop, fix the bonding first. Isolating one end of a shield is the last resort, not the first.
- 1Single earth pointOne reference for cabinet, frame, transformer and motors.
- 2360° clampsBond shields at the cabinet entry, not with a pigtail.
- 3Painted surfacesStar washers or masked pads, or the bond is cosmetic.
Control cabinet and low-voltage wiring
Low-voltage wiring decides how the machine moves. The controller talks to servo drives over a fieldbus or a pulse train, reads limit switches and tool setters, and drives relays and solenoids. Each of those signals has a wiring rule. Encoder and analog cables are shielded, twisted pairs. Relay and solenoid wiring is not shielded, and it should not share a duct with encoder cable.
Separate 24 V DC control power from 110–230 V AC control circuits. If you must run both in one cabinet, keep a clear physical gap and cross at right angles where they meet. Use interface relays for AC loads so the controller only sees low-voltage DC. This is cheaper than replacing an I/O board after a spike.
Follow the terminal numbering in the drawing and keep spare conductors labeled and capped. Spare shielded pairs should be bonded at one end only. Before the first power-up, check for stray strands between terminals. A single strand of wire bridging 24 V and common will keep the machine from enabling, and it takes ten minutes to find with a continuity tester but hours to find by swapping boards.
If the machine uses a tool changer, a pallet system or a bar feeder, the peripheral wiring is where most faults live. Test each peripheral manually from the pendant before you run a program. Confirm every sensor reads the state you expect at both ends of travel.
- 1Signal classesEncoder and analog in shielded twisted pairs; relay and solenoid wiring unshielded.
- 2Voltage separation24 V DC control power gets its own space and its own duct.
- 3Peripheral testExercise each sensor from the pendant before running a program.
Spindle, VFD and motor connections
The spindle drive is the noisiest device in the cabinet, so treat its output cable as part of the drive. Use shielded motor cable, land the shield with a 360° clamp at the drive and at the motor, and keep the run as short as practical. If the run exceeds the length in the drive manual, add an output reactor. That is cheaper than replacing a spindle after a year of voltage spikes.
Set the drive parameters to match the motor nameplate: rated voltage, rated current, base frequency, maximum frequency, pole count and overload class. A drive left at factory defaults may run the motor, but it will not protect it. For a spindle that sees rapid acceleration, the current limit and acceleration ramp determine whether the drive trips or the motor overheats.
Verify rotation before the first cut. On a vertical mill, run the spindle in jog at low speed and confirm direction against the arrow on the housing. On a lathe with a chuck, do this with the chuck removed or the jaws retracted and the door closed. A spindle that starts backward can throw a workpiece or damage a tool holder.
If the machine has a spindle chiller, a through-spindle coolant unit or an air purge, wire those to the correct control outputs and confirm the interlock logic. The spindle should not start if the chiller is not running. Test that logic by hand before you trust it.
- 1Cable lengthExceeding the manual's limit means adding an output reactor or dv/dt filter.
- 2ParametersSet from the motor nameplate, not from memory.
- 3Rotation checkJog at low speed with the work area clear before any program run.
Checks before the first cut
Before any program runs, walk the machine through a manual sequence. Home each axis at reduced rapid speed. Confirm every limit and reference switch triggers where the drawing says it should. Check that the e-stop chain drops power to the drives and that the machine cannot be reset until the button is released and the fault is cleared in the controller.
Check the cooling and lubrication circuits. A spindle that runs without coolant flow for two minutes may survive; one that runs without lubrication for two minutes may not. Confirm the pump runs, the pressure switch reads correctly and the flow alarm reaches the controller.
Then run a warm-up program: spindle at low speed, axes moving through their full travel at reduced feed, for 15–30 minutes. Watch the drive current display and listen. New noises, a hot motor housing or a drive that trips on acceleration all point back to wiring and parameter choices. Fix them now, while the machine is still on the install checklist.
Record what you measured. Supply voltage, earth continuity, insulation resistance, drive parameters and rotation direction. That record turns the next troubleshooting call into a comparison instead of a guess.
- 1Manual sequenceHome axes, test limits, test e-stop chain before any program.
- 2Cooling and lubeConfirm flow, pressure and alarm signals reach the controller.
- 3Warm-up run15–30 minutes at reduced feed, watching current and listening.
How to wire a CNC machine step by step
- 1Lock out and verify the feedOpen the upstream breaker, apply your lock and tag, then test the terminals with a rated meter. Confirm zero volts phase-to-phase and phase-to-earth at the machine disconnect. Never trust an indicator lamp alone.
- 2Set the earth and bond the frameLand the protective earth conductor at the cabinet earth bar with the torque in the drawing. Bond cabinet, door, transformer core and motor housings with star washers. Measure earth continuity from the farthest frame point back to the bar; keep it below 0.1 Ω on a 25 A test current.
- 3Run and terminate the feederPull the feeder in its own duct. Strip enough jacket to reach the lugs without crossing over the electronics. Torque the lugs to the printed value, then tug each conductor to confirm it is seated. Label both ends with the drawing wire numbers.
- 4Wire the noisy power groupFeed the spindle inverter, servo drives and transformer from their dedicated breakers. Keep motor cables short and route them away from signal ducts. Use shielded VFD cable and clamp the shield with a 360° clamp at the cabinet entry and at the motor.
- 5Wire the clean control groupFeed the controller, I/O supply and sensors from the control breaker. Encoder and analog cables go in a separate duct, shielded, with the shield bonded at the controller end. Keep 24 V DC and AC control circuits physically apart.
- 6Connect peripherals and interlocksWire the door interlock, e-stop chain, air pressure switch, lubrication level sensor and any chip conveyor or bar feeder. Check each interlock by hand: the machine must refuse to start when the circuit is open. Beep out every safety circuit before power-up.
- 7Check insulation and rotationWith the disconnect open, measure insulation resistance phase-to-earth. Restore power, then bump the spindle or jog an axis to confirm rotation direction. If a three-phase motor turns backward, swap two phases at the motor terminals, not at the breaker.
- 8Power up and verify parametersEnergize the control group first, then the drives. Check that the controller sees every drive, every limit and every sensor. Compare drive parameters against the builder's list before you command motion. Only then run a warm-up program at reduced feed.
Cable and routing quick reference
Use this table to check routing and shielding decisions before you pull cable.
| Circuit | Cable type | Shield bonding | Routing |
|---|---|---|---|
| Incoming feeder | Copper, sized to nameplate current | Not shielded | Own duct or tray, short run |
| Spindle motor | Shielded VFD cable | 360° clamp both ends | Separate duct from signal |
| Servo motor power | Shielded, twisted pairs | 360° clamp both ends | Separate duct from encoder |
| Encoder feedback | Shielded twisted pair | Bond at controller end | Own duct, never with motor cable |
| Analog sensor | Shielded twisted pair | Bond at controller end | Keep 100 mm from power cable |
| 24 V DC control | Fine stranded, ferruled | Not shielded | Clean control duct |
| Relay and solenoid | Fine stranded, ferruled | Not shielded | Separate from encoder and analog |
| Safety circuit | Per drawing, often dual channel | Per drawing | Protected route, no shared returns |
Wire it once, to the drawing
Most CNC wiring faults come from three shortcuts: a pigtail shield, a shared duct for motor and encoder cable, and a feeder sized by habit instead of nameplate current. Fix those three and the machine will run clean. Skip them and you will spend the first month chasing faults that look like software problems but are not.
Frequently asked questions
Can I wire a CNC machine myself?
If you are a qualified electrician or a maintenance engineer with three-phase experience and the machine builder's drawings, yes. You need the electrical schematic, the parameter list and the PLC logic before you start.
If any of those are missing, or if the site supply does not match the nameplate, stop and get the builder involved. Wiring errors on a spindle drive can destroy hardware that costs more than the labor you saved.
What cable should I use for a VFD to spindle motor run?
Use shielded motor cable rated for the drive output voltage and the ambient temperature. The shield must be bonded with a 360° clamp at both the drive and the motor.
Standard building wire with a separate earth conductor will run the motor, but it radiates switching noise into nearby signal cables. That noise shows up later as encoder faults and random stops.
Should the cable shield be grounded at both ends?
For motor and drive output cables, yes. Bond at both ends with 360° clamps. The shield carries high-frequency current back to its source, and a single-ended connection leaves a path for that current to travel through the machine frame and signal cables.
For analog sensor and some communication cables, bond at one end only, usually the controller end, unless the drive or controller manual says otherwise. Follow the manual over general rules.
Why does my machine trip the breaker when the spindle accelerates?
Check the drive current limit and acceleration ramp first. A ramp that is too short demands more current than the breaker or the drive can supply.
Then check the feeder and lug torque. A loose lug or an undersized feeder causes voltage sag on acceleration, and the drive draws more current to compensate. If the supply is fine, look at the drive overload class and the motor nameplate settings.
How do I check earth continuity properly?
Use a dedicated continuity tester that injects at least 200 mA, or a low-resistance ohmmeter. A standard multimeter on the ohms range uses too little current to reveal a poor bond.
Measure from the farthest point on the machine frame back to the cabinet earth bar. Compare the reading with the value in the drawing. Recheck after the first week of operation, because vibration can loosen a bond that looked fine at install.
Does the machine need a separate earth electrode?
Usually no. A separate electrode creates a second earth path at a different potential, which is exactly how ground loops start.
Bond the machine to the building protective earth as the drawing requires. If your site has a specific earthing standard, follow it, and have the machine builder confirm the bonding arrangement before you energize.
Need machined parts for the machine you just wired?
Send us your drawings and we will return a quotation and a free DFM analysis within 12 hours. No minimum order quantity, from one prototype to 10,000+ part runs.
12-hour quote100% inspectionNDA on request