Spindles

VFD Programming for Hobby CNC: The Settings That Actually Matter

You buy a Huanyang VFD. You get a manual that's clearly translated by someone who's never used a CNC. "PD014: Acceleration time." Great. Set to what? Why? The manual doesn't say because the original Chinese doesn't specify for CNC applications—it's designed for industrial motors in factories.

Last updated: March 2026 · 6 min read

Slug: /guides/vfd-programming-hobby-cnc/

Read time: 9 minutes

Why VFD Manuals Are Useless (And How to Actually Configure Yours)

You buy a Huanyang VFD. You get a manual that's clearly translated by someone who's never used a CNC. "PD014: Acceleration time." Great. Set to what? Why? The manual doesn't say because the original Chinese doesn't specify for CNC applications—it's designed for industrial motors in factories.

This guide exists to translate the factory-speak into "what you actually need to set to make a spindle work on your CNC machine."

What a VFD Actually Does

A Variable Frequency Drive converts wall AC (110V or 220V at 60Hz fixed) into variable-frequency AC output. By changing the frequency, you change motor speed. A 2-pole spindle motor running at 60Hz spins at 3600 RPM. At 400Hz? 24,000 RPM.

The VFD also controls voltage proportionally to frequency (V/f curve) to maintain torque across the speed range. This is automatic on most hobby VFDs, but understanding it helps with troubleshooting.

The Critical Parameters: Huanyang VFD Reference

Using the Huanyang VFD as the standard (it's the most common cheap VFD for hobby CNC). Your VFD might use different parameter numbers, but the concepts are identical.

PD001: Control Mode

  • 0 = Panel buttons only (not useful for CNC)
  • 1 = External terminal (relay/switch control)
  • 2 = RS485 (serial communication)
  • Set to: 1 (for GRBL spindle control via relay or PWM-to-voltage converter)

PD002: Run Command Source

  • 0 = Panel only
  • 1 = External terminal (typical)
  • Set to: 1

PD003: Main Frequency Source (This is critical)

  • 0 = Panel potentiometer (not for CNC)
  • 1 = External 0-10V analog input (preferred)
  • 2 = External 4-20mA (rarely used for hobby CNC)
  • Set to: 1 (you'll feed PWM-converted-to-0-10V from GRBL)

PD004: Base Frequency

  • This is NOT 60Hz. Don't set it to 60Hz.
  • For Chinese spindles rated 24,000 RPM: set to 400Hz
  • For 18,000 RPM spindles: set to 300Hz
  • For 12,000 RPM spindles: set to 200Hz
  • This is the nameplate frequency of your motor, not line frequency.
  • Set to: 400Hz (standard for cheap 1.5kW/2.2kW spindles)

PD005: Maximum Operating Frequency

  • The highest output frequency the VFD will produce
  • Should match your base frequency (PD004)
  • Set to: 400Hz (same as PD004)

PD011: Minimum Frequency

  • Lowest frequency before the VFD refuses to start
  • Set too high and you can't run slow
  • Set to: 0.5Hz (allows near-stop crawling, useful for tool changes)

PD014: Acceleration Time

  • How long (in seconds) to ramp from 0 to max frequency
  • Too short = overcurrent fault
  • Too long = slow spindle spinup
  • Set to: 5-10 seconds (depends on motor inertia, start with 8)

PD015: Deceleration Time

  • How long to ramp down from max to 0
  • Too short = overvoltage fault (capacitor overcharge)
  • Too long = spindle coasts for ages
  • Set to: 10-20 seconds (start with 15, increase if you get OU faults)

PD023: Spindle Motor Poles

  • Most small spindles are 2-pole
  • Check your motor nameplate
  • Set to: 2 (99% of hobby spindles)

PD141-145: Motor Rated Parameters

  • Rated voltage, current, power, frequency from motor nameplate
  • Helps VFD calculate V/f curve correctly
  • Often ignored on hobby setups because we're just trying to spin it
  • If your motor overheats, check these
  • Set to: Your motor's nameplate specs

Spindle Control from GRBL: The Wiring Side

GRBL's spindle output is PWM (variable duty cycle, 5V logic level). You need to convert this to 0-10V analog to feed PD003.

Two approaches:

  1. PWM-to-0-10V converter module (~$5-15 from AliExpress or Amazon)
  • Converts GRBL's PWM output to clean analog 0-10V
  • Feed this into the VFD's analog input (usually terminals marked Vin/GND)
  • Simplest approach, most reliable
  1. DIY RC filter (if you're patient)
  • PWM through a 10kΩ resistor + 10µF capacitor to ground
  • Creates analog voltage proportional to PWM duty
  • Works, but sensitive to noise

GRBL Spindle Settings:

```

$30 = Spindle PWM Frequency (Hz) — typically 10,000 Hz

$31 = Spindle Off Value (0-255, PWM steps) — set to 0

$32 = Spindle Min Value (PWM 0-255) — set to 0

$33 = Spindle Max Value (PWM 0-255) — set to 255

```

M-codes control spindle:

  • M3 Snnnn: Spindle on, CCW, speed nnnn (0-24000 for 24k spindle)
  • M4 Snnnn: Spindle on, CW
  • M5: Spindle off

Example: G0 X0 Y0; M3 S12000; G1 X10 F500; — move to origin, start spindle at 50% speed (12k RPM), then cut.

Common Fault Codes Decoded

OC (Overcurrent):

  • Accel time too short
  • Load too heavy on spindle
  • Solution: Increase PD014 (accel time) to 10-15 seconds, or reduce max frequency (PD005)

OU (Overvoltage):

  • Decel time too short; motor can't absorb energy fast enough
  • Solution: Increase PD015 (decel time) to 15-20 seconds

OL (Overload):

  • Motor temperature or current too high
  • Solution: Reduce cutting load, check cooling fan, verify motor specs match spindle specs

OH (Overheat):

  • VFD internal temperature too high
  • Solution: Improve ventilation, reduce load, or add heatsink

Er (Communication Error):

  • RS485 wiring issue (if you're using serial mode, which you shouldn't for basic CNC)
  • Solution: Stick to analog control (PD003=1)

110V vs 220V Setup Notes

Most cheap Chinese VFDs are "110V single phase in, 3-phase out." They'll accept 110V single-phase and internally convert it.

110V hookup:

  • Line (hot) → VFD input L1
  • Neutral → VFD input N (or L2)
  • Ground → Ground
  • Output terminals → Spindle motor leads

Some motors are dual-voltage (110/220V selectable). Check your motor. If it's hardwired for 220V, you can't run it on a 110V VFD.

Safety: VFD output is genuinely dangerous. The capacitor bank stores charge even after power-off. Don't touch the output terminals without isolating the VFD for 30 seconds first.

The RPM/Hz Relationship

Understanding this prevents embarrassing mistakes:

```

RPM = Frequency (Hz) × (120 / # of poles)

For a 2-pole motor:

400 Hz × (120 / 2) = 24,000 RPM

```

So if you set PD004=400 and PD005=400, your spindle max RPM = 24,000.

If you set PD004=300, max RPM = 18,000.

Don't confuse nameplate RPM with base frequency. A 24,000 RPM spindle has a base frequency of 400Hz, not 60Hz.

Configuration Checklist for Typical 1.5kW Hobby Spindle

```

PD001 = 1 (External terminal control)

PD002 = 1 (External run command)

PD003 = 1 (0-10V analog input)

PD004 = 400 (Base frequency for 24k spindle)

PD005 = 400 (Max frequency)

PD011 = 0.5 (Min frequency)

PD014 = 8 (Acceleration time, seconds)

PD015 = 15 (Deceleration time, seconds)

PD023 = 2 (Motor poles)

PD141 = 220 (Rated voltage from motor nameplate)

PD142 = 7 (Rated current from motor nameplate)

PD143 = 1.5 (Rated power in kW)

PD144 = 400 (Rated frequency)

PD145 = 2 (Rated poles)

```

After setting, save with PD144 or per-manual "save" command. Power cycle the VFD.

What We'd Buy

For a standard hobby CNC: Huanyang VFD 1.5kW 110V single phase (~$50-80 on Amazon or AliExpress) paired with a matched 1.5kW 24,000 RPM spindle motor (~$30-50).

Add a PWM-to-0-10V converter module (~$10) to interface with GRBL cleanly.

Total spindle package: ~$90-140. Reliable, proven, community support is massive.

Shop This Guide

Product Link Notes
Huanyang VFD 1.5kW 110V Huanyang VFD 1.5kW 110V on Amazon → Most common choice for hobby CNC. Proven platform.
PWM to 0-10V Converter PWM to Analog 0-10V Module on Amazon → Clean spindle control from GRBL. $5-15. Essential.
1.5kW Spindle Motor 1.5kW 24000RPM Spindle Motor on Amazon → Match with Huanyang VFD. Water-cooled preferred for extended use.
VFD + Spindle Complete Kit VFD Spindle Bundle on Vevor → Pre-matched VFD and motor kits. Cheaper than buying separately.