Strange Z moves when touching off

Hypertherm Plasma Cutter discussion forum.
Post Reply
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Strange Z moves when touching off

Post by stepper »

Hello guys
I was hoping someone may offer a little help with my issue.
I have recently upgraded my setup to Mach 4 and installed a C25XP BOB with an integrated ESS Smooth stepper from CNC4PC, the X & Y axis are homing and setting the machine zero coordinates correctly, the Z zero is set using a floating head off the surface of the material which activates the homing switch and works fine.
I then move the torch to the work and zero the X & Y work coordinate at its starting point, the Z axis is then jogged down until the torch just touches the surface and I than zero the Z work coordinate.

My problem is that when I start the program (Generated in Sheetcam), the torch is dwelling for pierce at -3.8 mm instead of +3.8 mm which is what the switch offset is programmed in the Sheetcam post processor (MP1000-THC), coincidently this is the same measurement as the Hypertherm pierce height.

X & Y axis moves are positive when moving away from the home switches, the Z axis is Negative when moving to the work surface and positive when moving away from the work surface no THC is being used.
Thanks
Andy
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

Program used for the above is as follows: -

N0010 (Filename: 25mm circle.tap)
N0020 (Post processor: MP1000-THC.scpost)
N0030 (Date: 03/05/2021)
N0040 G21 (Units: Metric)
N0050 G53 G90 G40
N0060 F1
N0070 (Part: New part)
N0080 (Operation: Outside Offset, 0, T3: 4mm Mild Steel Cut)
N0090 M06 T3 F2800 (4mm Mild Steel Cut)
N0100 G00 Z20.0000
N0110 X3.1308 Y-1.3946
N0120 Z3.8000
N0130 G28.1 Z3.00
N0140 G92 Z0.0
N0150 G00 Z3.8000
N0160 G92 Z0.0
N0170 G00 Z3.8000
N0180 M03
N0190 G04 P0.4
N0200 G01 Z1.5000 F1000.0
N0210 G03 Y3.1308 I-2.2627 J2.2627 F2800.0
N0220 G02 I9.3692 J9.3692
N0230 X1.2667 Y5.4732 I9.3692 J9.3692
N0240 G03 X-3.1433 Y6.4891 I-2.7129 J-1.6970
N0250 M05
N0260 G00 Z20.0000
N0270 X0.0000 Y0.0000
N0280 M05 M30
weldguy
4 Star Elite Contributing Member
4 Star Elite Contributing Member
Posts: 1929
Joined: Fri Apr 17, 2009 11:48 am

Re: Strange Z moves when touching off

Post by weldguy »

Has it done this since you upgraded to Mach 4 or has it worked on Mach 4 and this problem just started?
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

Worked on Mach 3 but only started doing this following the change to mach 4.
Strangely, if I single block through the program the movements are okay.
robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1809
Joined: Mon Jun 12, 2017 6:43 pm

Re: Strange Z moves when touching off

Post by robertspark »

it's because g28.1 does not exist in mach4.

g28.1 will be skipped / ignored as mach4 does not know what you want the machine to do.

you need
a) a mach4 post processor
or
b) edit the post processor to change g28.1 to tell the machine to do what you want it to do instead


https://www.google.com/url?sa=t&source= ... _gZ7kW5Ecm


from memory g28.1 z

tells the machine to re-home g28.1 / reference the z axis.

I don't think there is an inbuilt macro in mach4 that does the same..... but I don't use mach4..... suggest you ask on the Mach forum....

or switch to g31 probe routine which is the correct way to do it as it is a probing routine and you set a temporary offset with g92
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

Hi robertspark
I thought that may be the situation, thank you for confirming this.
I will add another switch at the top of the Z axis to home to and use a g31 probing cycle to set the work height. Can you recommend a proven post processor that utilises the G31 cycle, I do plan on adding a THC very soon but do not have one as yet.
Hypertherm 45XP with CPC and machine torch
ESS Smoothstepper V3
C25XP BOB.

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

Re: Strange Z moves when touching off

Post by robertspark »

send / post the post processor as a text file and I will edit it for you and repost

easier to do than talk / write about
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma MP1000-THC post processor\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("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("switchoffset - set your net switch offset amount \n")
end


--post.SetOptions(post.ARC_SEGMENTS)


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



function OnInit()

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 G40\n F1\n")
minArcSize = 0.2 --arcs smaller than this are converted to moves

dist = 9999999
refdistance = 10* scale
--Put your switch offset value here
switchoffset =3.8
lastz = 0
end

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


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

function OnRapid()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Eol()
end

function OnMove()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end

function OnArc()
dist = dist + math.hypot(endX-currentX , endY-currentY)
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
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(dist >= (refdistance/scale)) then
dist = 0
-- modaltext (" G00")
-- text(" Z")
-- number (pierceheight * scale, "0.0000")
-- eol()
post.ModalText(" G28.1 Z")
post.Number(3 * scale, "0.00")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.Text(" Z")
post.Number (switchoffset, "0.0000")
post.Eol()
post.ModalText(" G92 Z0.0\n")
post.ModalText (" G00")
post.Text(" Z")
post.Number (pierceHeight * scale, "0.0000")
post.Eol()
else
post.ModalText (" G00")
post.Text(" Z")
post.Number (pierceHeight * scale, "0.0000")
post.Eol()
end
if (preheat > 0) then
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.Text ("\n M03\n")
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end


function OnPenUp()
post.Text (" M05\n")
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()
post.Text (" M06 T")
post.Number (tool, "0")
post.ModalNumber(" F",feedRate * scale,"0.#")
post.Text (" (", toolName, ")\n")
end

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

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1809
Joined: Mon Jun 12, 2017 6:43 pm

Re: Strange Z moves when touching off

Post by robertspark »

what feedrate do you home at?
robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1809
Joined: Mon Jun 12, 2017 6:43 pm

Re: Strange Z moves when touching off

Post by robertspark »

Just Change Line 43 to your probing / homing feedrate and it should work just fine.

I edited the probing sequence to make it a little quicker (less steps)

Code: Select all

function OnAbout(event)
ctrl = event:GetTextCtrl()
ctrl:AppendText("plasma MP1000-THC post processor\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("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("switchoffset - set your net switch offset amount \n")
end


--post.SetOptions(post.ARC_SEGMENTS)

-- edited 04/05/2021 Robertspark
-- created 1/1/06
-- Based on plasma1.post


function OnInit()

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 G40\n F1\n")
minArcSize = 0.2 --arcs smaller than this are converted to moves

dist = 9999999
refdistance = 10* scale
--Put your switch offset value here
switchoffset =3.8 -- distance in milimeters
lastz = 0
probingfeedrate = 600 -- feedrate in mm/min
end

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


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

function OnRapid()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G00")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.Eol()
end

function OnMove()
dist = dist + math.hypot(endX-currentX , endY-currentY)
post.ModalText (" G01")
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
post.ModalNumber (" F", feedRate * scale, "0.0###")
post.Eol()
end

function OnArc()
dist = dist + math.hypot(endX-currentX , endY-currentY)
if(arcAngle <0) then
post.ModalText (" G03")
else
post.ModalText (" G02")
end
post.ModalNumber (" X", endX * scale, "0.0000")
post.ModalNumber (" Y", endY * scale, "0.0000")
post.ModalNumber (" Z", endZ * scale, "0.0000")
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(dist >= (refdistance/scale)) then
dist = 0
post.ModalText(" G31 Z-")
post.Number(probingfeedrate * scale, "0.00")
post.Eol()
post.ModalText (" G92")
post.Text(" Z-")
post.Number (switchoffset, "0.0000")
post.Eol()
post.ModalText (" G00")
post.Text(" Z")
post.Number (pierceHeight * scale, "0.0000")
post.Eol()
else
post.ModalText (" G00")
post.Text(" Z")
post.Number (pierceHeight * scale, "0.0000")
post.Eol()
end
if (preheat > 0) then
post.Text ("\n G04 P")
post.Number (preheat,"0.###")
post.Eol()
end
post.Text ("\n M03\n")
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,"0.###")
post.Eol()
end
end


function OnPenUp()
post.Text (" M05\n")
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()
post.Text (" M06 T")
post.Number (tool, "0")
post.ModalNumber(" F",feedRate * scale,"0.#")
post.Text (" (", toolName, ")\n")
end

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

function OnDrill()
OnRapid()
OnPenDown()
endZ = drillZ
OnMove()
OnPenUp()
endZ = safeZ
OnRapid()
end
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

Thank you so much, I will give this a go in the morning
stepper
1.5 Star Member
1.5 Star Member
Posts: 29
Joined: Thu Mar 18, 2021 5:46 am

Re: Strange Z moves when touching off

Post by stepper »

Hi robertspark
There was a slight error in your edit where the G31 Z move was referenced to the feed rate.
"post.ModalText(" G31 Z-")
post.Number(probingfeedrate * scale, "0.00")"
I have added the appropriate line to set a Z depth followed by the F command to use your probing feedrate, works great now so thanks again.
Andy
robertspark
4.5 Star Elite Contributing Member
4.5 Star Elite Contributing Member
Posts: 1809
Joined: Mon Jun 12, 2017 6:43 pm

Re: Strange Z moves when touching off

Post by robertspark »

oops.... good you worked it out and it now does what you want....
adbuch
6 Star Elite Contributing Member
6 Star Elite Contributing Member
Posts: 8602
Joined: Thu Sep 21, 2017 5:22 pm
Location: Tucson, Arizona
Contact:

Re: Strange Z moves when touching off

Post by adbuch »

robertspark wrote: Tue May 04, 2021 5:56 pm Just Change Line 43 to your probing / homing feedrate and it should work just fine.

:Like :Like :Like :Like :Like
Post Reply

Return to “Hypertherm Plasma Cutters”