This has been a long journey, so I hope my experience helps others.

The first issue with this combo is that SuperPID reverses SPINDLE ENABLE from what Grbl (and most others) expect. You have to uncomment line 266 in config.h to
Code:
#define INVERT_SPINDLE_ENABLE_PIN
Not a big deal, and it's been covered elsewhere.

Also, if you are going to provide more than 12V of power to your motors, you need to desolder and remove the D1 Diode on the Ramps1.4 board. Covered elsewhere.

The problem arises from the actual SPINDLE PWM signal. Grbl-Mega-5x is default configured such that the PWM signal will come from the D8 terminal. This is the terminal that in 3D printers usually controls the heated bed and is connected to an onboard mosfet. It must be fed its own 5V source to the 11amp power input terminals.

Unfortunately, if you connect the D8 terminal's (+) pin to the SuperPID's PWM pin you get a constant 100% duty cycle. It turns out that the SuperPID's PWM is also energized. I thought this was possibly a defective board, but tech support at SuperPID confirmed that this is by design. Once you close the circuit with the D8 terminal, you get a constant 5v. There are discussions on CNCZone about grounding issues with the SuperPID, but after trying every possible grounding combination and design, and corresponding with SuperPID, it became clear that grounding was NOT the issue.

It turns out that if you connect the SuperPID's PWM terminal the D8 terminal's (-) pin, however, you CAN control the spindle speed. Only the speed is inverted. For example, if your range is 0-30000 rpm and you send a S20000 you will get 10000rpm. If you send an S10000 you will get 20000rpm. S30000 shuts the spindle off and S500 gives you full speed.

The work around was to invert the pwm duty cycle in Grbl. I had to modify spindle_control.c on line 166 to read:

Code:
return(SPINDLE_PWM_MAX_VALUE - pwm_value);
Finally I have a spindle that turns on when it supposed to, spins at the speed I tell it to, and turns off when it is supposed to.

I could find no other write up of this, so I hope this helps others with this setup. It seems simple, but BOY did it cause me a headache to figure out.

Similar Threads: