Hi everyone. I have built a JD’s garage CNC plasma and recently built the moving z axis for probe touch off using a micro switch. Any recommendations of a post processor so that it probes properly? currently running the sheetcam GRBL plasma (edited) it will jump up between moves however just goes back to the z zero and does not touch off as intended. Any input is appreciated.
Congrats on your build! I conducted a similar build in 2021, you can see it and read about it in my signature link to youtube and related links in the youtube channel description.
I love SheetCAM since adopting it about 15 months ago. Facing a similar functional challenge in finding the right post processor as you stated, I decided to modify the standard grbl scpost to suit my needs. The code is fairly man-readable and well commented, so you can perhaps modify it as well if you desire. I’d be happy to help or advise if needed.
Enjoy.
GRBL plasma LDC v24-12-8.scpost (9.81 KB)
Thanks for the quick response. I will try that post processor and report back. It’s been a steep learning curve for all things cnc however I still need to wrap my head around what all the g code functions mean. For now I had found a processor that at least raises and lowers the z to prevent tip ups. However when I tell the machine to go home it slams the z into the work surface and drags it home. But during the actual cuts it operates OK.
here are some links to grbl configuration, commands, and gcode stmt references.
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration#grbl-settings
https://github.com/gnea/grbl/wiki/Grbl-v1.1-Commands
http://linuxcnc.org/docs/html/gcode.html
So when i try your processor it double probes then i get this error:
[20:37:48] [ G00 G17 G40 G54 G90 M5 F0 ] ok
[20:37:48] [ $G ] [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]
[20:37:48] [ $G ] ok
[20:37:48] [ G20 ] ok
[20:37:48] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0 S0]
[20:37:48] [ $G ] ok
[20:37:48] [ G28 G91 Z0 (retract Z for start of job) ] ok
[20:37:48] [ $G ] [GC:G0 G54 G17 G20 G91 G94 M5 M9 T0 F0 S0]
[20:37:48] [ $G ] ok
[20:37:48] [ G90 ] ok
[20:37:48] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0 S0]
[20:37:48] [ $G ] ok
[20:37:48] [ G0Z1.5000 ] ok
[20:37:48] [ G0X3.0107Y4.8170 ] ok
[20:37:48] [ G0Z0.1900 ] ok
[20:37:48] [ G91 (relative mode) ] ok
[20:37:48] [ $G ] [GC:G0 G54 G17 G20 G91 G94 M5 M9 T0 F0 S0]
[20:37:48] [ $G ] ok
[20:37:52] [ [ PROBE ] ] Probe Completed.
[20:37:52] [ G38.2 Z-0.7215 F39.37 (probe fast to find sw) ] [PRB:-373.469,6.086,-46.035:1]
[20:37:52] [ G38.2 Z-0.7215 F39.37 (probe fast to find sw) ] ok
[20:37:52] [ G0 Z0.1969 (retract off probe switch) ] ok
[20:37:53] [ G04 P0.400 (wait for sw debounce) ] ok
[20:37:58] [ [ PROBE ] ] Probe Completed.
[20:37:58] [ G38.2 Z-0.1969 F1.97 (probe slow) ] [PRB:-373.469,6.086,-45.865:1]
[20:37:58] [ G38.2 Z-0.1969 F1.97 (probe slow) ] ok
[20:37:58] [ G0 Z0.3346 (fast retract to top of material) ] ok
[20:37:58] [ G92 Z0 (set temp Z0) ] ok
[20:37:58] [ G90 (return to absolute mode) ] ok
[20:37:58] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F50 S0]
[20:37:58] [ $G ] ok
[20:37:58] [ G0 X3.0107Y4.8170Z0.1900 ] ok
[20:37:58] [ M4 S1000 (THC effective On condition) (fire the torch…) ] ok
[20:37:58] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M4 M9 T0 F50 S1000]
[20:37:58] [ $G ] ok
[20:37:59] [ G04 P0.15 (PH 2 CH time: 0.15, Total PD:0.3) ] ok
[20:37:59] [ F75 ] ok
[20:37:59] [ G1X3.0107Y4.8170Z0.0600 ] ok
[20:37:59] [ F80 ] ok
[20:37:59] error: 20 - Unsupported or invalid g-code command found in block. [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ]
[20:37:59] [ ERROR ] error: 20 - Unsupported or invalid g-code command found in block. [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ]
[20:37:59] [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ] error:20
[20:38:15] Grbl 1.1g [‘$’ for help]
[20:38:15] [ JOB COMPLETE ] Job completed in 00h00m
[20:38:15] ok
[20:38:29] [ G10 P0 L20 X0 Y0 Z0 ] ok
[20:38:30] [ GCODE Parser ] GCODE File (from gcode editor) sent to backend
[20:38:30] [ G00 G17 G40 G54 G90 M5 F0 ] ok
[20:38:30] [ $G ] [GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]
[20:38:30] [ $G ] ok
[20:38:30] [ G20 ] ok
[20:38:30] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0 S0]
[20:38:30] [ $G ] ok
[20:38:31] [ G28 G91 Z0 (retract Z for start of job) ] ok
[20:38:31] [ $G ] [GC:G0 G54 G17 G20 G91 G94 M5 M9 T0 F0 S0]
[20:38:31] [ $G ] ok
[20:38:31] [ G90 ] ok
[20:38:31] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F0 S0]
[20:38:31] [ $G ] ok
[20:38:31] [ G0Z1.5000 ] ok
[20:38:31] [ G0X3.0107Y4.8170 ] ok
[20:38:31] [ G0Z0.1900 ] ok
[20:38:31] [ G91 (relative mode) ] ok
[20:38:31] [ $G ] [GC:G0 G54 G17 G20 G91 G94 M5 M9 T0 F0 S0]
[20:38:31] [ $G ] ok
[20:38:35] [ [ PROBE ] ] Probe Completed.
[20:38:35] [ G38.2 Z-0.7215 F39.37 (probe fast to find sw) ] [PRB:-296.999,128.401,-43.270:1]
[20:38:35] [ G38.2 Z-0.7215 F39.37 (probe fast to find sw) ] ok
[20:38:35] [ G0 Z0.1969 (retract off probe switch) ] ok
[20:38:36] [ G04 P0.400 (wait for sw debounce) ] ok
[20:38:40] [ [ PROBE ] ] Probe Completed.
[20:38:40] [ G38.2 Z-0.1969 F1.97 (probe slow) ] [PRB:-296.999,128.401,-43.195:1]
[20:38:40] [ G38.2 Z-0.1969 F1.97 (probe slow) ] ok
[20:38:40] [ G0 Z0.3346 (fast retract to top of material) ] ok
[20:38:41] [ G92 Z0 (set temp Z0) ] ok
[20:38:41] [ G90 (return to absolute mode) ] ok
[20:38:41] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M5 M9 T0 F50 S0]
[20:38:41] [ $G ] ok
[20:38:41] [ G0 X3.0107Y4.8170Z0.1900 ] ok
[20:38:41] [ M4 S1000 (THC effective On condition) (fire the torch…) ] ok
[20:38:41] [ $G ] [GC:G0 G54 G17 G20 G90 G94 M4 M9 T0 F50 S1000]
[20:38:41] [ $G ] ok
[20:38:41] [ G04 P0.15 (PH 2 CH time: 0.15, Total PD:0.3) ] ok
[20:38:41] [ F75 ] ok
[20:38:41] [ G1X3.0107Y4.8170Z0.0600 ] ok
[20:38:41] [ F80 ] ok
[20:38:41] error: 20 - Unsupported or invalid g-code command found in block. [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ]
[20:38:41] [ ERROR ] error: 20 - Unsupported or invalid g-code command found in block. [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ]
[20:38:41] [ M7 (enable Z THC anti-dive circuit when SPWM < 86) ] error:20
[20:38:46] Grbl 1.1g [‘$’ for help]
[20:38:46] [ JOB COMPLETE ] Job completed in 00h00m
[20:38:46] ok
Line 86 - M4 S1000 (THC effective On condition) (fire the torch…)
I dont have torch height control yet. Just z probe. so how do i remove the thc condition?
It appears your grbl controller does not have M7 use enabled (normally mist control output when milling). I use M7 on/off output signal to enable an external THC Z Anti-Dive circuit when XY is cornering. The signal is not necessary in your case, M7 command can be commented out or deleted.
To comment out the command (you may find a need for it later), change the .scpost file as such:
line 15: LdcM7Cmd = “M7 (enable Z THC anti-dive circuit when SPWM < 86%)\n”
change to: LdcM7Cmd = “; M7 (enable Z THC anti-dive circuit when SPWM < 86%)\n”
There is an M9 command later in the code stream which would turn off M7, but if M9 is issued without a prior M7 that is not a problem.
It could be that your controller has M8 use enabled (normally flood control output when milling). If so, in the future, if you need such a digital output control for THC Z Anti-Dive enabling or arming, then you could change M7 to M8.
I’m in the same boat, and could do with the Z probe post processor, if anyone has figured it out?
Did you get this to work OK Yotifab?
I won’t speak for YotiFab, but since the last posts he and I exchanged about 3 weeks ago we also spoke on the phone a couple of times to fine tune the .scpost for his grbl 1.1g version. I use the post on 1.1i. So based on what I learned from YotiFab on how our use cases were different, I modified the post to easily work in both cases and it should apply to most any grbl 1.1+ versions. I uploaded the .scpost in the referenced forum thread just the other day with these ease of use improvements. Download and try it, let us know how it goes. You most likely just need to define and set post variable LdcThcZAnitDive to zero 0 in Options->Application Options->Variables window tab.
https://sheetcam.discoursehosting.net/t/grbl-plasma-w-thc-torch-touchoff-and-rotary/7342/1
I just uploaded a new version of the .scpost https://sheetcam.discoursehosting.net/t/grbl-plasma-w-thc-torch-touchoff-and-rotary/7342/1
I forgot to add S1000 to the M3 torch trigger/fire command to cover the case of using grbl on Arduino Uno.
That’s brilliant work. I’ll try this out over the weekend upon installation of the Z-Axis. Can I add, should the code say version 16 rather than 15? Just save any confusion
Also, fantastic work on your build. It really does look very tidy!
Thank you for the comments, I’m glad to help.
The .scpost should have LdcVersion = “16”, the one I fixed this morning. I uploaded it apparently after you downloaded the stale “15” version.
It’s in the same forum thread, with the comment “version 16”.
Good luck with it, please let me know if you have questions about the code or if you’d like adjustments.
blouchip has been an excellent resource for me and has gone above and beyond to help me out. His knowledge is far beyond mine and will steer you in the right direction. His most recent post processor worked out for me. Thanks again Lou!
I am so glad I found this and thanks to bLouChip. I am finishing up my JD Garage Plasma as well and I spent about 1 hour trying to learn fusion 360 and I said forget it. I had an old version of Sheet Cam so I installed it updated it and here I am . I haven’t tried the PP yet but as soon as I do I will report back. Thanks all.
I’m another JDsGarage builder. Thinking about moving from Fusion360 to SheetCam. I have the OpenBuilds postprocessor working, and tried to import it for SheetCam. Evidently SheetCam does not allow /* or // for comments. So I am either going to edit out all of these (Huge file) and replace // with “;” or find another processor.
Currently I am setup for Z IHS and about to start building THC voltage divider and use some existing software. Probably used relays to flip back and forth from FluidCNC Z control to Arduino THC depending on ARC start.
The post works great except I dislike the slow retract after the touch probe does its touch down, what do I need to do to change that. I don’t have a Torch height control, I just want to touch off then go to a height defined in the tools settings, just simple.
@devloop - sure, no problem.
which version of scpost are you using? latest is 26.5 here: https://sheetcam.discoursehosting.net/t/grbl-plasma-w-thc-torch-touchoff-and-rotary/7342/35
So this info is relative to V 26.5
this is the torch probe cycle for Custom post option “Do you have a THC ?” unchecked or NO.
; LDC begin per-cut torch touchoff to adjust Z0
G91 (enter relative distance motion mode)
G38.2 Z-16.810 (probe fast to find sw)
G0 Z3.000 (retract off probe switch)
G04 P0.400 (wait for sw debounce)
G38.2 Z-3.000 F100 (probe slow for accuracy)
G90 (return to absolute distance motion mode)
G92 Z-8.610 (adjust Z0 relative to current Z0 - probeDepth)
G0 Z3.200 X77.884 Y17.543 (goto PH & restore XYA precision)
M3 S1000 (fire the torch w constant S-PWM)
G04 P0.51 (Plunge travel time: 0.09s, Total PD: 0.6s)
G1 Z1.700 F1000
Sounds like you don’t want this line of gcode ?
G38.2 Z-3.000 F100 (probe slow for accuracy)
If so, there are 3 lines in the scpost that produce that one line of gcode, so perhaps the easiest thing to do is just make it a gcode comment line
like this:
after line# 682 : post.Text(“G04 P0.400 (wait for sw debounce)\n”)
insert the line: post.Text("; ") – comment out the following gcode stmt, don’t need 2 probe cycles
and before line: post.NonModalNumber(LdcProbeCmd, -PBR * scale, format)
The first torch probe cycle at 1000mm/m speed overruns the probe switch actuation on the floating torch mount by about 0.225mm on my machine. That’s OK as long as you account for that overrun distance (on your machine) in the “Floating Torch Mount Travel” distance in the scpost Custom Options dialogue. You have to add it to the actual floating mount travel distance to actuate the probe switch, the sum of those distances is the value for this field. The screen shot is showing 8.61mm in this field now (my machine).
The switch actuator overrun at 100mm/m in the second probe is negligible, that’s why its in there. I decreased that retract distance and sped up the second probe from 50 to 100mm/m a few versions back, so you may have the version with the old style 5mm retract and 50mm/m probe speed.
@devloop- I made a mistake in my previous instruction, you’re going to want to remove or comment out more gcode than what I first advised.
These are the gcode stmt lines you want to remove or comment out:
G0 Z3.000 (retract off probe switch)
G04 P0.400 (wait for sw debounce)
G38.2 Z-3.000 F100 (probe slow for accuracy)
You can use the same technique to comment out the gcode stmt as I previously described.
You won’t need to replace the delay for sw debounce, the pierce delay will cover that.
Thank you, ended up having to delete all the lines you mentioned including the lines between them. I’m actually running the first post you made, its simple and works, I just changed M7 to M8.