Rotary plugin and Macros within control

Having problems with or questions about SheetCam? Post them here.
Post Reply
scotg1107
Posts: 3
Joined: Tue Feb 17, 2015 4:27 pm

Rotary plugin and Macros within control

Post by scotg1107 »

I'm currently working on a rotary post for a centroid acorn plasma They have pre-programmed macros for OnPenUp and OnPenDown will those still work with the rotary plugin or do I have to make sure all those commands are done with-in the post?

here is what the post currently has:

`function OnPenDown()
post.Text ("M61\n")
end


function OnPenUp()
post.Text ("M62\n")
end`
User avatar
djreiswig
Posts: 484
Joined: Sat Feb 20, 2016 4:47 am
Location: SE Nebraska

Re: Rotary plugin and Macros within control

Post by djreiswig »

Guessing you will want them in the post since it will need to calculate the z moves for the tubing dimensions.
scotg1107
Posts: 3
Joined: Tue Feb 17, 2015 4:27 pm

Re: Rotary plugin and Macros within control

Post by scotg1107 »

There is no reference command in that post either, my other idea was to do the standard rotary post with this as the reference function

function Reference()
firstRef = false
local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
post.ModalText(" m38")
post.Eol()

M38 is a macro I edited so that it just references z then travels up to pierce height, to the best of my knowledge centroid does not have a probing gcode

I'm gessing that local matZ = sc.QueryDll(qryCHKEND, endY, dllId) is making sure that there isnt a collision when safe height traveling to a new reference location with anything other than round tubing? So really I need a straight probing command for centroid and do the rest through sheetcam's post.
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: Rotary plugin and Macros within control

Post by Les Newell »

Do you know what the M61 and M62 macros are actually doing?

The problem with rotary cutting is that if you are cutting anything other than round tube the surface height varies depending on the angle. For that reason SheetCam uses z=0 as the centre of rotation, not the surface. This code:

Code: Select all

local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
is getting the current calculated surface height, taking the angle of rotation into account. If your M61 macro zeros the Z axis on the surface of the tube you can use this value to add an offset after referencing so that the Acorn's coordinate system matches SheetCam's coordinate system.
scotg1107
Posts: 3
Joined: Tue Feb 17, 2015 4:27 pm

Re: Rotary plugin and Macros within control

Post by scotg1107 »

Right now my custom macro in centroid does a touch reference, sets z zero at the top of the material and raises the torch at .08" above the material. I don't believe I can keep the torch at z0 because the macro is checking for no continuity between the ohmic sensor and the material. If I'm thinking about this correctly I'll just treat that new .08" Like the float switch offset value and I should be good to go.

Code: Select all

function Reference()
   firstRef = false
   local matZ = sc.QueryDll(qryCHKEND, endY, dllId)
   post.ModalText(" m38")
   post.Eol()
   post.ModalText(" G92 Z")
   post.Number ((matZ + switchOffset) * scale, "0.0000")
   post.Eol()
   
User avatar
Les Newell
Site Admin
Posts: 3668
Joined: Thu May 11, 2006 8:12 pm

Re: Rotary plugin and Macros within control

Post by Les Newell »

Yes, that should work, as long as the M38 macro always leaves the torch at 0.08". If not add a G0 move to the switch offset.
Post Reply