GRBL 1.1f config with Prontoneer CNC Shield?

I was wondering about this in the GRBL 1.1f congig file. Since the K40 fires on low and off on high, is this what to use instead of having a logic switching circuit? I am using the Protoneer CNC Arduino shield.

// Inverts the spindle enable pin from low-disabled/high-enabled to low-enabled/high-disabled. Useful
// for some pre-built electronic boards.
// NOTE: If VARIABLE_SPINDLE is enabled(default), this option has no effect as the PWM output and
// spindle enable are combined to one pin. If you need both this option and spindle speed PWM,
// uncomment the config option USE_SPINDLE_DIR_AS_ENABLE_PIN below.
// #define INVERT_SPINDLE_ENABLE_PIN // Default disabled. Uncomment to enable.

// By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help
// preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses
// the spindle direction pin(D13) as a separate spindle enable pin along with spindle speed PWM on pin D11.
// NOTE: This configure option only works with VARIABLE_SPINDLE enabled and a 328p processor (Uno).
// NOTE: Without a direction pin, M4 will not have a pin output to indicate a difference with M3.
// NOTE: BEWARE! The Arduino bootloader toggles the D13 pin when it powers up. If you flash Grbl with
// a programmer (you can use a spare Arduino as “Arduino as ISP”. Search the web on how to wire this.),
// this D13 LED toggling should go away. We haven’t tested this though. Please report how it goes!
// #define USE_SPINDLE_DIR_AS_ENABLE_PIN // Default disabled. Uncomment to enable.

On a laser, you want to use variable spindle (PWM) to adjust the laser power, but in this case the INVERT_SPINDLE_ENABLE_PIN has no effect.
You could either change the cabling to use TH (active high) instead of LO (active low) of your K40 power supply or you could invert the PWM output with a mosfet or transistor.

@cprezzi , Thank you for the reply! So I should keep the config “stock” besides parameters that are needed for proper machine movement and just trigger $32=1 for laser control and use the Mosfet to invert? Any insight on how to connect the CNC shield for proper K40 control?

I don’t have any schematics myself, but a quick google search for “mosfet inverter” delivered this: https://www.quora.com/How-is-MOSFET-used-as-an-inverter

The K40 power supply has an internal pull up resistor on the L input, which only needs to be tied to GND to fire the laser.
This means you could directly connect an N-Channel MOSFETs drain pin to the L input of the power supply, the source to GND and the gate to the PWM output of the arduino. GND of Adruino and power supply need to be connected also.

@cprezzi So not like this? Using the FET, does that control laser intensity by PWM or just on/off?

Normaly the IN pin is connected to a potentiometer to adjust the max current (= laser power) and the L pin is used for PWM (low active).
So I would connect the mosfet drain to the L pin without an additional pullup (because L is pulled up internally in the PSU).

@cprezzi So like this or using the L on the center connector? A bud of mine is using the same controller without FET and has the L/G bridged (center connector) and has D11 to the 0-5v connection also on the center connector. His works fine and PWM is controlled by shield/Software BUT, he does have a certain way to power the board or he gets a prefire of laser which I am trying to avoid. That is why I wanted to add the FET to eliminate that. I am being told NUMEROUS ways to wire this up to a K40 and my head hurts… LOL

@cprezzi Here is my buds connections

@Custom_Creations Your schematics is close, but you don’t need the resistor and connection to 5V on the Xpro, because the Laser PSU has an internal pullup.

@cprezzi I do not have an xpro. Just example of connection :wink: So take off the resistor on the 5v connection and it will be correct or dont use the 5v and resistor at all??

This also works with CNC-Shield:

1 Like

The advantage of having a potentiometer is that you can adjust the maximum power with the pot and still use the whole PWM range of 0-100%. This way you don’t lose grayscale resolution.

@cprezzi Is not using a POT an option?

Yes. You could just bridge the center (input power level) to the right (5V) pin to fix power to max. Or better use a fixed voltage divider to set the max. allowed current. But I don’t recomend both.
Grbl has only 256 PWM steps from 0 to 100%. If you just need 10% power for the darkest part of an engrave, then there are only 25 different power levels left. That’s not enough for grayscale.