Image
To close this announcement click the X in the top right corner.
Industry Pros use FastCut CNC

UCCNC & MiniTHC Path Rules and Post

SheetCam related questions and tips can be posted here
Post Reply
Mr.Hotwire
1.5 Star Member
1.5 Star Member
Posts: 47
Joined: Mon Jun 07, 2021 10:49 am

UCCNC & MiniTHC Path Rules and Post

Post by Mr.Hotwire » Sat Jan 08, 2022 2:19 am

Good evening, or morning almost now...

I have been working on getting my setup ready to do some light production. So.. I have been trying to improve by using path rules and tweaking my post.

Attached is a copy of my post, it is edited to turn the ohmic sensor on and off before and after probing. This prevents false triggers from HF. Also attached is a copy of my path rule set. Id like to know what your opinions are and if there is anything I should add or change.

Post :

Code: Select all

--************************************************
--*** Set these values up to suit your machine ***
--************************************************

--this is the distance between each torch reference in MILLIMETRES
refDistance = 1

--this is the reference feed rate in mm/min
refFeed = 2540

--Put your switch offset value here in MILLIMETRES
switchOffset = 0

--Scriber X,Y,Z offsets in MILLIMETRES. Do not use inches here even if you want inch code
--Use the special code 'nil' on the Z axis to disable it.
--In that case no Z values will be output at all while scribing.
--e.g scriberZ = nil
scriberX = 110
scriberY = 220
scriberZ = 0

--scriber axis. Leave this as nil if the scriber is fixed to the same axis as the torch
--scriberAxis = "A"
scriberAxis = nil

--If this value is set to true then use G28 (home) for the Z reference
--Set it to false for G31 probe
refHome = true

--The cutter will slow down for corners and turn off THC below this radius
slowRadius = 10

--Minimum slow down speed.
--This is a scale factor. For instance 0.5 = 50% of the current feed rate
slowPercent = 0.4

--THC on and off codes. Use nil if you don't want THC control e.g:
-- thcOnCode = m205
-- thcOffCode = m206

--here is another example that use M667 and M666
--thcOnCode = " M205"
--thcOffCode = " M206"

thcOnCode = " M205 "
thcOffCode = " M206 "

--************************************************
--***           End of settings                ***
--************************************************



function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("UCCNC w/ MiniTHC Post\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M03/M05 turn the torch on/off\n")
   ctrl:AppendText("M08/M09 turn the engraver on/off\n")
   ctrl:AppendText("Incremental IJ - set in mach2\n")
   ctrl:AppendText("The torch is referenced at cut start and every 500mm of movement thereafter\n")
   ctrl:AppendText("Designed for use with UCCNC with MiniTHC and Floating head\n")
   ctrl:AppendText("Post variables:\n")
   ctrl:AppendText("refDistance - set the distance between each reference\n")
   ctrl:AppendText("refFeed - set the feed rate when referencing\n")
   ctrl:AppendText("switchOffset - set your net switch offset amount \n")
   ctrl:AppendText("Scriber uses any tool number\n")
   ctrl:AppendText("slowRadius - slow down below this radius\n")
   ctrl:AppendText("slowPercent - minimum percentage to slow down\n")
end



-- Created 1/1/06
-- Based on plasma1.post


-- Modified 21/6/2010
-- Added: option for 'nil' plate marker z
-- Added: support for plate marker tool type as well as tool number based plate marker

-- Modified 4/11/2010
-- Added: Reference the torch on the first pen down if the plate marker is the first tool used.

-- Modified 21/7/2021
-- Changed: G31 Feed rate from 50 to 350
-- Fixed: Spelling errors
-- Added: Further command commenting 
 
post.DefineVariable("refDistance",sc.unitLINEAR,0,1e17)
post.DefineVariable("refFeed",sc.unitFEED,0,1e17)
post.DefineVariable("switchOffset",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowRadius",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowPercent",sc.unitPERCENT,-1e17,1e17)

function OnInit()

   offX = 0
   offY = 0
   offZ = 0

   post.SetCommentChars ("()", "[]")  --make sure ( and ) characters do not appear in system text
   post.Text (" (Filename: ", fileName, ")\n")
   post.Text (" (Post processor: ", postName, ")\n")
   post.Text (" (Date: ", date, ")\n")
   if(scale == metric) then
      post.Text (" G21 (Units: Metric)\n") --metric mode
   else
      post.Text (" G20 (Units: Inches)\n") --inch mode
   end
   post.Text (" F1\n G53 G90 G40\n")
   minArcSize = 0.2 --arcs smaller than this are converted to moves
   firstRef = true
   currentZAxis = "Z"

   dist = 9999999
   lastz = 0
   thcstate = 1
   ThcOff()
end

function OnNewLine()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
end


function OnFinish()
   endZ = safeZ
   OnRapid()
   endX = 0
   endY = 0
   offX = 0
   offY = 0
   offZ = 0
   OnRapid()
   post.Text (" M05 M30\n")
end

function OnRapid()
   if(endX > 1e17 and endY > 1e17) then return end
   local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
   dist = dist + len
   post.ModalText (" G00")
   post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
   post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
   if(offZ and firstRef == false and currentZ ~= safeZ) then
      post.ModalNumber (" " .. currentZAxis, (endZ + offZ) * scale, "0.0000")
   end
   post.Eol()
end

function OnMove()
   local len = math.hypot(endX - currentX , endY - currentY)
   dist = dist + len
   if(len > slowRadius) then
      ThcOn()
   end
   post.ModalText (" G01")
   post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
   post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
   if(offZ) then
      post.ModalNumber (" " .. currentZAxis, (endZ + offZ) * scale, "0.0000")
   end
   post.ModalNumber (" F", feedRate * scale, "0.0###")
   post.Eol()
end

function OnArc()
   local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY)
   dist = dist + radius * math.abs(arcAngle)

   if (radius < slowRadius) and (math.abs(arcAngle) > 0.5) then
      feed = (radius / slowRadius)
      if(feed < slowPercent) then
         feed = slowPercent
      end
      feed = feed * feedRate
      ThcOff()
   else
      feed = feedRate
      ThcOn()
   end
   if(arcAngle <0) then
      post.ModalText (" G03")
   else
      post.ModalText (" G02")
   end
   post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
   post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
   if(offZ) then
      post.ModalNumber (" " .. currentZAxis, (endZ + offZ) * scale, "0.0000")
   end
   post.Text (" I")
   post.Number ((arcCentreX - currentX) * scale, "0.0000")
   post.Text (" J")
   post.Number ((arcCentreY - currentY) * scale, "0.0000")
   post.ModalNumber (" F", feed * scale, "0.0###")
   post.Eol()
end


function ThcOff()
   if(not thcOffCode) then return end
   if(thcstate ==1) then
      thcstate = 0
      post.Text(thcOffCode)
      post.Text(" (THC off)\n");
   end
end

function ThcOn()
   if(not thcOnCode) then return end
   if(toolClass == "MarkerTool") or tool > 99 then return end
   if(thcstate ==0) then
      thcstate = 1
      post.Text(thcOnCode)
      post.Text(" (THC on)\n");
      return
   end
   if(thcstate == 2) then
      thcstate = 0
   end
end


function OnPenDown()
   if(toolClass == "MarkerTool") or tool > 99 then
      if (firstRef) then
         Reference()
         post.ModalText (" G00")
         post.Text(" Z")
         post.Number (safeZ  * scale, "0.0000")
         post.Eol()
         offX = scriberX
         offY = scriberY
         offZ = scriberZ
         post.ModalNumber (" X", (currentX + offX) * scale, "0.0000")
         post.ModalNumber (" Y", (currentY + offY) * scale, "0.0000")
         post.Eol()
      end
      if (offZ) then
         post.ModalNumber (" " .. currentZAxis, (currentZ + offZ)  * scale, "0.0000")
         post.Eol()
      end
      post.Text(" M08 9(spindle on)\n")
   else
      if(dist >= refDistance) then
         dist = 0
         Reference();
      end
      post.ModalText (" G00")
      post.Text(" Z")
      post.Number (pierceHeight  * scale, "0.0000")
      post.Eol()
      if (preheat > 0) then
         post.Text ("\n G04 P")
         post.Number (preheat,"0.###")
         post.Eol()
      end
      post.Text ("\n M213\n M10.2 M03 (Ohmic Off / Torch on)\n")
   end
   if (pierceDelay > 0) then
      post.Text (" G04 P")
      post.Number (pierceDelay,"0.###")
      post.Eol()
   end
--   thcstate = 2 --leave THC off for plunge move
end


function Reference()
   firstRef = false
   if (refHome) then
        post.Text (" M10.1 G31 F350 Z-50 (Ohmic On)\n")
     -- post.ModalText(" G28.1 Z")
     -- post.Number(3 * scale, "0.00")
   else
      post.ModalText(" G31 Z -100")
   end
  -- post.ModalNumber (" F", refFeed * scale, "0.0###")
   --post.Eol()
   post.ModalText(" G92 Z0.0\n")
   post.ModalText (" G00")
   post.Text(" Z")
   post.Number (switchOffset * scale, "0.0000")
   post.Eol()
   post.ModalText(" G92 Z0.0\n")
end

function OnPenUp()
   if(tool > 99) then
      post.Text(" M09\n")
   else
      post.Text (" M214\n M05 (Torch off)\n")
   end
   if (endDelay > 0) then
      post.Text (" G04 P")
      post.Number (endDelay,"0.###")
      post.Eol()
   end
end


function OnNewOperation()
   post.Text (" (Operation: ", operationName, ")\n")
end

function OnToolChange()
    if (toolClass == "MarkerTool"  or tool > 99 ) then
         ThcOff()
         if(scriberAxis and scriberAxis ~= currentZAxis) then
            endZ = safeZ
            OnRapid()
            currentZAxis = scriberAxis
         end
         if(firstRef ~= true) then
            offX = scriberX
            offY = scriberY
            offZ = scriberZ
         end
    else
         if(scriberAxis and scriberAxis == currentZAxis) then
            endZ = safeZ
            OnRapid()
            currentZAxis = "Z"
         end
         offX = 0
         offY = 0
         offZ = 0
    end
end

function OnNewPart()
   post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
   OnRapid()
   currentX = endX
   currentY = endY
   OnPenDown()
   endZ = drillZ
   OnMove()
   OnPenUp()
   endZ = safeZ
   OnRapid()
end


function OnComment()
  post.Text(" (",commentText,")\n")
end
Path Rules :
path rules.PNG
Thank you for any and all comments or suggestions in advance.

You do not have access to view or download this file.
Become a Contributing Member to gain access to this feature. Click Here


User avatar
acourtjester
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 6202
Joined: Sat Jun 02, 2012 6:04 pm
Location: Pensacola, Fla

Re: UCCNC & MiniTHC Path Rules and Post

Post by acourtjester » Sat Jan 08, 2022 11:30 am

Not an expert again, I think the "path rules" are active during the cutting operation. And what you want to do is at the start of the operation, I think your changes to the post in the "function OnPenDown" is the right location. You may need to also have the macros spelled out in another place, like "code Snippets" I would send off an email to Les at SheetCam to get clarification, or directions on how to do it.
You can look at the G-code to see where or if the M command is in there, I think it should be before the M3 to fire the torch.
DIY 4X4 Plasma/Router Table
Hypertherm PM65 Machine Torch
Drag Knife and Scribe
Miller Mig welder
13" metal lathe
Small Mill
Everlast PowerTig 255 EXT

robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1566
Joined: Mon Jun 12, 2017 6:43 pm

Re: UCCNC & MiniTHC Path Rules and Post

Post by robertspark » Sat Jan 08, 2022 2:25 pm

your M10.x codes are fine, they are synchronous m-codes in uccnc and they do not require motion such as M10/M11 does.

you can do other things with the post processor and c-aixs protocol to send the voltage setpoint to the miniTHC.

your path rules look fine too, but I normally tweak those once you've been cutting for a while to improve / change things.

get the machine cutting first and then add the bells, and whistles / go faster stripes to improve things for you and your machine.

below is my miniTHC post processor that I used with UCCNC and the miniTHC. Please note, I no longer use the miniTHC or UCCNC for plasma cutting and have not used it for a while.

if you have a look through it it will show you the c-axis protocol and allow you to send your voltage to the minithc (you will have to set up the c-axis in uccnc).

it also has a the sheetcam rotary axis in the post processor as I use it for tube cutting occassionally (not used it for a while).

Code: Select all

--************************************************
--*** Set these values up to suit your machine ***
--************************************************


--this is the distance between each torch reference in MILLIMETRES
--set it to -1 if you never want to reference
refDistance = 0

--this is the reference feed rate in mm/min
refFeed = 1200 -- 20mm/sec

--Put your switch offset value here in MILLIMETRES
switchOffset = 0.6

--Marker X,Y,Z offsets in MILLIMETRES. Do not use inches here even if you want inch code
--Use the special code 'nil' on the Z axis to disable it.
--In that case no Z values will be output at all while scribing.
--e.g markerZ = nil
markerX = 10
markerY = 20
markerZ = 0

--marker axis. Leave this as nil if the marker is fixed to the same axis as the torch
--markerAxis = "A"
markerAxis = nil

--If this value is set to true then use G28 (home) for the Z reference
--Set it to false for G31 probe
refHome = false 

--The cutter will slow down for corners and turn off THC below this radius
slowRadius = 25

--Minimum slow down speed.
--This is a scale factor. For instance 0.5 = 50% of the current feed rate
slowPercent = 0.6 -- 60% speed for corners

--THC on and off codes. Use nil if you don't want THC control e.g:
-- thcOnCode = nil
-- thcOffCode = nil

thcOnCode = " M205 (THC On)" -- THC On
thcOffCode = " M206 (THC Off)" -- THC Off

thcLock = " M211 (THC Down Lock)" -- THC Lock for corners / small radi
thcUnLock = " M212 (THC Down UnLock)" -- THC Un Lock


--Torch on code
torchOn = " M03 M10 (Torch ON)"
--Torch off code
torchOff = " M05 M11 M206 (Torch OFF)"
--torchOff = " M11 (torch OFF)"

--Marker DOWN code
markerDn = " M7" -- setup to output for pneumatic relay DOWN
--Marker UP code
markerUp = " M8" -- setup to output for pneumatic relay UP
--Marker off code
markerOff = " M9" -- setup to output for pneumatic relays Off


--rotary axis. Normally this would be "A"
rotaryAxis = "A"

--Number of units for one full revolution of the rotary axis
--Note: In Mach3 the axis should be defined as linear, not rotary!
unitsPerRev=12000



--************************************************
--***           End of settings                ***
--************************************************


function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("\n")
   ctrl:AppendText("NON Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M10/M11 turn the torch on/off\n")
   ctrl:AppendText("M08/M09 turn the engraver on/off\n")
   ctrl:AppendText("M205/M206 turn the THC on/off\n")
   ctrl:AppendText("Incremental IJ - set in UCCNC\n")
   ctrl:AppendText("The torch is referenced at EVERY cut start\n")
   ctrl:AppendText("Designed for use with UCCNC, MiniTHC and Floating + Ohmic head  & scriber\n")
   ctrl:AppendText("Post variables:\n")
   ctrl:AppendText("refDistance - set the distance between each reference\n")
   ctrl:AppendText("refFeed - set the feed rate when referencing\n")
   ctrl:AppendText("switchOffset - set your net switch offset amount \n")
   ctrl:AppendText("Marker uses any tool number\n")
   ctrl:AppendText("slowRadius - slow down below this radius\n")
   ctrl:AppendText("slowPercent - minimum percentage to slow down\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("With 4th Axis PlasmaRotary plugin\n")
end

--   created 1/1/06
--   Based on plasma1.post


--  Modified 21/6/2010
--  added option for 'nil' plate marker z
--  Added support for plate marker tool type as well as tool number based plate marker

-- Modified 4/11/2010
-- Added: Reference the torch on the first pen down if the plate marker is the first tool used.

post.DefineVariable("refDistance",sc.unitLINEAR,-1,1e17)
post.DefineVariable("refFeed",sc.unitFEED,0,1e17)
post.DefineVariable("switchOffset",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowRadius",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowPercent",sc.unitPERCENT,-1e17,1e17)
-- ADD IN Custom Voltage a MiniTHC Delay settings.
post.DefineCustomToolParam("PlasmaTool", "MiniTHC volts", "MiniTHCVolts", sc.unit0DECPLACE, 130, 0, 200)
post.DefineCustomToolParam("PlasmaTool", "MiniTHC delay -hundreths sec", "MiniTHCDelay", sc.unit0DECPLACE, 1, 1, 20)
post.DefineCustomToolParam("PlasmaTool", "Min Cut Length for THC", "minLength", sc.unit1DECPLACE, 1, .0, 6)
post.DefineCustomToolParam("PlasmaTool", "Soft Pierce Percent", "softPierce", sc.unit0DECPLACE, 0, 0, 100)
post.DefineCustomToolParam("DrillOperation", "Peck Delay", "peckPierce", sc.unit0DECPLACE, 300, 0, 2000)
post.DefineCustomToolParam("DrillOperation", "Peck Height", "peckHeight", sc.unit1DECPLACE, 3.8, 0.5, 5)
post.DefineCustomToolParam("DrillOperation", "Soft Mark Percent", "softPeck", sc.unit0DECPLACE, 50, 10, 100)
post.DefineCustomToolParam("JetOperation", "THC ON/ OFF (1/0)", "thcOff", sc.unit0DECPLACE, 1, 0, 1)


function OnInit()

   offX = 0
   offY = 0
   offZ = 0

   post.SetCommentChars ("()", "[]")  --make sure ( and ) characters do not appear in system text
   post.Text (" (Filename: ", fileName, ")\n")
   post.Text (" (Post processor: ", postName, ")\n")
   post.Text (" (Date: ", date, ")\n")
   if(scale == metric) then
      post.Text (" G21 (Units: Metric)\n") --metric mode
   else
      post.Text (" G20 (Units: Inches)\n") --inch mode
   end
   post.Text (" G53 G90 G91.1 G40\n")
   post.Text (" G92 X0 Y0 Z0\n")
   minArcSize = 0.05 --arcs smaller than this are converted to moves
   firstRef = true
   currentZAxis = " Z"
   
    if(MiniTHCVolts) then 
--don't do anything   
   else
     MiniTHCVolts = 0 --don't pass a null
end

if(MiniTHCDelay) then 
--don't do anything   
   else
     MiniTHCDelay = 0 --don't pass a null
end

if(thcOff) then 
--don't do anything   
   else
     thcOff = 0 --don't pass a null
end

   dist = 9999999
   lastz = 0
   thcstate = 0
   ThcOff() --sets THC off at beginning
end

function OnNewLine()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
end

function OnFinish()
   endZ = safeZ
   OnRapid()
   endX = 0
   endY = 0
   endA = 0
   offX = 0
   offY = 0
   offZ = 0
   OnRapid()
   post.Text (" M30\n")
end

function OnRapid()
	if (endZ == pierceHeight) then return end
   local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
	dist = dist + len
   
	post.Text (" G0")
	post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
	post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
   post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
   post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
	post.Eol()
end

function OnMove()
	--if(toolClass ~= "MarkerTool" and endZ < currentZ and endZ == cutHeight and softPierce == 0) then --this is a Z move on plasma plunge
	--	ThcLock()
	--	post.ModalText (" G00)
	--	post.ModalNumber (" Z", endZ * scale, "0.0000")
	--	post.Text ("( Pierce Plunge )")
	--	post.Eol()
   
	--end
	--if(toolClass ~= "MarkerTool" and endZ < currentZ and endZ == cutHeight and softPierce > 0) then --this is a Z move on SOFT plasma plunge
	--	ThcLock()
	--	post.ModalText (" G01")
	--	post.ModalNumber (" Z", endZ * scale, "0.0000")
	--	piercePlunge = 1
	--	piercePlunge = (softPierce / 100)
	--	feedRate2 = (feedRate * piercePlunge) -- lower the feedrate for soft pierce
	--	post.ModalNumber (" F", feedRate2 * scale, "0.0###")
	--	post.Text ("( Soft Pierce Plunge )")
	--	post.Eol()
   
	--end
	--	if(toolClass ~= "MarkerTool" and endZ > currentZ) then return end
   -- if(toolClass ~= "MarkerTool" and endZ == currentZ) then return end
		local len = math.hypot((endX + offX) - currentX , (endY + offY) - currentY)
		dist = dist + len
      
      minTHCdist = feedRate / 180 -- 0.333 second of motion
      
		if (minTHCdist < len) then
         ThcLockOn()
      else
         ThcLockOff()
      end
      
		post.Text (" G1")
		post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
		post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
      post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
      post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
		post.ModalNumber (" F", feedRate * scale, "0.0###")
		post.Eol()
end

function OnArc()
	if (endX == CurrentX and endY == CurrentY) then return end
   if(endX < materialX1 and endY < materialX1) or (endX > materialX2 and endY > materialX2) then return end
	local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY)
   len = radius * math.abs(arcAngle)
	dist = dist + len



   if (radius < slowRadius) then
      feed = slowPercent * feedRate
      ThcLockOn()
	else
      feed = feedRate
   
      minTHCdist = feed / 180 -- 0.333 second of motion
    
      if (minTHCdist > len) then
         ThcLockOff()
      else
         ThcLockOn()
      end
	end
	
   if(arcAngle < 0) then
      post.Text (" G3")
   else
      post.Text (" G2")
   end
   post.NonModalNumber (" X", (endX + offX) * scale, "0.0000")
   post.NonModalNumber (" Y", (endY + offY) * scale, "0.0000")
   post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
   post.Text (" I")
   post.Number (((arcCentreX + offX) - currentX) * scale, "0.0000")
   post.Text (" J")
   post.Number (((arcCentreY + offY) - currentY) * scale, "0.0000")
   post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
   post.NonModalNumber (" F", feed * scale, "0.0###")
   post.Eol()
end

function ThcOff()
   if(not thcOffCode) then return end -- ThcOffCode = nil (i.e. don't use THC)
   if(thcstate == 1) then
      thcstate = 0      
      post.Text(thcOffCode)
      post.Text(" (THC off)\n")
   end
end

function ThcOn()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcOff == 0) then return end -- THC not required by operation
   if(toolClass == "MarkerTool") or (toolClass == "DrillTool") then return end
   if(thcstate == 0) then
      thcLockstate = 0
      thcstate = 1
      post.Text(thcOnCode)
      post.Text(" (THC on)\n")
      return
   end
end

function ThcLockOn()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcstate == 0) then return end -- THC not required by operation
   if(thcLockstate == 0) then
      thcLockstate = 1
      post.Text(thcLock)
      post.Text(" (THC Lock)\n")
      return
   end
end

function ThcLockOff()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcstate == 0) then return end -- THC not required by operation
   if(thcLockstate == 1) then
      thcLockstate = 0
      post.Text(thcUnLock)
      post.Text(" (THC UnLock)\n")
      return
   end
end

function OnPenDown()
    if(toolClass == "MarkerTool") or (toolClass == "DrillTool") then
		if (toolClass == "DrillTool") then
			Reference()
			offZ = (peckHeight)
			post.Text (" G0 ")
			post.Text (" Z", offZ * scale, "0.0000")
			post.Eol()
         post.Text ("\n" .. torchOn .. "\n")
			post.Text (" G4 P", peckPierce, "\n")
         end
       if (toolClass == "MarkerTool") then
         offX = scriberX
         offY = scriberY
         post.NonModalNumber (" X", (currentX + offX) * scale, "0.0000")
			post.NonModalNumber (" Y", (currentY + offY) * scale, "0.0000")
			post.Eol()
			post.Text(markerDn .. "\n")
   		end
   else
      if(dist >= refDistance and refDistance >=0) then
         dist = 0
         Reference();
         post.ModalText (" G0")
         post.NonModalNumber (currentZAxis, (pierceHeight)  * scale, "0.0000")
         post.Eol()
      end
	   post.Text (" G4 P1500 \n")
      ThcOn()
      post.Text ("\n" .. torchOn .. "\n")
   
		if (pierceDelay > 0) then
			post.Text (" G4 P")
			post.Number (pierceDelay * 100,"0.###")
			post.Eol()
		end
		
		
	end

end

function Reference()
   firstRef = false
   if(refDistance < 0) then return end
   -- touch Off Macro (ohmic offset 0.1mm, 1.4mm switch offset)
   	post.ModalText(" M1031 (TouchOff)\n")
   --
  end

function OnPenUp()
	if(toolClass == "MarkerTool") then
		post.Text(markerOff .. "(Marker Off)\n")
		post.Text(markerUp .. "(Marker Up) \n")
		post.Text(markerOff .. " (Marker Off) \n")
	else
		ThcOff()
      post.Text (torchOff .. "\n")
   end
end

function OnToolChange()
	if (toolClass == "DrillTool" ) then
		post.Text (" (tool number: ", tool ," ")
		post.Text (" Plasma peck drill)")
		post.Eol()
	else
		post.Text (" (tool number: ", tool ," ")
		post.Text (" Distance between Touch-offs: " , refDistance * scale, " ")
		post.Text (" Feedrate: ", feedRate * scale , ") \n")
      post.Text (" (ToolName: ", toolName , ") \n")
	end	
	if (toolClass == "PlasmaTool") then
		if(thcOff == 0) then
			post.Text (" (THC DISABLED for this tool)\n")
			ThcOff()
		else
       post.Text (" (THC ENABLED for this tool)\n")   
		MiniTHCSetting() 
		ThcOn()
		end
	end
	if (toolClass == "MarkerTool"  or tool > 99 ) then
         ThcOff()
         if(markerAxis and markerAxis ~= currentZAxis) then
            endZ = safeZ
            post.ModalText(" G0")
            post.ModalNumber (currentZAxis, (endZ + offZ) * scale, "0.0000")
            post.Eol()
            currentZAxis = " " .. markerAxis
         end
         if(firstRef ~= true) then
            offX = markerX
            offY = markerY
            offZ = markerZ
         end
   else
         if(markerAxis and markerAxis == currentZAxis) then
            endZ = safeZ
            OnRapid()
            currentZAxis = " Z"
         end
         offX = 0
         offY = 0
         offZ = 0
	end
end

function OnNewPart()
   post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
	OnRapid()
	ThcOff()
	OnPenDown()
	OnPenUp()
	endZ = safeZ
	OnRapid()
end

function MiniTHCSetting()
	if(MiniTHCVolts > 0 and MiniTHCDelay > 0 ) then
         post.Text ( " G92 C0  \n" )         
         post.Text ( " G0 C8   \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )
         post.Text ( " G0 C",MiniTHCVolts," (MiniTHC Voltage Setpoint) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )   
         post.Text ( " G0 C",MiniTHCDelay," (MiniTHC Delay, hundreths of a sec) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n")
         post.Text ( " G0 C5   \n" )
         post.Text ( " G92 C0  \n" )
	elseif(MiniTHCVolts > 0 and MiniTHCDelay == 0 ) then
         post.Text ( " G92 C0  \n" )         
         post.Text ( " G0 C9   \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )
         post.Text ( " G0 C",MiniTHCVolts," (MiniTHC Voltage Setpoint) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )   
         post.Text ( " G0 C5   \n" )
         post.Text ( " G92 C0  \n" )
	else
         post.Text ("(No THC Voltage / Delay Set, using previous settings) \n")
	end
end

package.path = sc.Globals:Get().thisDir .. "/plugins/RotaryPlasma/?.lua"
require("rotaryhelper")


User avatar
djreiswig
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1441
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: UCCNC & MiniTHC Path Rules and Post

Post by djreiswig » Sat Jan 08, 2022 9:30 pm

Do you use the same post for rotary and flat cutting? I hope to eventually finish my rotary, but I use a modified post for sheet and didn't know what all needed to be different to do rotary. It would be cool to use one post for everything.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1566
Joined: Mon Jun 12, 2017 6:43 pm

Re: UCCNC & MiniTHC Path Rules and Post

Post by robertspark » Sun Jan 09, 2022 2:29 am

I did (I don't use uccnc any more).

Mr.Hotwire
1.5 Star Member
1.5 Star Member
Posts: 47
Joined: Mon Jun 07, 2021 10:49 am

Re: UCCNC & MiniTHC Path Rules and Post

Post by Mr.Hotwire » Sun Jan 09, 2022 2:55 pm

robertspark wrote:
Sat Jan 08, 2022 2:25 pm
your M10.x codes are fine, they are synchronous m-codes in uccnc and they do not require motion such as M10/M11 does.

you can do other things with the post processor and c-aixs protocol to send the voltage setpoint to the miniTHC.

your path rules look fine too, but I normally tweak those once you've been cutting for a while to improve / change things.

get the machine cutting first and then add the bells, and whistles / go faster stripes to improve things for you and your machine.

below is my miniTHC post processor that I used with UCCNC and the miniTHC. Please note, I no longer use the miniTHC or UCCNC for plasma cutting and have not used it for a while.

if you have a look through it it will show you the c-axis protocol and allow you to send your voltage to the minithc (you will have to set up the c-axis in uccnc).

it also has a the sheetcam rotary axis in the post processor as I use it for tube cutting occassionally (not used it for a while).

Code: Select all

--************************************************
--*** Set these values up to suit your machine ***
--************************************************


--this is the distance between each torch reference in MILLIMETRES
--set it to -1 if you never want to reference
refDistance = 0

--this is the reference feed rate in mm/min
refFeed = 1200 -- 20mm/sec

--Put your switch offset value here in MILLIMETRES
switchOffset = 0.6

--Marker X,Y,Z offsets in MILLIMETRES. Do not use inches here even if you want inch code
--Use the special code 'nil' on the Z axis to disable it.
--In that case no Z values will be output at all while scribing.
--e.g markerZ = nil
markerX = 10
markerY = 20
markerZ = 0

--marker axis. Leave this as nil if the marker is fixed to the same axis as the torch
--markerAxis = "A"
markerAxis = nil

--If this value is set to true then use G28 (home) for the Z reference
--Set it to false for G31 probe
refHome = false 

--The cutter will slow down for corners and turn off THC below this radius
slowRadius = 25

--Minimum slow down speed.
--This is a scale factor. For instance 0.5 = 50% of the current feed rate
slowPercent = 0.6 -- 60% speed for corners

--THC on and off codes. Use nil if you don't want THC control e.g:
-- thcOnCode = nil
-- thcOffCode = nil

thcOnCode = " M205 (THC On)" -- THC On
thcOffCode = " M206 (THC Off)" -- THC Off

thcLock = " M211 (THC Down Lock)" -- THC Lock for corners / small radi
thcUnLock = " M212 (THC Down UnLock)" -- THC Un Lock


--Torch on code
torchOn = " M03 M10 (Torch ON)"
--Torch off code
torchOff = " M05 M11 M206 (Torch OFF)"
--torchOff = " M11 (torch OFF)"

--Marker DOWN code
markerDn = " M7" -- setup to output for pneumatic relay DOWN
--Marker UP code
markerUp = " M8" -- setup to output for pneumatic relay UP
--Marker off code
markerOff = " M9" -- setup to output for pneumatic relays Off


--rotary axis. Normally this would be "A"
rotaryAxis = "A"

--Number of units for one full revolution of the rotary axis
--Note: In Mach3 the axis should be defined as linear, not rotary!
unitsPerRev=12000



--************************************************
--***           End of settings                ***
--************************************************


function OnAbout(event)
   ctrl = event:GetTextCtrl()
   ctrl:AppendText("\n")
   ctrl:AppendText("NON Modal G-codes and coordinates\n")
   ctrl:AppendText("Comments enclosed with ( and )\n")
   ctrl:AppendText("M10/M11 turn the torch on/off\n")
   ctrl:AppendText("M08/M09 turn the engraver on/off\n")
   ctrl:AppendText("M205/M206 turn the THC on/off\n")
   ctrl:AppendText("Incremental IJ - set in UCCNC\n")
   ctrl:AppendText("The torch is referenced at EVERY cut start\n")
   ctrl:AppendText("Designed for use with UCCNC, MiniTHC and Floating + Ohmic head  & scriber\n")
   ctrl:AppendText("Post variables:\n")
   ctrl:AppendText("refDistance - set the distance between each reference\n")
   ctrl:AppendText("refFeed - set the feed rate when referencing\n")
   ctrl:AppendText("switchOffset - set your net switch offset amount \n")
   ctrl:AppendText("Marker uses any tool number\n")
   ctrl:AppendText("slowRadius - slow down below this radius\n")
   ctrl:AppendText("slowPercent - minimum percentage to slow down\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("\n")
   ctrl:AppendText("With 4th Axis PlasmaRotary plugin\n")
end

--   created 1/1/06
--   Based on plasma1.post


--  Modified 21/6/2010
--  added option for 'nil' plate marker z
--  Added support for plate marker tool type as well as tool number based plate marker

-- Modified 4/11/2010
-- Added: Reference the torch on the first pen down if the plate marker is the first tool used.

post.DefineVariable("refDistance",sc.unitLINEAR,-1,1e17)
post.DefineVariable("refFeed",sc.unitFEED,0,1e17)
post.DefineVariable("switchOffset",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowRadius",sc.unitLINEAR,-1e17,1e17)
post.DefineVariable("slowPercent",sc.unitPERCENT,-1e17,1e17)
-- ADD IN Custom Voltage a MiniTHC Delay settings.
post.DefineCustomToolParam("PlasmaTool", "MiniTHC volts", "MiniTHCVolts", sc.unit0DECPLACE, 130, 0, 200)
post.DefineCustomToolParam("PlasmaTool", "MiniTHC delay -hundreths sec", "MiniTHCDelay", sc.unit0DECPLACE, 1, 1, 20)
post.DefineCustomToolParam("PlasmaTool", "Min Cut Length for THC", "minLength", sc.unit1DECPLACE, 1, .0, 6)
post.DefineCustomToolParam("PlasmaTool", "Soft Pierce Percent", "softPierce", sc.unit0DECPLACE, 0, 0, 100)
post.DefineCustomToolParam("DrillOperation", "Peck Delay", "peckPierce", sc.unit0DECPLACE, 300, 0, 2000)
post.DefineCustomToolParam("DrillOperation", "Peck Height", "peckHeight", sc.unit1DECPLACE, 3.8, 0.5, 5)
post.DefineCustomToolParam("DrillOperation", "Soft Mark Percent", "softPeck", sc.unit0DECPLACE, 50, 10, 100)
post.DefineCustomToolParam("JetOperation", "THC ON/ OFF (1/0)", "thcOff", sc.unit0DECPLACE, 1, 0, 1)


function OnInit()

   offX = 0
   offY = 0
   offZ = 0

   post.SetCommentChars ("()", "[]")  --make sure ( and ) characters do not appear in system text
   post.Text (" (Filename: ", fileName, ")\n")
   post.Text (" (Post processor: ", postName, ")\n")
   post.Text (" (Date: ", date, ")\n")
   if(scale == metric) then
      post.Text (" G21 (Units: Metric)\n") --metric mode
   else
      post.Text (" G20 (Units: Inches)\n") --inch mode
   end
   post.Text (" G53 G90 G91.1 G40\n")
   post.Text (" G92 X0 Y0 Z0\n")
   minArcSize = 0.05 --arcs smaller than this are converted to moves
   firstRef = true
   currentZAxis = " Z"
   
    if(MiniTHCVolts) then 
--don't do anything   
   else
     MiniTHCVolts = 0 --don't pass a null
end

if(MiniTHCDelay) then 
--don't do anything   
   else
     MiniTHCDelay = 0 --don't pass a null
end

if(thcOff) then 
--don't do anything   
   else
     thcOff = 0 --don't pass a null
end

   dist = 9999999
   lastz = 0
   thcstate = 0
   ThcOff() --sets THC off at beginning
end

function OnNewLine()
   post.Text ("N")
   post.Number (lineNumber, "0000")
   lineNumber = lineNumber + 10
end

function OnFinish()
   endZ = safeZ
   OnRapid()
   endX = 0
   endY = 0
   endA = 0
   offX = 0
   offY = 0
   offZ = 0
   OnRapid()
   post.Text (" M30\n")
end

function OnRapid()
	if (endZ == pierceHeight) then return end
   local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
	dist = dist + len
   
	post.Text (" G0")
	post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
	post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
   post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
   post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
	post.Eol()
end

function OnMove()
	--if(toolClass ~= "MarkerTool" and endZ < currentZ and endZ == cutHeight and softPierce == 0) then --this is a Z move on plasma plunge
	--	ThcLock()
	--	post.ModalText (" G00)
	--	post.ModalNumber (" Z", endZ * scale, "0.0000")
	--	post.Text ("( Pierce Plunge )")
	--	post.Eol()
   
	--end
	--if(toolClass ~= "MarkerTool" and endZ < currentZ and endZ == cutHeight and softPierce > 0) then --this is a Z move on SOFT plasma plunge
	--	ThcLock()
	--	post.ModalText (" G01")
	--	post.ModalNumber (" Z", endZ * scale, "0.0000")
	--	piercePlunge = 1
	--	piercePlunge = (softPierce / 100)
	--	feedRate2 = (feedRate * piercePlunge) -- lower the feedrate for soft pierce
	--	post.ModalNumber (" F", feedRate2 * scale, "0.0###")
	--	post.Text ("( Soft Pierce Plunge )")
	--	post.Eol()
   
	--end
	--	if(toolClass ~= "MarkerTool" and endZ > currentZ) then return end
   -- if(toolClass ~= "MarkerTool" and endZ == currentZ) then return end
		local len = math.hypot((endX + offX) - currentX , (endY + offY) - currentY)
		dist = dist + len
      
      minTHCdist = feedRate / 180 -- 0.333 second of motion
      
		if (minTHCdist < len) then
         ThcLockOn()
      else
         ThcLockOff()
      end
      
		post.Text (" G1")
		post.ModalNumber (" X", (endX + offX) * scale, "0.0000")
		post.ModalNumber (" Y", (endY + offY) * scale, "0.0000")
      post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
      post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
		post.ModalNumber (" F", feedRate * scale, "0.0###")
		post.Eol()
end

function OnArc()
	if (endX == CurrentX and endY == CurrentY) then return end
   if(endX < materialX1 and endY < materialX1) or (endX > materialX2 and endY > materialX2) then return end
	local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY)
   len = radius * math.abs(arcAngle)
	dist = dist + len



   if (radius < slowRadius) then
      feed = slowPercent * feedRate
      ThcLockOn()
	else
      feed = feedRate
   
      minTHCdist = feed / 180 -- 0.333 second of motion
    
      if (minTHCdist > len) then
         ThcLockOff()
      else
         ThcLockOn()
      end
	end
	
   if(arcAngle < 0) then
      post.Text (" G3")
   else
      post.Text (" G2")
   end
   post.NonModalNumber (" X", (endX + offX) * scale, "0.0000")
   post.NonModalNumber (" Y", (endY + offY) * scale, "0.0000")
   post.ModalNumber (" Z", (endZ + offZ) * scale, "0.0000")
   post.Text (" I")
   post.Number (((arcCentreX + offX) - currentX) * scale, "0.0000")
   post.Text (" J")
   post.Number (((arcCentreY + offY) - currentY) * scale, "0.0000")
   post.ModalNumber (" " .. rotaryAxis, endA, "0.0000")
   post.NonModalNumber (" F", feed * scale, "0.0###")
   post.Eol()
end

function ThcOff()
   if(not thcOffCode) then return end -- ThcOffCode = nil (i.e. don't use THC)
   if(thcstate == 1) then
      thcstate = 0      
      post.Text(thcOffCode)
      post.Text(" (THC off)\n")
   end
end

function ThcOn()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcOff == 0) then return end -- THC not required by operation
   if(toolClass == "MarkerTool") or (toolClass == "DrillTool") then return end
   if(thcstate == 0) then
      thcLockstate = 0
      thcstate = 1
      post.Text(thcOnCode)
      post.Text(" (THC on)\n")
      return
   end
end

function ThcLockOn()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcstate == 0) then return end -- THC not required by operation
   if(thcLockstate == 0) then
      thcLockstate = 1
      post.Text(thcLock)
      post.Text(" (THC Lock)\n")
      return
   end
end

function ThcLockOff()
   if(not thcOnCode) then return end -- ThcOnCode = nil (i.e. don't use THC)
   if(thcstate == 0) then return end -- THC not required by operation
   if(thcLockstate == 1) then
      thcLockstate = 0
      post.Text(thcUnLock)
      post.Text(" (THC UnLock)\n")
      return
   end
end

function OnPenDown()
    if(toolClass == "MarkerTool") or (toolClass == "DrillTool") then
		if (toolClass == "DrillTool") then
			Reference()
			offZ = (peckHeight)
			post.Text (" G0 ")
			post.Text (" Z", offZ * scale, "0.0000")
			post.Eol()
         post.Text ("\n" .. torchOn .. "\n")
			post.Text (" G4 P", peckPierce, "\n")
         end
       if (toolClass == "MarkerTool") then
         offX = scriberX
         offY = scriberY
         post.NonModalNumber (" X", (currentX + offX) * scale, "0.0000")
			post.NonModalNumber (" Y", (currentY + offY) * scale, "0.0000")
			post.Eol()
			post.Text(markerDn .. "\n")
   		end
   else
      if(dist >= refDistance and refDistance >=0) then
         dist = 0
         Reference();
         post.ModalText (" G0")
         post.NonModalNumber (currentZAxis, (pierceHeight)  * scale, "0.0000")
         post.Eol()
      end
	   post.Text (" G4 P1500 \n")
      ThcOn()
      post.Text ("\n" .. torchOn .. "\n")
   
		if (pierceDelay > 0) then
			post.Text (" G4 P")
			post.Number (pierceDelay * 100,"0.###")
			post.Eol()
		end
		
		
	end

end

function Reference()
   firstRef = false
   if(refDistance < 0) then return end
   -- touch Off Macro (ohmic offset 0.1mm, 1.4mm switch offset)
   	post.ModalText(" M1031 (TouchOff)\n")
   --
  end

function OnPenUp()
	if(toolClass == "MarkerTool") then
		post.Text(markerOff .. "(Marker Off)\n")
		post.Text(markerUp .. "(Marker Up) \n")
		post.Text(markerOff .. " (Marker Off) \n")
	else
		ThcOff()
      post.Text (torchOff .. "\n")
   end
end

function OnToolChange()
	if (toolClass == "DrillTool" ) then
		post.Text (" (tool number: ", tool ," ")
		post.Text (" Plasma peck drill)")
		post.Eol()
	else
		post.Text (" (tool number: ", tool ," ")
		post.Text (" Distance between Touch-offs: " , refDistance * scale, " ")
		post.Text (" Feedrate: ", feedRate * scale , ") \n")
      post.Text (" (ToolName: ", toolName , ") \n")
	end	
	if (toolClass == "PlasmaTool") then
		if(thcOff == 0) then
			post.Text (" (THC DISABLED for this tool)\n")
			ThcOff()
		else
       post.Text (" (THC ENABLED for this tool)\n")   
		MiniTHCSetting() 
		ThcOn()
		end
	end
	if (toolClass == "MarkerTool"  or tool > 99 ) then
         ThcOff()
         if(markerAxis and markerAxis ~= currentZAxis) then
            endZ = safeZ
            post.ModalText(" G0")
            post.ModalNumber (currentZAxis, (endZ + offZ) * scale, "0.0000")
            post.Eol()
            currentZAxis = " " .. markerAxis
         end
         if(firstRef ~= true) then
            offX = markerX
            offY = markerY
            offZ = markerZ
         end
   else
         if(markerAxis and markerAxis == currentZAxis) then
            endZ = safeZ
            OnRapid()
            currentZAxis = " Z"
         end
         offX = 0
         offY = 0
         offZ = 0
	end
end

function OnNewPart()
   post.Text(" (Part: ",partName,")\n");
end

function OnDrill()
	OnRapid()
	ThcOff()
	OnPenDown()
	OnPenUp()
	endZ = safeZ
	OnRapid()
end

function MiniTHCSetting()
	if(MiniTHCVolts > 0 and MiniTHCDelay > 0 ) then
         post.Text ( " G92 C0  \n" )         
         post.Text ( " G0 C8   \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )
         post.Text ( " G0 C",MiniTHCVolts," (MiniTHC Voltage Setpoint) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )   
         post.Text ( " G0 C",MiniTHCDelay," (MiniTHC Delay, hundreths of a sec) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n")
         post.Text ( " G0 C5   \n" )
         post.Text ( " G92 C0  \n" )
	elseif(MiniTHCVolts > 0 and MiniTHCDelay == 0 ) then
         post.Text ( " G92 C0  \n" )         
         post.Text ( " G0 C9   \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )
         post.Text ( " G0 C",MiniTHCVolts," (MiniTHC Voltage Setpoint) \n" )
         post.Text ( " G4 P100 \n" )
         post.Text ( " G92 C0  \n" )   
         post.Text ( " G0 C5   \n" )
         post.Text ( " G92 C0  \n" )
	else
         post.Text ("(No THC Voltage / Delay Set, using previous settings) \n")
	end
end

package.path = sc.Globals:Get().thisDir .. "/plugins/RotaryPlasma/?.lua"
require("rotaryhelper")

RS, thank you again. You always come through.

The C-Axis is my next hurdle, I need to sort UCCNC and SheetCAM out to use it. Your post will help out a ton. I have it cutting, and I have THC and the MiniTHC with Ohmic working well.

My issue right now is speed... My machine can't move fast enough to cut the 18g cleanly. But that's due to my use of ball screws rather then R&P.

Here's where I am now...


User avatar
djreiswig
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1441
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: UCCNC & MiniTHC Path Rules and Post

Post by djreiswig » Sun Jan 09, 2022 3:11 pm

Looks good. You should be able to rotate your parts and nest them tighter in SheetCam to more efficiently use your material.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

Mr.Hotwire
1.5 Star Member
1.5 Star Member
Posts: 47
Joined: Mon Jun 07, 2021 10:49 am

Re: UCCNC & MiniTHC Path Rules and Post

Post by Mr.Hotwire » Sun Jan 09, 2022 3:44 pm

djreiswig wrote:
Sun Jan 09, 2022 3:11 pm
Looks good. You should be able to rotate your parts and nest them tighter in SheetCam to more efficiently use your material.
Each one of them holes was from doing test cuts, of more and more complex shapes. So its kind of expected LOL. However, Nesting in SheetCAM when I start production parts will def be a huge help.

Thanks again!

robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1566
Joined: Mon Jun 12, 2017 6:43 pm

Re: UCCNC & MiniTHC Path Rules and Post

Post by robertspark » Sun Jan 09, 2022 4:23 pm

ballscrews will be a problem, one way to overcome it is to lower the amperage, given you are cutting thin material

a starting point will be say a 20% lower amperage and a 20% lower feedrate.......

What some of the guys do is they create a "job" for each sheet that they cut, and they save the job file for that sheet, so that if they want to add parts to better use the material they call up that job fine and then position the new pieces on that job / sheet so they use the whole sheet.

(I am not so good or organised, and just set a temporary offset and restart from the new point).

You can create an "L" shape on the corner of your table that you can use as an index point for material you place on the table so that all of the "job" sheets in sheetcam roughly line up.

If I was to use plasma for money generation (and not a hobby) I would do it that way, as I only cut odd things for myself.

User avatar
djreiswig
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1441
Joined: Thu Nov 19, 2015 10:02 pm
Location: SE Nebraska

Re: UCCNC & MiniTHC Path Rules and Post

Post by djreiswig » Sun Jan 09, 2022 5:43 pm

robertspark wrote:
Sun Jan 09, 2022 4:23 pm
What some of the guys do is they create a "job" for each sheet that they cut, and they save the job file for that sheet, so that if they want to add parts to better use the material they call up that job fine and then position the new pieces on that job / sheet so they use the whole sheet.
This is what I do. I name the job with the material thickness and the date. I usually try and use up one sheet before I start the next. I zero at the lower left corner and start adding parts to the upper right corner so I don't cut away my zero point. I mark the home corner on the top with a paint pen. Then when I come back the sheet later I can re-zero off of the corner and cut more parts.
In SheetCam, I lock parts after I cut them so I don't accidentally move them. Les added a new menu option, at my suggestion, to activate/deactivate locked parts. This makes it easy to turn them on so you can see where to place new things and then turn them back off when you post the new code.
I'm just doing hobby work. If you're doing production, you might want to come up with a serial numbering system and marking sheets with a paint pen to match the job name.
2014 Bulltear (StarLab) 4x8
C&CNC EtherCut
Mach3, SheetCam, Draftsight
Hypertherm PM65
Oxy/Acetylene Flame Torch
Pneumatic Plate Marker, Ohmic, 10 inch Rotary Chuck (in progress)

Mr.Hotwire
1.5 Star Member
1.5 Star Member
Posts: 47
Joined: Mon Jun 07, 2021 10:49 am

Re: UCCNC & MiniTHC Path Rules and Post

Post by Mr.Hotwire » Sun Jan 09, 2022 7:10 pm

I'm just doing hobby work too, that being personal, friend and co-worker requests. Also some auto parts for friends and a local club.

I'm going to try out the 20% lower trick. I did just lower from 45 to 35 amps. I'll adjust the speed on my next cut. That being said, it still cut and left a lot of draws and a rough cut edge.

Post Reply

Return to “SheetCam”

Industry Pros use FastCut CNC