Spindle Control Problems

I have built a 1000x13000mm CNC based on the X carve project, and used the parts and instructions to assemble the electronic and software sides of the unit. Tech support has confirmed the software is all up to date. After working with TS to figure out a work around (for not connecting to Easel) through UGS, I was able to test my axis, moving x, y, and z just fine.

However, I can not get the spindle to turn on now that I am trying to use the PWM signal instead of the pot on the speed controller. Second problem, possibly related in some way, is that when I send a -Y command through UGS, the spindle will spin while the Y axis moves. The +Y command does not turn the spindle, so I am somewhat confident that it is not crossed wires. Moving the jumper and using the pot on the speed controller does not affect the Y axis, also supporting this. I am far more familiar with Marlin-flavored gcode from my 3D printer, can someone point out a few basic commands for spindle control? I may be using the wrong commands; are “S500 M3” to turn it on and “M5” to turn it off correct?

Anyone have some ideas where I can look for a solution?

Try S1200 M3’ see if it works.

1 Like

Are you using the 48 volt quiet cut spindle?

Maybe not crossed wires, but I think you do have a wiring problem.

Can you post some pictures of your wiring?

Would be S12000 M3 to get full width PWM signal with version 0.9 of grbl.

1 Like

Oups, I forgot one “0” again. Thanks Larry.

Yes, 48v QC spindle.
Pictures of the wiring are possible, but you aren’t going to like it :sweat: … everything is hanging out right now because the electronics box has not been fabricated. I’m honestly not sure where that problem may rear its ugly head, as all wire connections were shrink wrapped and the motor wires are connected to the board through the screw clamps.
Are there differences in grbl where S# number refers to the actual rpm? I thought it was all scaled from 0-1000? Ill try it. Could be a possible resolution as the QCS is 3k-12k and I was starting small at 500 (50%).

I appreciate the replies, I’ll let you guys know what happens when I get back to the shop- which will either be saturday for a few hours or next tuesday night.

Don’t worry about pretty, right now we just want to get it working. Make sure we can see how the connections are made (which wire runs to which connection) so we can see if there is a miss-wiring.

Grbl operates with a range of RPM values. If you are running the Inventables fork of version 0.9j the range is 0 to 12000 RPM. This is set by a configuration setting when the firmware is compiled. If you compile from source code then you can change the range to whatever you want it to be. In version 1.0c you can set the range with a $ parameter setting. Once you have the range then grbl will divide it into 256 sections. It will set the pulse width to a value that corresponds to your selection with the S parameter.

For the normal case in version 0.9j you have a pulse width size corresponding to (12000 - 0) / 256 = 46.875 RPM per pulse width change…

S0 has a special meaning in grbl which is to turn the spindle off.

So if you set the speed to S5000 you would get a pulse width that would correspond to 5000 / (12000 - 0) = 41.66 percent.

Some people who use spindle/routers without PWM RPM control use the PWM signal to turn a relay on/off to control power to their router. Since they only want an on/off condition to use the relay as an on/off switch they set the RPM to 12000 to get a 100 percent duty cycle to their relay.

I think I know why PWM doesn’t work for you. Did you buy all of your components from Inventables? Did you follow the wiring instructions on the Inventables web site? What version of grbl are you using?

I am using the latest inventables version of grbl. I did buy most of the electronics from tem as well, but the speed controller I got from SMW3D I think.

If inventables is 0 to 12000, then that’s why it wouldn’t run… I was giving it way too little power.


If you have the quiet cut spindle hooked up as the instructions have you do it then the PWM signal is going to the relay and not the speed controller. Also, the PWM pin for the version 0.9j and 1.0c is not where it is shown in the instructions (instructions are for versions prior to version 0.9).

The PWM pin for version 0.9 and beyond is pin D11 (not D12).

I recently set this up on my system and it is definitely pin D11 and M3 12000 to fire the relay for the spindleand M5 top stop it

I am also running a 48v quiet cut on a separate power supply with a potentiometer to control rpm and have GRBL 1.0c .

Once you get it working, you will find that the spindle will start briefly when you open the connection to the pc ( I am using UGS to send code) and will stop after a couple of seconds. This is important if you have an alligator clip for a touch plate connected. That was entertaining to watch how fast a wire can spool up onto the bit and just how fast the touch plate itself can travel on it’s own with a bit of help!:grinning:

Alright so it sounds like I just need to move some wires around? Your saying… the terminals on the Arduino (or gshield, I forget what’s on top) are different for the versions of grbl, correct?

I’m running the QC off a separate power supply through a speed controller- I can use the pot to work it if I switch the jumper too, but i would like to enable gcode speed control if I can.

I’ll grab some pictures so you can see what I’ve got- I may be able to sneak by the shop in the morning after work for a few minutes.

Yes. They swapped two pins and added one between version 0.8 and 0.9.

Copy that

Many thanks for the link. The problem turns out to have been error between soldering iron and chair… The instructions over on the Xcarve build site never explicitly say which terminals to solder to, and as I have been skipping steps here and there due to differences in my build, I was not paying enough attention to the pictures in those sections. I’m grateful to the Maker Gods that I didn’t end up crashing all sorts of stuff due to the way I had it wired- I had the wire layout in D0-D6 instead of D8-GND… :expressionless:
And it shows pretty clearly why the -Y command was moving the spindle: moved down the board, the spindle was getting a motor signal.

I can’t wait for my phone upgrade so I can stop posting potato-quality photos… But here are some photos of the project!
After moving the wires to the correct terminals, everything works as it should. Many thanks to everyone!