GRBL Plasma w THC, Torch Touchoff, and Rotary

This is the place for any plugins, posts or other useful tools you have created.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

updated to version 20.3-beta

I updated internal processing to more clearly handle cases of turning the THC ON and OFF. I'm not using the crazy Spindle Speed method anymore, doing so was taking advantage of a condition as to how the THC Z Anti-Dive circuit operates. Rather, I just use M7 now to manage THC ON/OFF state. I had to modify my THC Z Anti-Dive circuit to do this and it provides for fast dynamic switching of the THC now, as well as giving Z control back to grbl controller in the THC OFF state. I needed that THC / grbl controller well behaved operation with Z in order to cut rotary rectangle tubing, in cases where the shape is spanning a tubing corner, in those cases you will see grbl Z and Y motion gcode during the rollover through the corner, I'm guessing having an active THC may not be a good thing on those special condition shape cuts on a machine like mine. Special purpose rectangle tubing plasma rotary machine may be able to handle it with a THC active, either way you get the choice with the post variable LdcThcEnable.
Change the THC ON and OFF commands for your THC in the scpost prologue; LdcThcONcmd and LdcThcOFFcmd.
Schematic updated here: https://drive.google.com/file/d/1UKgOIl ... sp=sharing
Attachments
GRBL plasma LDC w Rotary.scpost
version 20.3-beta
(26.47 KiB) Downloaded 198 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

updated to version 21

updates involve clarification of code comments and testing and corrections to OnDrill()
Attachments
GRBL plasma LDC w Rotary.scpost
version 21
(27.08 KiB) Downloaded 203 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

update version 21.1

sorry for the quick change, but I decided to make the OnDrill() function/operation a pecker instead of a driller, but you have the option to easily adjust the pecking parameters in OnDrill(), so you can make it a driller just as easily. This is done without needing to change the tool.

Please report any bugs here; I'm not getting a lot of "table time" these days with the chilly weather, my shop is "naturally aspirated" with a 2300CFM blower during plasma cutting :(
btw - I've tested this scpost with both the latest SC Dev version of 7.1.35 and with the SC ga version of 7.0.21
Attachments
GRBL plasma LDC w Rotary.scpost
version 21.1 - the pecker
(27.95 KiB) Downloaded 186 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

udpated to version 22
-- 21 added OnDrill() support pecking or pierce hole
See the function OnDrill() for fine tuning the pecking parameters; %(75) of pierceDelay, and %(50) of plunge distance to "cutHeight", thus no need to change tool for plasma "drilling" or pecking. 0.75 and 0.50 are the defaults respectively.

-- 21.3 added YA and YB motion options, in addition to XA
See header comments for one of 3 assignments to rotaryAxis global var, XA is default.

-- 22 added Marking Tool support, such as EasyScriber
See header comments and global var for marking tool plunge feedrate assignment, 300mm/m is default. When defining the Marking Tool, for Z zero at top of material, use a negative Cut Height value which is the distance to compress the scribe spring for drag tension. Material Thickness on the Options-Job window must be larger than the absolute value of the Cut Height. Also, Plunge Safety Distance from this window is used on rapid motion to start point and in lieu of "pierceHeight" masquerading as cutHeight (which recall is negative value).
Attachments
GRBL plasma LDC w Rotary.scpost
version 22
(32.21 KiB) Downloaded 189 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

updated version 22.1

-- 22.1 fixed machine pause logic on new part.
During testing this morning I discovered that parts are not processed in the order that they reside in the part tree. That makes sense such that optimization can do its job, cutting parts in the most efficient order and per optimization rules.
22.2 machine pause at start of job only for rotary jobs
22.3 fixed machine pause logic during OnDrill(), entityLength nil

update Jan 26...
22.4 prologue and comment fixups
22.5 split and adjusted THC control and LdcSmallShape logic, and corrected entityLength use
23 removed LdcSmallShape option and logic, SC Path Rules 'on small shape' is predictable as ~entityLength/pi depending on toolpath offset
Attachments
GRBL plasma LDC w Rotary.scpost
version 23
(31.89 KiB) Downloaded 180 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

update to version 23.3

With the break in winter weather the past week I was finally able to bust out the garden hose and get some water in the plasma table :)
So I spent the day catching up on plasma projects and working over the scpost with some specific testing also. I found a few bugs in my code, so this version accumulates several fixes the past week. Unrelated, I've switched to using SC Dev version 7.1.35 exclusively now, I'm finding it very stable for my needs and pretty significantly improved over 7.0.21 ga release, including some new function.

Enjoy.
Attachments
GRBL plasma LDC w Rotary.scpost
version 23.3
(32.46 KiB) Downloaded 160 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

update version 23.6

23.4 various comment fixups and corrections.
23.5 another entityLength fix for OnDrill(), save state and set to 0
23.6 adjusted comment header block for file name and datestamp location

I've been getting a lot of table time in this past week, hence the occasional bug fix and fine tuning...
Attachments
GRBL plasma LDC w Rotary.scpost
v 23.6
(32.82 KiB) Downloaded 171 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
Ronniereboot
Posts: 1
Joined: Wed Feb 07, 2024 10:47 pm

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by Ronniereboot »

Hi BLouChip I want to start off by thanking you for all of the work you have done on all these versions of this post processor over the years. You are a real ambassador of what open source is. I can only hope and dream of being able to make a contribution of your caliber.

So I have looked through quite a few threads and found where you wrote that your post will work without the THC By either setting external post variable LdcThcZAntidive = 0. So I used the post editor in sheetcam and found that line in multiple places. At first just changed the one that had mention something about setting default. That did not solve the error code when trying a dry run. So I proceeded to then modify all the lines that contained LdcThcZAntidive=1 to =0. Again no luck same result. Then i really played around and sheetcam now say it can not run post. so my question before I go download the post processor again and start over with my shots in the dark would you by any chance know where I could find a post processor that does not have coding for a THC or would you be so kind as to walk me through disabling it with yours. I am usually able to figure these things out but this thing has got me stumped. Probably Because I dont know know $h*t about code.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

@Ronnie'- thank you for the kind words. I'm glad to help.
You are stumped only because I screwed up by picking stupid names for disabling THC code in the early versions of the scpost.
If you get this latest version (24) or the 23.6 version, you will find that I have renamed those external variables to hopefully more meaningful names and making it hopefully more obvious how to disable THC code. The new name is: LdcThcPresent = 1 (yes), 0 (no)
I made most options in the scpost external variables, so you don't need to edit the scpost to change them at runtime. Rather, set the external variable in one of two ways:
First way) menu Options->Application Options, Variables tab. Create a new variable by the name LdcThcPresent, linear type is fine, assign it 0 to indicated no THC is present on your machine.
Second way) create an Operation of type Variable (Set a post variable), pick LdcThcPresent from the dropdown list, and assign it 0. Put this Operation as the first one in your operations list.

Now, about this latest version 24... I just finished it yesterday, so testing that I've done is minimal and concentrated on the areas that I had been modifying; but you know how that goes, everything is affected by everything, so if you have trouble with it, please advise here or PM me, and use the 23.6 version in the meantime.

Here's what changed in Version 24...
23.8- added back SC global minArcSize in OnInit(), my mistake for removing it a few releases back.
* changed LdcThcEnable to OFF (0) as default, use Path Rule 'on start' instead
* added Warning msg if PH to CH plunge rate is too slow for desired pierce delay
* fixed wrong rotary max radius for rectangles in some cases
* improved some gcode comments and formatting for better readability
24- after discovering from Les the intricacies of qrySETYSTART() and qryCHKEND() (always use together with same Y),
and discovering that materialY1 (midpoint of corner) is NOT a good reference for rectangle
max rotational radius. Thus I'm using my own formula to calc max rotational radius, it matches exactly
with the value from CHKEND when the flattened Y drawing coord is on the apex of the rotated corner,
the point on which Z should be zeroed.
Attachments
GRBL plasma LDC w Rotary.scpost
version 24
(35.09 KiB) Downloaded 162 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by djreiswig »

An easier way to set custom variables is by using the options window. You can set defaults and then the user can modify them from the window.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

@dj- thanks for the tip, after looking it up I do recall seeing the DefineCustomOption() and ShowCustomOptions() functions a long while ago but didn't have the time to explore them until you reminded me. So I spent the past couple of hours exploring, and I find them interesting, certainly helpful, but also I'm getting some strange behavior. Perhaps I'm not understanding the exact intent of these functions or the exact correct implementation. Here's what I've discovered upon an implementation, which may not be completely correct, please review and advise.

if I put ShowCustomOptions() in the scpost prologue (before OnInit() ), which I understand is the post load time, and where the doc instructs to put it, then the custom options dialogue is run one time upon SC launch/startup, or when ever the Options->Machine is clicked, or when the scpost is selected in the Post tab, or when saved while editing. However, something strange here, the last values entered in the fields of the dialogue are the values used during post processing, AND even though at times the CustomOption() defaults are shown in the dialogue they are not used during processing. I don't know from where the stale last entered values are coming from.

If I put ShowCustonOptions() in OnInit(), then of course the dialogue pops up for every post run, but again the fields have the last entered values in them, not the defaults. I don't know where these values are being saved, they persist even across SC exit and re-launch. But the good news in, the values entered ARE the values use during post runtime. So this seems to be the correct implementation. I've also discovered that if I simply hit Esc key on the dialogue, then it closes, values changed or present in the fields are used, and that's a quick way to deal with what can be an otherwise annoying event over time.

And one more really odd behavior, if the ShowCustomOptions() stmt is commented out and not called, then those mysterious last entered field values are still used, really strange.

I'm using SC v 7.1.35.

please advise.
Attachments
GRBL plasma LDC w Rotary.scpost
v 24.2 w Custom Options in OnInit()
(37.27 KiB) Downloaded 161 times
Last edited by bLouChip on Fri Feb 09, 2024 1:04 pm, edited 1 time in total.
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by djreiswig »

The dialogue should just show up when you click the added button on the window where you select the post processor. I will have to look at my post and see how it's set up. I think the values are stored in the SheetCam settings file.
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

update v24.3

* 24.1 added scpost Custom Options and popup dialogue for the external variables. External variables can still
be used as in previous versions, but the values entered, if any, in the custom options dialogue will override.
* 24.2 LdcTorchProbeTime rename, fixup rotary debug code, and comment adjustments
* fixed bug in plunge PD and improved warning msg re plunge rate too slow, added units/min
* 24.3 added distance units to numbers in messages and posted comments.

At this time, the Custom Options dialogue pops up on every post processor run (I can't get it to work correctly otherwise), but it should retrieve and use the last values entered/used UNLESS you have external post variables defined for the same fields, the latter taking precedence. Of course the post variables defined in Operations will take effect during post runtime in the sequence that those "operations" take place.

Tip to quickly get past the Custom Options dialogue- if you like the values in the fields, just press Esc key on the keyboard.

Enjoy.
Attachments
GRBL plasma LDC w Rotary.scpost
v24.3
(37.95 KiB) Downloaded 146 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by djreiswig »

Try this. I also converted some of your options to checkboxes.
GRBL plasma LDC w Rotary.scpost
(38.32 KiB) Downloaded 156 times
User avatar
bLouChip
Posts: 124
Joined: Tue Nov 09, 2021 4:58 pm
Location: Raleigh, NC
Contact:

Re: GRBL Plasma w THC, Torch Touchoff, and Rotary

Post by bLouChip »

@jdreiswig-- Oh Baby! This is sweet! Thank you!

version 25
24.4 added minor improvement to gcode readability, comment separtor lines for OnNewEntity()
25 added @djreiswig ShowOptions() behavior fix, OnButton() and supporting code,
and unitBOOLEAN/checkbox data type for
external post variables: LdcThcPresent, LdcThcEnable, and LdcBenchTest.
WhooHoo!

After selecting this post processor in the Options->Machine->Post Processor window, click OK.
Then go back to this same window and you will see a new button under the post description,
"Set custom post options" button. Click it and you can set the external post variables here,
or you can still use the definition locations from earlier versions, described in the file prologue.
Attachments
GRBL plasma LDC w Rotary.scpost
version 25
(38 KiB) Downloaded 151 times
MillRight CNC MegaV XL XYZA Tri-CAM Mill/Plasma/Laser
grbl 1.1i, UGS, Win 11, LightBurn, SC, Aspire, and sometimes [con]Fusion360
my youtube channel
Post Reply