I’m just wrapping up my V2 to V4 upgrade and I love the new setup - but I’m at a loss trying to figure out how to use GRBL’s default M3 command for controlling my spindle. I’m using a regular Dewalt palm router with a relay switch - which works GREAT using M62 P0 controlling gpio26 (yes, I know gpio27 is better) but I just want to use GRBL’s built in default.
I want to use GRBL’s M3 for controlling either gpio26 or 27 to turn on the spindle. How do I get this to work?
Apologies if this is a repeat question - as I’m sure it’s been asked and answered many time - I simply cannot find a single one of those posts. It’s been hours. Nothing I’ve tried has worked. Please help a dude out.
You don’t say what controller you have , but since you mentioned GPIO 26/27, I’m going to assume it’s a jackpot.
Jackpot runs FlyidNC, not GRBL.
You should define a Relay: section of your config.yaml, and define it with GPIO 26.
I’ll edit this post in a minute with a recommended configuration section.
Edit: Something like this. I edited this to match your GPIO number.
If it still doesn’t work for you, let’s see your YAML and a picture / schematic of how you’ve wired the relay.
Also: show the results from a $ss
command, and the output from the terminal when you send the M commands to start/stop the spindle.
relay:
direction_pin: NO_PIN
output_pin: gpio.26
enable_pin: NO_PIN
disable_with_s0: false
s0_with_disable: true
spinup_ms: 0
spindown_ms: 0
tool_num: 0
speed_map: 0=0.000% 0=100.000% 1=100.000%
off_on_alarm: false
(Edited to fix typos)
1 Like
This worked! THANK YOU!! Previous attempts of defining a ‘relay’ or ‘spindle’ always threw errors, even after being re-typed by hand and run through YAMLlint to confirm formatting… I was at my wits’ end, but the above section works great.
Anyway, to anyone who find this thread later:
Jackpot boards are not set up to handle M3 by default (even though the FluidNC UI has buttons for this, and it’s the default command for spindle control in GRBL - which FluidNC was designed to be compatible with).
In config.yaml you need to remove gpio26 (or 27!) from ‘user_outputs’ section and then add the ‘relay’ block from MakerJim in order to get M3 commands to activate the right pin. I’ve attached a copy of my working config file for reference - however to upload it to the forum I had to change the file extension - it should be named ‘config.yaml’: config.yaml.NOTGCODE.gcode (7.3 KB). Hopefully this helps someone else. Cheers!
4 Likes
Always good to see a setup come together.
Hope you share details of your projects.