2 questions about postprocessors - need to customize them

Having problems with or questions about SheetCam? Post them here.
Post Reply
viesturs.lacis
Posts: 9
Joined: Wed Sep 17, 2014 11:29 am

2 questions about postprocessors - need to customize them

Post by viesturs.lacis »

Hello!

I need to adjust SheetCAM postprocessor for 2 different waterjet cutting machines. I am using "EMC plasma" postprocessor as my starting point, because they run LinuxCNC. One machine has weak Z axis motor, so I need to limit the velocity for Z axis moves, which I intend to do by using G01 (and set the feedrate in postprocessor as that does not need to change), instead of G00. For the other machine I need to insert specific command, when lifting and another command, when lowering the nozzle instead of particular Z coordinate. For both of these customizations I intend to use "OnPenDown()" and "OnPenUp()" functions (I did some tests and that part seemed good). But existing config of "OnRapid()" interferes with my plan, so I have 2 questions about SheetCAM postprocessors:
1) how can I remove Z axis from "OnRapid()" function?
I tried by removing this line from "OnRapid()":
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
But the problem with this approach is that it does leave a blank "G00 " command, when it wants to move Z axis, for example, at the very beginning, when lifting Z to rapid clearance plane etc.
2) there are "cutHeight" and "pierceHeight" variables used in postprocessor; is there such a variable for rapid clearance height? I already figured out, that "rapidHeight" does not exist :)

Thanks in advance!
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: 2 questions about postprocessors - need to customize the

Post by Les Newell »

viesturs.lacis wrote:One machine has weak Z axis motor, so I need to limit the velocity for Z axis moves, which I intend to do by using G01 (and set the feedrate in postprocessor as that does not need to change), instead of G00.
It would be better to limit the motor's speed in LinuxCNC. Doing it in the post is not ideal but if you have to do it that way you can do something like this:

Code: Select all

if (endZ == currentZ) then --if Z axis doesn't move
   post.ModalText(" G00")
else
   post.ModalText(" G01")
   post.ModalNumber (" F", 1000 * scale, "0.###")
end
In that example I used 1000mm/min but of course you can use any feed rate you like. Note that the feed rate value should be in mm/min even if you are using inc units.
1) how can I remove Z axis from "OnRapid()" function?
I tried by removing this line from "OnRapid()":
post.ModalNumber (" Z", (endZ + toolOffset) * scale, "0.0000")
But the problem with this approach is that it does leave a blank "G00 " command, when it wants to move Z axis, for example, at the very beginning, when lifting Z to rapid clearance plane etc.
Use this:

Code: Select all

function OnRapid()
  if&#40;math.hypot&#40;endX - currentX, endY - currentY&#41; < 0.001&#41; then return end
This exits the function if there is no X-Y movement.
2) there are "cutHeight" and "pierceHeight" variables used in postprocessor; is there such a variable for rapid clearance height? I already figured out, that "rapidHeight" does not exist :)
For historical reasons this variable is called safeZ.

If you go to Options->machine->post processor and click on the 'Post documentation' button you will see a list of the available functions and variables.
viesturs.lacis
Posts: 9
Joined: Wed Sep 17, 2014 11:29 am

Re: 2 questions about postprocessors - need to customize the

Post by viesturs.lacis »

Les Newell wrote:It would be better to limit the motor's speed in LinuxCNC.
Yes, of course, and that is what I tried. That means that maxvel and maxaccel settings for particular joint are smaller than maxvel and maxaccel in [TRAJ] section of INI file (so that it does not slow down movement in XY plane). The problem is that for some reason I do not yet know, all rapids are done at limits, specified in [TRAJ] even if it exceeds joints' limitations. So that is why I am trying doing this in postprocessor.

Thank you, Les, for suggestions, I will give them a try!
KenioGomes
Posts: 1
Joined: Wed Sep 23, 2015 7:39 pm

POS PROCESSADOR

Post by KenioGomes »

GOSTARIA DE UMA AJUDA NA EDIÇAO DO POS;

PRECISO GERAR O CODIGO G;

INICIE COM %
FINALIZE COM #
INTERPOLAÇÃO COMO G1
G98 OXICORTE

POSSUO SOMENTE X E Y
Post Reply