VFD Spindle Speed control Via Gcode on SO3 XXL

Hi guys,

I’ve been searching all over the place - the wiki, the shapeoko forums, this forum, and google… and am really struggling to find any infomation on using the latest Carbidemotion board to control my chinese VFD.

As I understand it, the PWM pin on the CM board (D11 if i understand correctly) has a 0V-5V output that can be hooked up to the 0V-5V input on my Huanyang VFD.

My question is, if I hook these up, is that all that is required? Can I use the M3 & M4 commands to start and stop my VFD, and set the rpm using the Sxxx prefix?

Please anyone (C3D guys too please!) weigh in with your experience or info, I’m keen to get this set up, as far as I can tell it is how the Nomad series runs, and thats a very similar board… should be possible on the SO3 surely!

These are the only pages with info I can find, and there just isn’t quite enough there for me to work it out

grbl + SuperPID2 = Super Awesome

Shapeoko forums: VFD Speed Control

Shapeoko forums: Carbidemotion Spindle control

I believe all those and a few more are listed at:

I’d hope that the commercial option would be well documented.

If you come up with anything which needs to be added, please do.

Note that since then, Carbide 3D has launched the BitRunner and our own VFD spindle.

1 Like

Thanks Will, I’ve had a good look through most if that info, and from reading through the superPID manual it looks as though its only designed for single phase routers, im running a 3-phase spindle off a VFD

I guess my questions are:

  • Can I use the PWM 0V-5V output from the carbide board directly into the vfd 0V-5V inputs?

  • a few pages mention recompiling grbl to allow an ‘on’ signal to start the spindle, this was on the original board, is it still required?

Here is a discussion regarding using the CM PWM for VFD control. https://www.shapeoko.com/forum/viewtopic.php?f=21&t=7270&start=10#p57441

THis discussion also has a link about some changes to GRBL required to enable Spindle on/off.


Ah thats great thanks Craig, i hadn’t seen those threads. Its hard to find definitive information, and I want to be quite certain before I do it so I don’t fry my carbidemotion board.

Cheers! :slight_smile:

Spindle control is working on my stock SO3, just had to hook up the control wires…didn’t require any changes to the standard Carbide GRBL to do so…


Oh great @mikep , would you mind elaborating a little? And you connected them to your 0v-5v vfd inputs? I can see where the wires would logically go, i just want a little confirmation before i hook it up and power it on…
Much appreciated

I’ve made a bit of progress… I can control the speed of the spindle with the Sxxx command, but cannot turn the spindle on with it.

  • I have the D11 Pin on the arduino into the VI jumper on the VFD, this works without any problems
  • I have the D13 Pin on the arduino into the FOR jumper on the VFD, as directed by the manual.
  • I have the GND pin running to ACM on the VFD
    PD001 is set to 1 - which is external Input
    PD002 is set to 1 - which is external input, with the jumper switched to the left/VI side.

There are a few issues…

Given the M3 Command, and I put a voltmeter on the outputs, the D13 (spindle enable/Dir) goes to 0V, When given an M4 or m5 it goes to 5V… I believe it should be the other way around?

The other issue I have is that even with a 5V signal on the ‘enable’ input (with the M4 code), I cannot get the Spindle to run.

I don’t use a VFD, I use them with an external switch to enable/disable a router. 0v = off.

Don’t forget to set the spindle speed. just on/off won’t get you all the way there. The only output is the pwm, so if speed isn’t set, it’ll be some low frequency spike (ie. your multimeter will lie to you about what’s going on). S30000 M3 -> start spindle, at 30k rpm (so, should be basically 5v all the time)

1 Like

Did you get this worked out?
I don’t have my vfd hooked up to CM (researching how now lol) but I do use a keyed switch to turn the spindle on from the front of my machine. I have only 2 wires hooked up to do this,

  • FOR & DCM not ACM and PD001 set at 1.

When I connected my Super-PID to my SO3, I had to recompile GRBL to get it to turn on/off via the M3/M5 commands. In the config.h file, there is a configuration setting called “INVERT_SPINDLE_ENABLE_PIN” and one called “USE_SPINDLE_DIR_AS_ENABLE_PIN” that I had to set accordingly. I would check that to get the signals you desire.


I ended up replacing my electronics with a Gecko G540, which has all the required outputs for the spindle control.

as @RoguePirin mentioned, if you can get the correct outputs from your CarbideMotion board (which it should, with the aforementioned GRBL edit, then it should control your spindle without any problem.

I have an huanyang 1.5kw spindle, and use the following for spindle control:

– 5V spindle ON signal from G540 > 12V relay which runs off the power supply > The relay then supplies 12V to the spindle ON on the VFD. (it took me ages to work out that I needed a relay to be able to start/stop the spindle via gcode)

– 5V control signal from the G540 into the ACM input on the VFD to control spindle speed.

– I have a jumper from the FOR terminal to the COM terminal which means any input will run the spindle clockwise, as i have no need at this stage for counter-clockwise rotation

I am doing a write up with diagrams of my SO3 upgrade from CarbideMotion to G540 and LinuxCNC, I am away at work so not much is getting done on it at the moment, this will include the Spindle controls

Upgrade to GRBL 1.1 and speed control and power on is a simple 2 wire/ 5volt hook up, no relays, no jumpers.
The biggest question now for me is where to get pins for connecting to the board.

1 Like

These pins?..


1 Like

If you have the 2.4 board, Sparkfun has the 4 pin connector and body, the KK style will work, available from other sources too… For other versions of CM controller, the single pin headers Mark references will work fine on the spacing on the board.

I made a break out board that is mounted to the inside cover of my controller(insulated) , then run flexible connectorized jumpers to controller. All of my cabling lands on the BOB(with test ppoints), then connects to the controller. My reasoning was to centralize the cable connections and for ease in troubleshooting when a problem arises.


Resurrecting a dead thread here to try and get some clarity - on the 2.4 board, what pin is giving you +5V when M3S30000 is run that you’re able to fire a relay with?

1 Like

If you’ll send in an e-mail to support we should be able to have an EE look this up for you.

or maybe see Carbide Board 2.4 Drawings and tech info

You need the “PWM” and “GND”. I don’t know what’s on the two reserved pins. The PWM works fine with my IOT relay.


Also you only need enter m3s10000 to get full 5volts. G/L Ray