Initial Height Sensing and Stand Alone THC for Plasma cutting

Post Reply
ernestoa
Posts: 16
Joined: Thu Jan 11, 2018 5:20 am

Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by ernestoa » Thu Apr 12, 2018 8:03 pm

I'm converting a friend's Mach3/G540 based plasma table to a Protoneer setup and need to figure out the best way to edit the post processor in sheetcam to touch off for initial height sensing and use a stand alone torch height controller.

Here's where I'm at with the process
Units are in inches

Move to XY of the start of the cut. : G00 X* Y* Z1
Initial Probe Z: G38.2 Z-1.5 F20
Move Z up for final probe: G00 Z 0.5
Final Probe: G38.2 Z -0.6 F5
Offset for switch trigger travel: G00 Z .15
Reset Z Zero : G92 Z0
Move to pierce height: G00 -Z .2
Fire Torch: M3

This is where I may need help. The machine needs to pause while the arc starts, then resume when the THC sends an ARC OK ground signal.
Will M226 work in grbl? If not, will M0 allow me to resume by sending a ground to the resume pin?
The other option here is to use a pre programmed pause using G4 P****

Once resumed, the THC will take over Z axis control and the G01 commands can start running the cut.
Kill the torch: M5
Probe Z after cut to reset z axis reference: G38.2 Z -.5 F1
Account for switch trigger offset: G01 Z .15
Reset Z Zero: G92 Z0
Move to safe Z: G00 Z1
Repeat process for the next cut.

The reason for doubling the probing process pre cut is to get the probe close quickly and final probe from a lower distance slowly, which should increase accuracy due to machine flex and switch trigger characteristics.

The program pause for arc start is the only part that's tripping me up.

I'll be using bCNC if that helps.

Here's the anti collision/initial height sensing torch holder (I will be replacing the NC prox switches for NO ones):
http://robot3t.com/en/san-pham/cth3t-01 ... -holder-2/

And this is the stand alone THC:
http://robot3t.com/en/san-pham/thc3t-02-stepdir-output/

Any input would be greatly appreciated.

Ernesto2
Posts: 42
Joined: Sun May 06, 2018 7:17 am

Re: Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by Ernesto2 » Sun May 06, 2018 7:41 am

I broke my old account by ditching my yahoo account and attempting to make the email change here in the wrong order.

I'm near the end of the build for the Protoneer system for my friend's plasma table. It's time to figure out the THC thing.

I'm using this THC:
http://robot3t.com/en/san-pham/thc3t-02-stepdir-output/
compactstepdirhc.jpg
robot3t thc wiring
compactstepdirhc.jpg (129.58 KiB) Viewed 122 times
tb6600_orig.jpg
tb6600 wiring
tb6600_orig.jpg (141.75 KiB) Viewed 122 times
It's apparently looking for a negative step/dir signal from the Protoneer board. I found where to switch / invert the polarity in GRBL under settings $2 and $3 but I seem to remember reading somewhere that I'd need to modify the circuit board a bit to change the pull down resistors to pull up instead but I only see that mentioned under the limits/probe inputs in the GRBL manual. Do I need to modify anything other than those GRBL settings to get the board to send out grounds instead?

I'm also trying to figure out how to use g-code to bypass the THC and so far, it looks like Ill be using the coolant output to trigger a ttl relay that interrupts the divided arc positive voltage should bypass the THC and turn z axis control back over to grbl.

Other than those questions, I think I have the rest of the wiring figured out and will post some wiring diagrams here tomorrow.

Ernesto2
Posts: 42
Joined: Sun May 06, 2018 7:17 am

Re: Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by Ernesto2 » Tue May 08, 2018 11:09 pm

Answering my own questions here in case others need help.

I closely examined the board and determined that I just need to breathe and think more before asking questions. :oops:

Of course the stepper signal outputs don't have pull down/up resistors on them. They're outputs.... I opened bCNC, went to Terminal, entered $2=4, hit enter, restarted the pi, and sure enough, the z axis outputs were inverted! I wired up the THC and changed the wiring harness to the Z stepper driver so it got +5v to EN+ P(step)+ and and Dir+ from the hole in the "cabbage patch(haha!)" on the Protoneer. I haven't tested the THC while functioning yet but the z axis works when the unit is on and in bypass mode.

Also, z,y,and z work out of the box with this mach3 pendant! https://www.aliexpress.com/item/Free-Sh ... 26429.html
I'll have to figure out how to map the rest of the keys but it doesn't look too hard.

As far as disabling the THC goes, it looks like using the ttl relay to cut the divided arc voltage input will work just fine. The THC decides when to take control and start analyzing the arc voltage in order to send the arc ok signal by first sensing a voltage input from the plasma cutter.
Last edited by Ernesto2 on Mon May 21, 2018 4:23 am, edited 1 time in total.

Ernesto2
Posts: 42
Joined: Sun May 06, 2018 7:17 am

Re: Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by Ernesto2 » Sat May 12, 2018 11:06 pm

With stand alone THC systems, the software doesn't know where the z zero is after making a cut so even though it's small, there's potential for a crash or failed pierce on the next piece if material warps a lot during a cut so I've been looking for a post processor for sheetcam that's made for grbl and a standalone THC. I couldn't find anything so I made one. I tested the code on a square and it touches off before and after a cut so the system really knows where safe z is before it moves to the next pierce location. I'll try running it on a live machine on Tuesday and post the results.

Here's the text of the post processor:

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

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

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

--Put your switch offset value here in MILLIMETRES
--Put a sheet of metal on your machine and place a sheet of paper on top.
--Slowly jog the torch down onto the paper until the touch-off switch just operates.
--Zero the Z axis then pull gently on the paper and slowly jog up until the paper slides out.
--The Z axis position is your switch offset.
switchOffset = 1.5

--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

--this is an extra delay added to the first pierce as needed by some machines
firstPierceTime = 0


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



function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma MP1000-THC post processor with engraver\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 Mach3 and CandCNC MP1000-THC and Floating head Touch-n-Go\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")
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 5/12/2018
-- Added: Reference the torch on pen up to reset z zero reference in stand alone thc systems.


post.DefineVariable("refDistance",sc.unitLINEAR,0,1e17)
post.DefineVariable("refFeed",sc.unitFEED,0,1e17)
post.DefineVariable("switchOffset",sc.unitLINEAR,-1e17,1e17)

function OnInit()

offX = 0
offY = 0
offZ = 0

post.SetCommentChars ("()", "[]") --make sure ( and ) characters do not appear in system text
if(scale == metric) then
post.Text (" G21\n") --metric mode
else
post.Text (" G20\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
firstPierce = firstPierceTime;
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
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(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", feedRate * scale, "0.0###")
post.Eol()
end



function OnPenDown()
if(toolClass == "MarkerTool") 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\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.0##")
post.Eol()
end
post.Text ("\n M03\n")
end
if (pierceDelay + firstPierce > 0.001) then
post.Text (" G04 P")
post.Number (pierceDelay + firstPierce,"0.0##")
firstPierce = 0
post.Eol()
end
end


function Reference()
firstRef = false
post.ModalText(" G38.2 z")
post.Number(-50 * scale, "0.0##")
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(toolClass == "MarkerTool") then
if (firstRef) then
Reference()
post.Text(" M09\n")
else
post.Text (" M05\n")
end
if(dist >= refDistance) then
dist = 0
Reference();
end
if (endDelay > 0) then
post.Text (" G04 P")
post.Number (endDelay,"0.###")
post.Eol()
end
end


function OnToolChange()
if (toolClass == "MarkerTool") then
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 OnDrill()
OnRapid()
currentX = endX
currentY = endY
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end


function OnComment()
post.Text(" (",commentText,")\n")
end

Ernesto2
Posts: 42
Joined: Sun May 06, 2018 7:17 am

Re: Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by Ernesto2 » Sat May 12, 2018 11:29 pm

The only other thing I can think to add is something that detects small arcs and writes M08/09 to trigger a relay that breaks the arc-div signal to the THC, disabling it during slow corners.

Maybe in this section here:
function OnArc()
local radius = math.hypot(currentX - arcCentreX, currentY - arcCentreY)
dist = dist + radius * math.abs(arcAngle)

I will look into it.

Ernesto2
Posts: 42
Joined: Sun May 06, 2018 7:17 am

Re: Initial Height Sensing and Stand Alone THC for Plasma cutting

Post by Ernesto2 » Mon May 21, 2018 4:19 am

The modded post processor is coding in the pre and post cut z reference cycles, which is cool, but when I try to mod it to add the M8/9 commands to turn the thc on after the pierce and drop to pierce height, then off after cutting and before small circles and tight corners, they aren't showing up in the right spots in the code. I know it's just a syntax issue but I feel like I've tried everything. I'm looking into path rules in sheet cam plasma operation settings to enable this too, at least the circles and corners part. The THC may be able to take over z control right at pierce height instead of having the torch fire, protoneer drop z to cut height, then allowing the thc to take over....

Also, for some reason, bCNC is only running two blocks of code and stopping like it's finished, even though there are no errors in the code and more code left to process. I'm thinking that it may be something in the grbl config.h file but I can't get the arduino IDE to recognize the grbl library so I can attempt changes.

Are there other changes that I'll need to make to the stock grbl config file to optimize it for the protoneer board?
Attempting to flip the coolant and spindle enable pins to active low is something I need to try too.

I'll post up again when I get things dialed.

I wish I could find someone that's familiar with sheetcam, bcnc, standalone thc, and grbl. Getting them all to talk nicely isn't easy. I am learning a lot though!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest