Post processor problem WCS G54 G55

Post processor problem WCS G54 G55

emzy4k
Participant Participant
1,914 Views
10 Replies
Message 1 of 11

Post processor problem WCS G54 G55

emzy4k
Participant
Participant

Hi im trying to modify my post processor for multiple offsets . but it dont got in... 

Do i need to specify it before i write in to ´´ function on Section ´´ ??

 

 

// wcs
if (insertToolCall) { // force work offset when changing tool
currentWorkOffset = undefined;
}
var workOffset = currentSection.workOffset;
if (workOffset == 0) {
warningOnce(localize("Work offset has not been specified. Using G54 as WCS."), WARNING_WORK_OFFSET);
workOffset = 1;
}
if (workOffset > 0) {
if (workOffset > 6) {
var p = workOffset; // 1->... // G59 P1 is the same as G54 and so on
if (p > 254) {
error(localize("Work offset out of range."));
} else {
if (workOffset != currentWorkOffset) {
writeBlock(gFormat.format(59), "P" + p); // G59 P
currentWorkOffset = workOffset;
}
}
} else {
if (workOffset != currentWorkOffset) {
writeBlock(gFormat.format(53 + workOffset)); // G54->G59
currentWorkOffset = workOffset;
}
}
}

0 Likes
1,915 Views
10 Replies
Replies (10)
Message 2 of 11

ArjanDijk
Advisor
Advisor

I'm not shure what you want to achieve. Can you show the code you get now and the code you want?


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 3 of 11

emzy4k
Participant
Participant

Hi yes and thank you for reply 🙂
Now my post processor dont show work offset  like G54 or G55 in Gcode for my machine. 
and im planing to work with multiple work offsets so need to change post processor ... 

Now im getting this 
G90
G21
G64 P0.0254
G00 Z20.500
S 1800
M03
(--- Drill14 ---)
S 1800
M08
G43 H1
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z10.500
G00 X29.000 Y36.000 Z9.500
G01 X29.000 Y36.000 Z0.500 F100
G00 X29.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z9.500
G01 X169.000 Y36.000 Z0.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z20.500
(--- Drill14 ---)
S 1800
M08
G43 H1
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z10.500
G00 X29.000 Y36.000 Z9.500
G01 X29.000 Y36.000 Z0.500
G00 X29.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z9.500
G01 X169.000 Y36.000 Z0.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z20.500
G00 Z20.500
M9
M5
G49
M2

 

 

And i want this 
G90
G21
G64 P0.0254
G00 Z20.500
S 1800
M03
(--- Drill14 ---)
S 1800
M08
G54
G43 H1
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z10.500
G00 X29.000 Y36.000 Z9.500
G01 X29.000 Y36.000 Z0.500 F100
G00 X29.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z9.500
G01 X169.000 Y36.000 Z0.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z20.500
(--- Drill14 ---)
S 1800
M08
G55
G43 H1
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z20.500
G00 X29.000 Y36.000 Z10.500
G00 X29.000 Y36.000 Z9.500
G01 X29.000 Y36.000 Z0.500
G00 X29.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z9.500
G01 X169.000 Y36.000 Z0.500
G00 X169.000 Y36.000 Z10.500
G00 X169.000 Y36.000 Z20.500
G00 Z20.500
M9
M5
G49
M2


I did attach my post processor file if someone want to look at it ... 

0 Likes
Message 4 of 11

emzy4k
Participant
Participant

What i did to post processor is 

 

 

if (workOffset = 1) {

var workOffset = currentSection.workOffset;

writeln("G" + 53 + workOffset ); 

what kind of work i just need to sum numbers 53 with 1-6 from current position... 
but have no idea how

 

0 Likes
Message 5 of 11

ArjanDijk
Advisor
Advisor
What you are trying is standard functionality. No need to change the post. In the setup choose "multiple wc's offset" in the last tab and set the standard offset to 1.

Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 6 of 11

emzy4k
Participant
Participant

🙂 Yes that is what im doing to get specific number from fusion for specific section , number like ( 1-6 )..
And those im getting in dump file

currentSection.unit=1
currentSection.workOrigin=(0, 0, 0)
currentSection.workPlane=[[1, 0, 0], [0, 1, 0], [0, 0, 1]]
currentSection.wcsOrigin=(0, 0, 0)
currentSection.wcsPlane=[[1, 0, 0], [0, 1, 0], [0, 0, 1]]
currentSection.workOffset=2
currentSection.dynamicWCSOrigin=(0, 0, 0)
currentSection.dynamicWCSPlane=[[1, 0, 0], [0, 1, 0], [0, 0, 1]]
currentSection.dynamicWorkOffset=2

 

But im not getting numbers 54-59 in Gcode , thats why i need postprocessor
I will do some screen shots for you 🙂 

0 Likes
Message 7 of 11

emzy4k
Participant
Participant

This are some screen shots

0 Likes
Message 8 of 11

emzy4k
Participant
Participant

Done 😄 
iv just put    "G" + [ 53 + workOffset ] 
in those parenthesis and it working like i want ... >D

0 Likes
Message 9 of 11

ArjanDijk
Advisor
Advisor

Its pretty brave what you accomplished, but I still don't know why you needed a post edit?

 

This is what I get with the standard ISO post, which is just what you asked, isnt it?

 

WCSedit.JPGmultwcsiso.JPG


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 10 of 11

emzy4k
Participant
Participant

😄 thanks 
ive  needed it because i have chines cnc controll and works just in specific Gcode format, 
Ive tryed tormach, mach3, fanuc postprocesses - non has worked

Anyway thank you and i hope all those screenshots will help to someone else too ... 

0 Likes
Message 11 of 11

zaratiegui.137947
Community Visitor
Community Visitor

what worked for me is to edit and add a ' before the G so it outputs 'G54 as a comment

// wcs definiton
wcsDefinitions = {
useZeroOffset: false,
wcs : [
{name:"Standard", format:"'G", range:[54, 59]},
{name:"Extended", format:"G59 P", range:[7, 28]}
]
};

0 Likes