Rotary Plasma Scribe Post Offset Problem??

I am using the rotary plasma swapped axis post and having a problem with the scriber. I have the scriber working on flat sheet with the mp1000 scriber post (modified abit) and use the same offsets. It goes to the start position, references the material with torch touch off, then moves off to the side triggers the scribe relay and then moves the scribe at feed rate in a straight line back into the side of the tube, and there is no straight line that it is suppossed to make, just a small logo.

Simulation looks right, offset of logo in mach toolpath screen looks right.

Les or whoever, can you look at that post to see if there is an obvious problem, or do you need me to post up my gcode, post (or both flat sheet and rotary for comparing), a comparable flat sheet gcode, or what?

Also, while you are looking, Les, you helped me change the flat sheet mp1000scribe post to only trigger m8 once at the beginning, and leave it running only lifting z to move to another shape and one m9 at end, i would like to do that the same, but im not sure if i remember what we did, but that is secondary minor problem.

----After i look further, I am thinking the problem lies in line N0180 and it should rapid to the xy position, and then lower the z and start feedrate, i will continue to try to fix it, but im not too confident with my post programming skills----

Another thought, maybe i can just copy the MP1000 Scriber post section for pen down and pen up to replace the rotary scribe pen up and down to get everything the same, would this cause other problems associated with the rotary portion of it? I may try it, but you can tell me what you think.

N0010 (Filename: 1.5 square tube Chair Scribe.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 04/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X0.4583 Z1.5115 A-0.0039
N0110 Z1.2615
N0120 G28.1 Z1.06 F50.0
N0130 G92 Z0.9348
N0140 G00 Z1.6947
N0150 Y0.9319 X-0.4245 -------START OF LINE NOT DRAWN
N0160 Z1.4644
N0170 M08
N0180 G01 Y0.9345 X-2.5063 Z1.2697 A0.0000 F56.3217 -------LINE OF TRAVEL NOT WANTED
N0190 G03 Y0.9243 X-2.5131 J-0.0145 I0.0106
N0200 G01 Y0.9182 X-2.5136 F50.0
N0210 Y0.8319 X-2.5025
N0220 Y0.8336 X-2.5047
N0230 Y0.8398 X-2.5093
N0240 Y0.8986 X-2.5434
N0250 Y0.8977 X-2.5527
N0260 Y0.8944 X-2.5732
N0270 Y0.8950 X-2.5951
N0280 Y0.8945 X-2.6170
N0290 Y0.8956 X-2.6277
N0300 Y0.8963 X-2.6433
N0310 Y0.8956 X-2.7062
N0320 Y0.9034 X-2.7090
N0330 Y0.9362 X-2.7180
N0340 Y0.9418 X-2.7206
N0350 Y0.9641 X-2.7396
N0360 Y0.9756 X-2.7522

Thanks,
Brian

Could you send me a sample job file and a copy of your post so I can test it here with your settings.

What i am shooting for is reference with the torch switch, lift up to rapid height (.75" in this post) offset to scribe position. Fire the m8 relay and move to proper offset (allowing it to engage while moving, and then lower to .5" Z height to engrave (as the scribe shoots down approx .5625 lower than the torch tip, and only lift the Z, no M9 and extra M8 between scribe shapes. Once down scribing, then it would M9 and offset back to the torch to finish.

FYI
i am using .020 plunge safety
switch offset is .25mm or .0098"
1.5" square tube .28 corner radius
.75" rapid
.5" scribe z cut height (lowers .5625 than torch for light spring air pressure while engraving)

I have combined your swapped axis post with the negative axis change and my copy and paste from the flat sheet scribe post for the single M8, M9 post, but if somethings wrong or missing, feel free to make it right, and let me know. I would prefer to tell me what was wrong, what needs changed and were, and i can change it, so hopefully i gain some knowledge as well as fixing it.

If i can get rid of the initial M09 at first toolchange, great, if not, its not hurting anything.

A few lines that im not sure what it is doing, i have tried to follow through the gcode from the post proc, comparing to see were its coming from. I will continue looking at it to see if i can figure it out, but its probably a cake walk for you Les.


N0010 (Filename: 1.5 square tube Chair.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 09/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)

N0100 G00 Y0.9315 X-0.4583 Z1.5115 A-0.0039 ------assuming Z height is rapid height from tube centerline.

N0110 Z1.2615-----were is this coming from? Cut height of scribe (.75 rapid, .5 scribe cut height)

N0120 M09 -------Unnecessary

N0130 G28.1 Z1.06 F50.0 ------Were is this feedrate Z coming from? post proc says "post.Number((3 +matZ) * scale, “0.00”) were is the 3 coming from?

N0140 G92 Z0.9348

N0150 G00 Z1.6848 M08 ----FIXED, added \n under Reference part of post— post.Text(“\n M08\n”) to move to new line

-----These lines seem like errors, need to disappear (Why they here?)
N0160 G00 Z1.6947
N0170 Y0.9319 X5.5177
N0180 Z1.4644

—these z heights funny because corner radius comp for tube? I would think that z should be running at 1.25 (.75 half of tube thickness, .5 scribe z cut height)
N0190 G01 Y0.9322 X-3.4311 Z1.3003 A-0.0034 F46.1708
N0200 Y0.9324 X-3.4328 Z1.3195 A-0.0028 F46.1546
N0210 Y0.9326 X-3.4346 Z1.3386 A-0.0022 F46.1383
N0220 Y0.9328 X-3.4363 Z1.3578 A-0.0016 F46.1222
N0230 Y0.9330 X-3.4380 Z1.3769 A-0.0011 F46.1061
N0240 Y0.9332 X-3.4397 Z1.3961 A-0.0005 F46.09
N0250 Y0.9334 X-3.4409 Z1.4155 A0.0000 F46.6878
N0260 Y0.9345 X-3.4359 Z1.5197 F50.0
N0270 G02 Y0.9243 X-3.4291 Z1.2697 J-0.0145 I-0.0106
N0280 G01 Y0.9182 X-3.4286
N0290 Y0.8319 X-3.4397
N0300 Y0.8336 X-3.4375
N0310 Y0.8398 X-3.4329
N0320 Y0.8986 X-3.3988

Here is a simpler one for me to see what is happening and compare it to the beginning of the Code we are troubleshooting. 3 - 2.5" lines, plasma, scribe, plasma on a 1.5" tube (.75" to centerline). I think one of the bugs (going off into no mans land) is if it is scribe tool first, as it does not appear to be in this code. Also, it does not appear the plunge safety distance is used anywere (not a problem, just noticed). One thing, i had .5 z scribe offset in the last attached code, which is .01968" and im not sure why, i dont remember, accident??? That i just noticed and its probably giving me some funky numbers making following it harder. It has been removed now.

N0010 (Filename: 2&half horizontal line.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 09/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947 ------Still not sure were this comes from in post
N0080 (Part: 2&half horizontal line)
N0090 (Operation: No Offset, 0, T5: 10 Ga Steel 50 amp Fine Cut)
N0100 G00 Y0.0000 X0.2962 Z1.5000 A0.2500
N0110 Z0.9100 —pierce height .16 above
N0120 G28.1 Z0.87 F50.0 —.12" above material (were does this come from)
N0130 G92 Z0.7402 ----.75 material height above center - .0098 switch offset
N0140 G00 Z0.9100 ----back to pierce height .16 above
N0150 M03—pierce
N0160 G04 P0.4—pierce delay
N0170 G01 Z0.8300 F100.0 ----Cut height .08 above
N0180 Y2.5000 F90.0
N0190 (Part: Copy of 2&half horizontal line)
N0200 (Operation: No Offset, 0, T202: Plate marker 50 FineCut)
N0210 M05
N0220 G00 Z1.5000----rapid z height
N0230 M08----scribe on
N0240 G00 Y2.5005 X-2.6749 Z1.5000 A0.2500----offset scribe
N0250 Y0.0005 X-2.9286----goto start of scribe line
N0260 Z1.2500----lower to material
N0270 G01 Y2.5005 F50.0-----engrave line at feedrate
N0280 (Part: Copy of Copy of 2&half horizontal line)
N0290 (Operation: No Offset, 0, T5: 10 Ga Steel 50 amp Fine Cut)
N0300 G00 Z1.5197
N0310 Z1.7144
N0320 M09
N0330 G00 Y2.5000 X0.0425 Z1.5000 A0.2500
N0340 Y0.0000 X-0.2943
N0350 Z0.9100
N0360 G28.1 Z0.87 F50.0
N0370 G92 Z0.7402
N0380 G00 Z0.9100
N0390 M03
N0400 G04 P0.4
N0410 G01 Z0.8300 F100.0
N0420 Y2.5000 F90.0
N0430 M05
N0440 G00 Z1.5000
N0450 Y0.0000 X-0.0000 Z1.6947 A0.3750
N0460 M05 M30

So, it looks fine, except i would like to know were this # comes from
N0070 G00 Z1.6947 ------Still not sure were this comes from in post
AND
the distance above material to start referencing appears to be 3mm, I may change that and am assuming you just picked that number instead of having it be a variable.

Ok i have removed the .5mm (.0197") z scribe offset, and moved the scribe logo so that it is off of the corners completely. This is the beginning snippet from the code.

N0010 (Filename: 1.5 square tube Chair.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 10/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947------Still not sure were this comes from in post
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X-0.4689 Z1.5000 A0.0000 -----start and ref location
N0110 Z1.2500-----scribe cut height (this wouldn’t have to be posted here)
N0120 M09-----safety relay off before reference
N0130 G28.1 Z0.87 F50.0----.12 above/ a number you picked to start from for referencing? from ref post post.Number (3 * scale, “0.00”) or 3mm is .12"
N0140 G92 Z0.7402-----Mat z - switch offset-- setting z zero
N0150 G00 Z1.4902-----rapid height - switch offset
N0160 M08-----scribe on
N0170 G00 Z1.6947------after ref, it post same number at beginning of code from ???
N0180 Y0.9319 X5.5097—move off into no mans land (need to find out why and remove it)
N0190 G01 Y0.9345 X-3.4279 Z1.5000—move back to scribe offset at feedrate, should be rapid
N0200 G02 Y0.9243 X-3.4211 Z1.2500 J-0.0145 I-0.0106—lowers scribe and starts marking
N0210 G01 Y0.9182 X-3.4206
N0220 Y0.8319 X-3.4317
N0230 Y0.8336 X-3.4295
N0240 Y0.8398 X-3.4249
N0250 Y0.8986 X-3.3908
…so on…


Does the mystery z1.6947 and the move into no mans land have something to do with the rapid part of the post proc? I dont understand this with the local len, dist + len and endX < 1e17)???

function OnRapid()
local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
dist = dist + len
post.ModalText (" G00")
post.ModalNumber (" Y", (endX + offX) * scale, “0.0000”)
if(endX < 1e17) then
post.ModalNumber (" X", -(endY + offY) * scale, “0.0000”)
end
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”)
post.ModalNumber (" " … rotaryAxis, endA, “0.0000”)
post.Eol()

Hi Brian,

N0070 G00 Z1.6947

At the start of motion it doesn’t know the pipe orientation so it assumes the worst case of one corner at the top. N0070 is that height plus the rapid clearance height.

Also, it does not appear the plunge safety distance is used anywere

Plunge safety clearance is only used for milling and drilling. When doing a rapid move to the top of the work it stops short and plunges the last little bit at feed rate. This is to allow for work misalignment or any swarf in the way.

N0100 G00 Y0.9315 X-0.4583 Z1.5115 A-0.0039 ------assuming Z height is rapid height from tube centerline.

Yes. That is correct.

N0110 Z1.2615-----were is this coming from? Cut height of scribe (.75 rapid, .5 scribe cut height)

That is correct.

N0120 M09 -------Unnecessary

I would leave it in. Belt and braces is always a good approach

N0130 G28.1 Z1.06 F50.0 ------Were is this feedrate Z coming from? post proc says "post.Number((3 +matZ) * scale, “0.00”) were is the 3 coming from?

matZ is the surface of the work. It takes the tube angle into account. 3 is hard coded as 3mm. When seeking the home switch it should slow down 3mm above the surface.

N0170 G00 Z1.6947------after ref, it post same number at beginning of code from ???

This should be rapid safety clearance including compensation for the tube angle.

N0180 Y0.9319 X5.5097—move off into no mans land (need to find out why and remove it)

This should be applying the scriber offset and moving to the start of the cut. In function OnPenDown I think this code:

         post.ModalNumber &#40;" Y", &#40;currentX + offX&#41; * scale, "0.0000"&#41;
         post.ModalNumber &#40;" X", &#40;currentY + offY&#41; * scale, "0.0000"&#41;

should be

         post.ModalNumber &#40;" Y", &#40;endX + offX&#41; * scale, "0.0000"&#41;
         post.ModalNumber &#40;" X", &#40;endY + offY&#41; * scale, "0.0000"&#41;



N0190 G01 Y0.9345 X-3.4279 Z1.5000—move back to scribe offset at feedrate, should be rapid

No. This is the end of the first cut move.

In function OnPenUp you have a minor bug:

   if&#40;tool > 99&#41; then

should be

   if&#40;toolClass == "MarkerTool" or tool > 99&#41; then

To be honest I would scrap the check for tool > 99. That was used before toolClass was introduced. At that time posts had no way of knowing the tool type so you had to fudge it with tool numbers.

Oops, forgot to answer this one:

Does the mystery z1.6947 and the move into no mans land have something to do with the rapid part of the post proc? I dont understand this with the local len, dist + len and endX < 1e17)???

function OnRapid()
local len = math.hypot((endX + offX)-currentX , (endY + offY)-currentY)
dist = dist + len
post.ModalText (" G00")
post.ModalNumber (" Y", (endX + offX) * scale, “0.0000”)
if(endX < 1e17) then
post.ModalNumber (" X", -(endY + offY) * scale, “0.0000”)
end
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”)
post.ModalNumber (" " … rotaryAxis, endA, “0.0000”)
post.Eol()

The local keyword just means that the variable will only exist within the function. Variables declared without local are visible to all functions. In this case len contains the linear distance we will move (hypotenuse of the X,Y triangle).
dist is the total distance moved. It is used to work out when to reference.
This code

if&#40;endX < 1e17&#41; then

is a quirk of the post system. When initially moving we need to suppress some axes. For instance the first move to safe Z shouldn’t move X or Y. To work around this SheetCam sets endX and endY to very large values (>1e17). ModalNumber knows it should not output anything if the coordinate is greater than 1e17. If course when you reverse the axis the coordinate is now less than -1e17 and ModalNumber will not hide this axis so we need to do the check manually.

Excellent, im glad your a smart fella! :wink: I appreciate the explanation! Sometimes on flat sheet when it moves a long distance and material is warped or sitting on the table not completely level it triggers a limit, guessing because it is > 3mm higher than the last, so i am assuming I could manually change the 3mm to something a tad larger and it would not cause any problems, and prevent that from happening.

I now understand all of it very well except the local len stuff, but i understand it somewhat.

I made the changes you mentioned, and unfortunately, it still moves out into no mans land. I tried adding a - to the scribe — post.ModalNumber (" X", -(endY + offY) * scale, “0.0000”) as i thought it might be lacking from the other changes, and it just makes it go too far the other direction. Its almost like it is doing twice the offset on that axis for some reason. I also tried changing the scribe offset to - and the post.modal number opposite, same, etc and just cant get it to eliminate the improper move away from the part and then at feedrate back to the part. It does however seem to know the proper offset, it just moves away from it before going to the right place.

N0010 (Filename: 1.5 square tube Chair.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 10/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X-0.4689 Z1.5000 A0.0000
N0110 Z1.2500
N0120 M09
N0130 G28.1 Z0.87 F50.0
N0140 G92 Z0.7402
N0150 G00 Z1.4902
N0160 M08
N0170 G00 Z1.6947
N0180 Y0.9345 X5.4976 -------moves off into space
N0190 G01 X-3.4279 Z1.5000----you mention 1st cut, but it is coming back from space at feed to this location
N0200 G02 Y0.9243 X-3.4211 Z1.2500 J-0.0145 I-0.0106
N0210 G01 Y0.9182 X-3.4206
N0220 Y0.8319 X-3.4317
N0230 Y0.8336 X-3.4295

Thanks very much.

Brian Wolfe

I think i traced the problem, but not sure how to fix it. I am thinking it has to be in the pen down posting the x and y after the scribe offset.

function OnPenDown()

Anything to do with this???--------------------
sc.QueryDll(qryRAPIDY, endY, dllId)
– local matZ = sc.QueryDll(qryGETZ, 0, dllId)
local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
Anything to do with this???--------------------

if(toolClass == “MarkerTool”) or tool > 99 then
if (firstRef) then
Reference()
post.ModalText (" G00")
post.Text(" Z")
local clearZ = sc.QueryDll(qryGETSAFEZ, 0, dllId)
post.Number ((clearZ + safeZ) * scale, “0.0000”)
post.Eol()
offX = scriberX
offY = scriberY
offZ = scriberZ

PROBLEM-----------------------------
post.ModalNumber (" Y", (endX + offX) * scale, “0.0000”)
post.ModalNumber (" X", (endY + offY) * scale, “0.0000”)
post.Eol()
PROBLEM-----------------------------


end
if (offZ) then
post.ModalNumber (" " … currentZAxis, (matZ + currentZ + offZ) * scale, “0.0000”)
post.Eol()
end
–post.Text(" M08\n") --removed and done in toolchange instead
else
if(dist >= refDistance) then
dist = 0
Reference();
end
post.ModalText (" G00")
post.Text(" Z")
post.Number ((matZ + 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 M03\n”)
end
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,“0.###”)
post.Eol()
end
end


Wherever it is pulling the coordinates from or how it is what is my best guess is. The Y is posted .0025 more than i would expect, and the X is 2.5022 more than i would expect. I would expect line N0100 (were it referenced at the start) x and y coordinates plus .0005 y and 2.9711X because of the offset scribe.

Can you do something like last x and last y + offset? Not sure if that would work or give us what we want, but it seems logical.

Brian

I am experimenting with the x and y post after scribe offset under pen down, and for some reason currentY (posts as x) reads X2.5386, and endY reads X2.5265 when it was x -0.4689 at reference. Thats what i would expect it to be, so im not sure were it changed. If i use current instead of end (what it was before we tried changing it), the Y posted coordinate is exactly as expected. So now to see were and why the X posted coordinate changed.


function OnPenDown()
sc.QueryDll(qryRAPIDY, endY, dllId)
– local matZ = sc.QueryDll(qryGETZ, 0, dllId)
local matZ = sc.QueryDll(qryCHKEND, endY, dllId)

Is this right or wrong? should the endY be z instead? OR is this making my coordinate post wrong either by itself or the fact that we swapped axis?

EDIT…
It appears that the x and y post after scribe offset under pen down is now posting the correct Y0.9319 (same as ref position + scribe offset) but the X if i post just current, it is 2.5386, END is 2.5265 which i can not find were this comes from (ref position was -.4689, which should be what posts for the X with only current written before adding in the scribe offset)

I am at my wits end, i have tried everything i can think, for my entire evening, many things, and like posting currentX (with Y coord because of swapped post) at different locations in the reference and pen down, etc, and i cannot get it to post the same location that it initially goes to to reference, the location it should, or get rid of the outer space move no matter what.

I am going to have to wait for more of your input Les!

Brian

I just found the problem. The rotary post processor is actually in two parts. The first part is what you see when you edit the post. The second part is called RotaryHelper. This part is loaded by these lines in the main post file:

package.path = sc.Globals&#58;Get&#40;&#41;.thisDir .. "/plugins/RotaryPlasma/?.lua"
require&#40;"rotaryhelper"&#41;

RotaryHelper intercepts OnMove, OnRapid etc and converts SheetCam’s flat X,Y coordinates to wrapped XYA coordinates. I just checked and it doesn’t intercept OnPenDown or OnPenUp so what you are seeing are the unwrapped X,Y coordinates. I’m working on a fix for this.

Give this a try. The file goes in c:\program files(x86)\SheetCam TNG\plugins\RotaryPlasma, replacing the current copy.

If im using the development version of sheetcam does it need to go under it instead of the TNG version? Im assuming so, and i did (saving a backup just in case) and it solved that problem, although now it posts…

N0010 (Filename: 1.5 square tube Chair test.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 11/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X-0.4689 Z1.5000 A0.0000
N0110 Z1.2500
N0120 M09
N0130 G28.1 Z1.06 F50.0
N0140 G92 Z0.9348
N0150 G00 Z1.6947
N0160 M08
N0170 G00 Z1.6947
N0180 Y0.9319 X-3.4400-----Correct! Yippie!
N0190 Z2.1947----Wrong and too high when im crunching stuff below my Z high limit! Doesn’t even need to post anything
N0200 G01 Y0.9345 X-3.4279 Z1.2500
N0210 G02 Y0.9243 X-3.4211 J-0.0145 I-0.0106

I will continue to look at it, but it changed when I changed the helper file, and i have to go back to work and get some stuff done now.


Thanks,
Brian

I discovered a flaw in the file I posted. Intercepting OnPenUp and OnPenDown causes more problems than it solves. I am making some changes to the plugin and hopefully I’ll have a solution for you tomorrow.

Right, I finally have a good solution. Don’t use the rotaryhelper I posted. Replace your OnPenDown and Reference functions with these:

function OnPenDown&#40;&#41;
   sc.QueryDll&#40;qryRAPIDY, endY, dllId&#41;
   local matZ = sc.QueryDll&#40;qryCHKEND, currentY, dllId&#41;
   if&#40;toolClass == "MarkerTool"&#41; or tool > 99 then
      if &#40;firstRef&#41; then
         local ez = endZ
         Reference&#40;&#41;
         local clearZ = sc.QueryDll&#40;qryGETSAFEZ, 0, dllId&#41; --guaranteed safe clearance height
         local ex = endX --cache end of move
         local ey = endY
         endX = currentX --don't move X,Y yet
         endY = currentY
         endZ = safeZ + &#40;clearZ - matZ&#41; --safe clearance hight
         if&#40;scriberZ >= 0&#41; then 
            offZ = scriberZ --use the highest offset to ensure everything clears
         end
         OnRapid&#40;&#41;
         currentY = endY --currentY changed when we last called OnRapid&#40;&#41; so reset it
         offZ = scriberZ --apply scriber offsets
         offX = scriberX
         offY = scriberY
         OnRapid&#40;&#41;
         currentY = endY
         endZ = ez --move down to cut height
         OnRapid&#40;&#41;
         endX = ex --restore move end coordinates
         endY = ey
      end
      --post.Text&#40;" M08\n"&#41;  --removed and done in toolchange instead
   else
      if&#40;dist >= refDistance&#41; then
         dist = 0
         Reference&#40;&#41;;
      end
      post.ModalText &#40;" G00"&#41;
      post.Text&#40;" Z"&#41;
      post.Number &#40;&#40;matZ + pierceHeight&#41;  * scale, "0.0000"&#41;
      post.Eol&#40;&#41;
      if &#40;preheat > 0&#41; then
         post.Text &#40;"\n G04 P"&#41;
         post.Number &#40;preheat,"0.###"&#41;
         post.Eol&#40;&#41;
      end
      post.Text &#40;"\n M03\n"&#41;
   end
   if &#40;pierceDelay > 0&#41; then
      post.Text &#40;" G04 P"&#41;
      post.Number &#40;pierceDelay,"0.###"&#41;
      post.Eol&#40;&#41;
   end
end


function Reference&#40;&#41;
   firstRef = false
   local matZ = sc.QueryDll&#40;qryCHKEND, endY, dllId&#41;
   if &#40;toolClass == "MarkerTool" or tool> 99&#41; then
      post.Text&#40;" M09\n"&#41;
   end
   if &#40;refHome&#41; then
      post.ModalText&#40;" G28.1 Z"&#41;
      post.Number&#40;&#40;3 + matZ&#41; * scale, "0.00"&#41;
   else
      post.ModalText&#40;" G31 Z -100"&#41;
   end
   post.ModalNumber &#40;" F", refFeed * scale, "0.0###"&#41;
   post.Eol&#40;&#41;
   post.ModalText&#40;" G92 Z"&#41;
   post.Number &#40;&#40;matZ - switchOffset&#41; * scale, "0.0000"&#41;
   post.Eol&#40;&#41;
   if &#40;toolClass == "MarkerTool" or tool > 99 &#41; then
      post.Text&#40;" M08\n"&#41;
   end
end

Using OnRapid() rather than directly outputting the moves allows RotaryHelper to intercept your move and do the XYZ->XYZA conversion.

The move to a guaranteed safe height before doing the scriber alignment move is probably overkill for round and rectangular section but it will be needed if you want to cut I-beams (I beams will be implemented in the next dev release).

Excellent, seems to solved that problem, although one line of the gcode is missing needs to be there.

N0010 (Filename: 1.5 square tube Chair test.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 12/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X-0.4689 Z1.5000 A0.0000
N0110 Z1.2500
N0120 M09
N0130 G28.1 Z0.87 F50.0
N0140 G92 Z0.7402
<----------needs to be here instead or also
N0150 M08
N0160 G00 Z1.6947 <----This line needs moved or copied above to insure scribe is above material when activated

N0170 Y0.9319 X-3.4400
N0180 Z1.2500
N0190 G01 Y0.9345 X-3.4279
N0200 G02 Y0.9243 X-3.4211 J-0.0145 I-0.0106
N0210 G01 Y0.9182 X-3.4206
N0220 Y0.8319 X-3.4317
N0230 Y0.8336 X-3.4295


I think the fix for this is to just put the line back into reference that was there before as long as it doesn’t mess with all the other changes and loops that have been made.

function Reference()
firstRef = false
local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
if (toolClass == “MarkerTool” or tool> 99) then
post.Text(" M09\n")
end
if (refHome) then
post.ModalText(" G28.1 Z")
post.Number((3 + matZ) * scale, “0.00”)
else
post.ModalText(" G31 Z -100")
end
post.ModalNumber (" F", refFeed * scale, “0.0###”)
post.Eol()
post.ModalText(" G92 Z")
post.Number ((matZ - switchOffset) * scale, “0.0000”)
post.Eol()
if (toolClass == “MarkerTool” or tool > 99 ) then
endz = safez ------------added
post.ModalText (" G00 Z") ------------added
post.Number ((matZ - switchOffset + endZ) * scale, “0.0000”) ------------added Wrong # posted but dont have time to fix now, will check later
post.Eol() ------------added
post.Text(" M08\n")
end
end

Also screwed something else up, but i gotta go, will fix later

Brian

Ok worked with it a little more while i was not in a rush.

Here is what i have so far

function Reference()
firstRef = false
local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
if (toolClass == “MarkerTool” or tool> 99) then
post.Text(" M09\n")
end
if (refHome) then
post.ModalText(" G28.1 Z")
post.Number((3 + matZ) * scale, “0.00”)
else
post.ModalText(" G31 Z -100")
end
post.ModalNumber (" F", refFeed * scale, “0.0###”)
post.Eol()
post.ModalText(" G92 Z")
post.Number ((matZ - switchOffset) * scale, “0.0000”)
post.Eol()
if (toolClass == “MarkerTool” or tool > 99 ) then
local clearZ = sc.QueryDll(qryGETSAFEZ, 0, dllId) --guaranteed safe clearance height ---------Added
endZ = (safeZ + clearZ) --safe clearance height ---------Added
post.ModalText (" G00") ---------Added
post.ModalNumber (" " … currentZAxis, (endZ + offZ) * scale, “0.0000”) ---------Added
post.Eol() ---------Added
post.Text(" M08\n")
end
end

And it puts out…

N0010 (Filename: 1.5 square tube Chair test.tap)
N0020 (Post processor: PlasmaRotary Mach3 swapped axes.scpost)
N0030 (Date: 12/11/2014)
N0040 G20 (Units: Inches)
N0050 F1
N0060 G53 G90 G40
N0070 G00 Z1.6947
N0080 (Part: 1.5 square tube Chair)
N0090 (Operation: No Offset, scribe, T202: Plate marker 50 FineCut)
N0100 G00 Y0.9315 X-0.4689 Z1.5000 A0.0000
N0110 Z1.2500
N0120 M09
N0130 G28.1 Z0.87 F50.0
N0140 G92 Z0.7402
N0150 G00 Z1.6947 ---------before M08 is good
N0160 M08
N0170 G00 -----------this is now empty, it will probably be ok, but not sure why it disappeared
N0180 Y0.9319 X-3.4400
N0190 Z1.2500
N0200 G01 Y0.9345 X-3.4279

Is this a good fix, and did i mess up any hidden things by grabbing that z height?

Thought i had a problem, but my A axis was switched again for some reason, fixed the problem, now we are good to go i think…

Brian

Your solution should work. I would put the M08 in OnPenDown():

function OnPenDown()
sc.QueryDll(qryRAPIDY, endY, dllId)
local matZ = sc.QueryDll(qryCHKEND, currentY, dllId)
if(toolClass == “MarkerTool”) or tool > 99 then
if (firstRef) then
local ez = endZ
Reference()
local clearZ = sc.QueryDll(qryGETSAFEZ, 0, dllId) --guaranteed safe clearance height
local ex = endX --cache end of move
local ey = endY
endX = currentX --don’t move X,Y yet
endY = currentY
endZ = safeZ + (clearZ - matZ) --safe clearance hight
if(scriberZ >= 0) then
offZ = scriberZ --use the highest offset to ensure everything clears
end
OnRapid()
post.Text(" M08\n")
currentY = endY --currentY changed when we last called OnRapid() so reset it
offZ = scriberZ --apply scriber offsets
offX = scriberX
offY = scriberY
OnRapid()
currentY = endY
endZ = ez --move down to cut height
OnRapid()
endX = ex --restore move end coordinates
endY = ey
end
–post.Text(" M08\n") --removed and done in toolchange instead
else
if(dist >= refDistance) then
dist = 0
Reference();
end
post.ModalText (" G00")
post.Text(" Z")
post.Number ((matZ + 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 M03\n”)
end
if (pierceDelay > 0) then
post.Text (" G04 P")
post.Number (pierceDelay,“0.###”)
post.Eol()
end
end

Wouldn’t this undo what i already changed? I modified it so that it does not activate the M8 Scribe solenoid every time it lifts because it takes too much time, not 100% consistent on lowering time, cycles the solenoid alot, and i can eliminate the start and end divot if it is already running and just lowered into the work and moved instead of being air plunged into the part hard.

That was the reasoning behind 1 M8 at scribe toolchange, and 1 M9 at toolchange from Scribe.

Unless I am reading the post code wrong and it would still function this way.

Brian

That part of the post only runs when it references so you will only see the M8 after it has referenced and lifted to a safe clearance height.