Controlling a VFD Spindle using 0-10V
- Phil Barrett
- 3 hours ago
- 5 min read
Variable Frequency Drives (VFDs) are a great way to control CNC spindles. A common method of control is using voltage (0-10V). This post describes how to use this with Brookwood Design's CNC controller boards - T41U5XBB or RP23CNC. Though, the information provided is broadly applicable to many other controllers. Our examples are shown using the RP23CNC board but connections to the T41U5XBB are basically the same.
What is a VFD?
A Variable Frequency Drive is a device that takes fixed frequency 2 phase power (common North American and European line voltage wall outlets) and turns it into variable frequency 3 phase power. This allows the VFD to control the speed of a motor - in our case, a spindle with a collet that holds a cutting tool (often called a bit). A control input to VFD sets the output frequency and, thus, the spindle speed. VFDs are intended to control a wide range of motor types. That means they can be breathtakingly complex with, literally, upwards of thousands of parameters and settings. And, different manufacturers of VFDs have wildly different ways of presenting these options. Because of that, this article will not attempt to give specific VFD suggestions but rather an overview of how to connect to a CNC controller. We will use some examples from real VFDs, though.
CNC Controller outputs
Typically a CNC controller has two types of outputs to run a VFD: on/off and speed. On/off control is simply a binary signal. Usually, 0 (0V) means off and 1 (5V) means on. On our boards, this is called Spindle Enable. It is often used to switch a relay to turn the spindle on or off. Most VFDs have an input setting for on/off control and allow using an external control signal. You will need to change the VFD's settings for that. Commonly called FWD or FOR, usually part of a group of multi-function inputs. Connecting this input to ground (via the relay switch) causes the VFD to turn on the spindle. See figure 1 below. It is also common for VFDs to have a similar input for reverse rotation. You will need to make sure that the input you are using is configured for FOR.
Because VFDs often use 24V for the FOR control voltage, you should not connect the CNC controller board's enable output directly to the VFD input. You may damage your board.
To control the VFD's spindle speed, we use voltage (0-10V) from the CNC controller. You connect the 0-10V output to the 0-10V input on the VFD. Note that some VFD use different terms so verify the terminal that is used for 0-10V control. You will need to change the VFD settings to allow external speed control and tell it to use 0-10V input.

Our CNC controller boards can drive bare relays directly to minimize part count. See figure 2. Automotive and DIN Rail mount relays work quite well for this application. There are a lot of choices. Automotive (12V) relays are common and readily available. Usually, they have mounting holes and are easy to mount. Also, if you are using DIN rails in your electronics box, 12V DIN rail relays are readily available and help give your project a professional look.

Configuring the VFD
A complete discussion of setting up your VFD and spindle is well beyond the scope of this document. There are many parameters for your motor, line voltage, line frequency and so on that must be set to ensure proper operation. These are independent of the control and speed source. Please refer to your VFD user manual. You may find support in various User Group forums. A.I. can also be helpful though try to verify any suggestions it gives you.
On HuanYang VFDs, the configuration settings pertaining to control and speed source are typically:
PD001 (Command Source) set to 1 (External)
PD002 (Speed Source) set to 1 (Analog)
PD044 (D1 Input pin) set to 2 (Forward)
PD070 (Analog Input) set to 0 (0-10V)
For other brands of VFDs, please the appropriate user manual though many are fairly similar to HuanYang.
You should now be able to turn your spindle on and off via GCode commands. In a GCode Sender console, turn the spindle on with
M3 S1000and turn it off with
M5Alternatively, you can use the spindle control provided by the your GCode sender.
Tuning 0-10V output
The 0-10V circuit works by using a circuit to filter a 5V PWM signal and amplify it to 10V. As such it needs
12V or higher input, provide via the 12V screw terminals. A second order filter with an
aggressive low pass cut off frequency is used to provide a stable signal for the spindle controller.
Because source voltage level can vary, the amplifier must be adjusted for accuracy. You can do this by turning on your spindle
in GCode (via M3Sxxxx) to full speed and adjusting RV1 until the voltage on the 0-10V terminal reads 10V. See figure 3.

Here is a step-by-step method you can use:
Disconnect your spindle or VFD.
In the Settings: Grbl tab, set $30 (Maximum Spindle Speed) to 1000.
Send the following command to grblHAL: M3 S1000. This turns on the spindle and causes the speed to be
set to 100%.
With a digital multimeter, measure the voltage between the 0-10V output and Gnd terminals.
With a small phillips head screwdriver, adjust RV1, labeled “0-10V Adjust”, until the voltage is as close to 10V as you can get. Anything in the range 9.990V to 10.010V is acceptable. Use of a non-metallic screwdriver is recommended.
Send the following command to grblHAL: M5. This turns off the spindle and you should read 0V.
Reconnect your spindle or VFD and test.
When you are done, change the max spindle speed setting, $30, to something more appropriate for your spindle. For example, if your spindle's max speed is 24000 RPM, set $30 to 24000. Thus, you can put the actual desired RPM in the S word part of the M3 (turn spindle on) command. Most CAD/CAM applications use actual RPM values in the GCode they produce.
You may want to repeat the above process with the spindle connected and running to fine tune the maximum
speed. Most VFDs have a display that shows the actual spindle speed.
Using 0-10V signal for On/Off
Some VFDs allow using the analog speed signal for On/Off control. And, it is possible to just connect FOR to ground, i.e. always on. But, this is a very bad idea and is highly discouraged for 2 reasons:
1) The analog 0-10V output section of our CNC controllers may sometimes have a low voltage output when set for 0V. This may cause the VFD to run the spindle at a very low speed. Typically spindles are not designed for low speed and could be damaged.
2) Even if the spindle stops at 0V, EMI and other electrical noise can cause the spindle to run unexpectedly. This can lead to injuries or other damage.
About Me.

I'm Phil Barrett, a long time CNC enthusiast. I run a small company, Brookwood Design, that makes several breakout boards for grblHAL and love to help people get the most out of their CNC machines.
































