Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

G5.1Q1 Help


Recommended Posts

I have “Advanced Look Ahead” turned on for my contouring but even though I have it turned of for the drilling (because it doesn’t work for that cycle) it still posts out with my drilling cycles.

 

this is from my post MpMaster

 

code:

 

phsm1_on #High speed functions before G43

if opcode$ = 3 | opcode$ = 16,

[

mr1$ = 0

mr2$ = 0

]

if mr1$ = 1 & mr1_flg <> 1, #Advanced Preview (look-ahead) control - G08 P1

[

pbld, n$, "G8", "P1", "(","LOOK AHEAD ON",")", e$

mr1_flg = 1

]

if opcode$ <> 2,

[

mr1$ = 2

mr2$ = 0

]

if mr1$ = 2, #AI-NANO 2, AI(nano)CC output (Artificial Intelligence Contour Control) - G05.1 Q1

[

#pbld, n$, *sg49, e$ #Must be in G49 and remain before G43

if ipr_type > 1, ipr_type = 0 #Must be in G94

#pbld, n$, sgfeed, e$

pbld, n$, "G5.1", "Q1", "(","LOOK AHEAD ON",")", [if mr2$, "R", no_spc$, *mr2$], e$ #Mr2 gives accel/decel value/coefficient, usually R or P

mr1_flg = 2

]

 

phsm2_on #High speed functions after G43

if opcode$ = 3 | opcode$ = 16,

[

mr1$ = 0

mr2$ = 0

]

if mr1$ = 3 & mr1_flg <> 3, #AI-HPCC and AI-nanoHPCC (High Precision Contour Control) - G5 P10000

[

if ipr_type > 1, ipr_type = 0 #Must be in G94

pbld, n$, sgfeed, e$

pbld, n$, "G5", "P10000", [if mr2$, "R", no_spc$, *mr2$], e$

#pbld, n$, "G5.1", "Q1", "(","LOOK AHEAD ON",")", e$ #auto arc filtering

mr1_flg = 3

]

if mr1$ = 4 & mr1_flg <> 4, #Mazak Geometry Compensation/Accuracy G61.1, Mazak High Speed Machining Mode - G05 P2

[

pbld, n$, sgfeed, e$ #Mazak can be in G94 or G95 but it must be called before G05 P2

if mr2$, pbld, n$, "G61.1", ",K", no_spc$, *mr2$, e$ #Mr2 gives accel/decel value/coefficient, K

else, pbld, n$, "G61.1", e$

pbld, n$, "G05", "P2", e$

mr1_flg = 4

!convert_rpd$ #Mazak Fusion requires high feed motion only, comment out for Matrix

convert_rpd$ = one #Mazak Fusion requires high feed motion only, comment out for Matrix

]

 

phsm_off #High speed functions off

if mr1_flg = 1, #Advanced Preview (look-ahead) control - G08 P1

[

pbld, n$, "G8", "P0", e$

mr1_flg = 0

]

if mr1_flg = 2, #AI-NANO 2, AI(nano)CC output (Artificial Intelligence Contour Control) - G05.1 Q1

[

pbld, n$, "G5.1", "Q0", "(","LOOK AHEAD OFF",")", e$

mr1_flg = 0

]

if mr1_flg = 3, #AI-HPCC and AI-nanoHPCC (High Precision Contour Control) - G5 P10000

[

#pbld, n$, "G5.1", "Q0", e$ #auto arc filtering

#pbld, n$, "G5", "P0", e$

mr1_flg = 0

]

if mr1_flg = 4, #Mazak Geometry Compensation/Accuracy G61.1, Mazak High Speed Machining Mode - G05 P2

[

pbld, n$, "G5", "P0", e$

pbld, n$, "G64", e$

mr1_flg = 0

convert_rpd$ = prv_convert_rpd$ #Mazak Fusion requires high feed motion only, comment out for Matrix

]


code:

 

ptlchg_com #Tool change common blocks

if force_output | sof,

[

result = force(ipr_type,ipr_type)

result = force(absinc$,absinc$)

result = force(plane$,plane$)

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#ptoolcomment

if sof & scomm_sav <> snull,

[

spaces$ = 0

n$, pspc, scomm_str, *scomm_sav, scomm_end, e$

spaces$ = sav_spc

]

if sof = 0, scomm_sav = snull

#comment$

#pcomment3

pmisccheck

pcan

 

if stagetool >= zero,

[

if omitseq$ = 1 & tseqno > 0,

[

if tseqno = 2, n$ = t$

pbld, *n$, *sgabsinc, *t$, "M6", ptoolcomm, e$

]

else, pbld, n$, *t$, "M6", ptoolcomm, e$

]

spaces$=0

if output_z = yes$,

[

preadbuf5

if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,

[

n$, pspc, scomm_str, "MAX - ", *max_depth, scomm_end, e$

n$, pspc, scomm_str, "MIN - ", *min_depth, scomm_end, e$

]

]

spaces$=sav_spc

pstock

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

pindex

if safe_index,

[

#if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pcan1, pbld, n$, *sgcode, sgfeed, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, "(", 34 , "A", 34 , " UNCLAMP)", e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$

]

else,

[

#if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pcan1, pbld, n$, *sgcode, sgfeed, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfxout, pfyout, pfcout,

pfspindleout, pstage_t, [if gcode$ = 1, *feed], strcantext, e$, #next_tool$,

#if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

#phsm1_on #must remain before G43

#pbld, n$, "G43", *tlngno$, pfzout, scoolant, next_tool$, e$

pbld, n$, "G43", *tlngno$, pfzout, *scoolant, [if coolant$ = 3, coolthru_flg=1, pbld, n$, "(", "HIGH PRESSURE ON", ")", ], e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *slock, "(", 34 , "A", 34 , " CLAMP)", e$

#phsm1_on #must remain before G43

pcan2 #Added so M and G codes in canned text will output before phsm2_on

#phsm2_on #must remain after G43

#if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=1

absinc$ = sav_absinc

pcom_movea

phsm1_on

toolchng = zero

c_msng$ #Single tool subprogram call

plast

 

ptlchg0$ #Call from NCI null tool change (tool number repeats)

toolchng0 = one

if op_id$ <> last_op_id,

[

rd_params$ # Read parameters - pparameter

pmisccheck

]

pcuttype

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

retractflg = 0

if (mi10$ & (op_id$ <> last_op_id | (op_id$ = last_op_id & xform_op_id$ <> op_id$)))

| ((tlplnno$ <> last_tlplnno | rotary_type$ <> last_rotary_type) & ret_on_indx),

[

phsm_off

if mi10$,

[

pretract

n$, *sm00, e$

result = force(spdir2,spdir2) #Force spindle output after M00

result = force(speed,speed) #Force speed output after M00

]

else, pretract0

retractflg = 1

]

else,

[

if mr1$ <> last_mr1 | mr2$ <> last_mr2, phsm_off

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#comment$

#pcomment3

pcan

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

if op_id$ <> last_op_id, pbld, n$, sgplane, e$

pspindchng

if coolant$ <> 0 & coolant$ <> sav_coolant & sav_coolant, pbld, n$, sm09, e$

#pbld, n$, sccomp, scoolant, psub_end_mny, "S200", e$

pbld, n$, scoolant, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=

#if coolthru_flg=1, pbld, n$, "HIGH PRESURE ON", e$

if op_id$ <> last_op_id, pstock

if sav_mi9 = 1, workofs$ = sav_workofs

if (wcstype > one & workofs$ <> prv_workofs$) | (tlplnno$ <> last_tlplnno) | retractflg,

[

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

sav_absinc = absinc$

absinc$ = zero

pindex

if retractflg,

[

if safe_index,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

pbld, n$, pfxout, pfyout, e$

]

else,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfxout, pfyout, pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

# phsm1_on #must remain before G43

pbld, n$, "G43", *tlngno$, pfzout, *scoolant, [if coolant$ = 3, coolthru_flg=1, pbld, n$, "(", "HIGH PRESSURE ON", ")", ], e$, #scoolant, e$

# phsm2_on #must remain after G43

]

else,

[

if fmtrnd(prv_cabs) <> fmtrnd(cabs),

[

if safe_index,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, [if not(index), sgabsinc, pwcs], pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

pbld, n$, pfxout, pfyout, e$

]

else,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, "(", 34 , "A", 34 , " UNCLAMP)", e$

pbld, n$, [if not(index), sgabsinc, pwcs], pfxout, pfyout, pfcout, e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *slock, "(", 34 , "A", 34 , " CLAMP)", e$

]

#pbld, n$, pfzout, e$

]

else,

[

pbld, n$, sgabsinc, [if not(index), pwcs], pfxout, pfyout, pcout, e$ #pfzout,

]

]

pe_inc_calc

ps_inc_calc

absinc$ = sav_absinc

]

if lock_codes = one & cuttype <> last_cuttype & cuttype > 0, pbld, n$, *sunlock, sunlockcomm, e$

if cuttype = zero, ppos_cax_lin

if lock_codes = one & cuttype <> last_cuttype & cuttype = 0 & fmtrnd(prv_cabs) = fmtrnd(cabs), pbld, n$, *slock, slockcomm, e$

if gcode$ = one, plinout

else, prapidout

pcom_movea

if retractflg = 0, #output if not forced output above with the G43

[

# phsm1_on

# phsm2_on

]

c_msng$ #Single tool subprogram call

plast

toolchng0 = zero

 


any help would be great?

Link to comment
Share on other sites

Matt,

That didn't work

 

Tony,

No the only thing I can think it might have to do with is "ptlchg" or "pretract"

 

When I use 1 in the misc values "reals" it works but when I use 2 it doesn't it should work the same no matter what.

code:

ptlchg_com      #Tool change common blocks

if force_output | sof,

[

result = force(ipr_type,ipr_type)

result = force(absinc$,absinc$)

result = force(plane$,plane$)

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#ptoolcomment

if sof & scomm_sav <> snull,

[

spaces$ = 0

n$, pspc, scomm_str, *scomm_sav, scomm_end, e$

spaces$ = sav_spc

]

if sof = 0, scomm_sav = snull

#comment$

#pcomment3

pmisccheck

pcan

 

if stagetool >= zero,

[

if omitseq$ = 1 & tseqno > 0,

[

if tseqno = 2, n$ = t$

pbld, *n$, *sgabsinc, *t$, "M6", ptoolcomm, e$

]

else, pbld, n$, *t$, "M6", ptoolcomm, e$

]

spaces$=0

if output_z = yes$,

[

preadbuf5

if (opcode$ > 0 & opcode$ < 16) | opcode$ = 19,

[

n$, pspc, scomm_str, "MAX - ", *max_depth, scomm_end, e$

n$, pspc, scomm_str, "MIN - ", *min_depth, scomm_end, e$

]

]

spaces$=sav_spc

pstock

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

sav_absinc = absinc$

if wcstype > one, absinc$ = zero

pindex

if safe_index,

[

#if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pcan1, pbld, n$, *sgcode, sgfeed, sgplane, [if not(index), sgabsinc, pwcs], pfcout, strcantext, e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, "(", 34 , "A", 34 , " UNCLAMP)", e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pbld, n$, sgcode, [if gcode$ = 1, sgfeed], pfxout, pfyout, pfspindleout, [if gcode$ = 1, *feed], e$

]

else,

[

#if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

pcan1, pbld, n$, *sgcode, sgfeed, sgplane, [if not(index), sgabsinc, pwcs], [if gcode$ = 1, sgfeed], pfxout, pfyout, pfcout,

pfspindleout, pstage_t, [if gcode$ = 1, *feed], strcantext, e$, #next_tool$,

#if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

#phsm1_on #must remain before G43

#pbld, n$, "G43", *tlngno$, pfzout, scoolant, next_tool$, e$

pbld, n$, "G43", *tlngno$, pfzout, *scoolant, [if coolant$ = 3, coolthru_flg=1, pbld, n$, "(", "HIGH PRESSURE ON", ")", ], e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *slock, "(", 34 , "A", 34 , " CLAMP)", e$

#phsm1_on #must remain before G43

pcan2 #Added so M and G codes in canned text will output before phsm2_on

#phsm2_on #must remain after G43

#if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=1

absinc$ = sav_absinc

pcom_movea

phsm1_on

toolchng = zero

c_msng$ #Single tool subprogram call

plast

 

ptlchg0$ #Call from NCI null tool change (tool number repeats)

toolchng0 = one

if op_id$ <> last_op_id,

[

rd_params$ # Read parameters - pparameter

pmisccheck

]

pcuttype

toolcount = toolcount + 1

if toolcountn <= tooltotal, nexttool = rbuf(4,toolcountn)

else, nexttool = first_tool$

retractflg = 0

if (mi10$ & (op_id$ <> last_op_id | (op_id$ = last_op_id & xform_op_id$ <> op_id$)))

| ((tlplnno$ <> last_tlplnno | rotary_type$ <> last_rotary_type) & ret_on_indx),

[

phsm_off

if mi10$,

[

pretract

n$, *sm00, e$

result = force(spdir2,spdir2) #Force spindle output after M00

result = force(speed,speed) #Force speed output after M00

]

else, pretract0

retractflg = 1

]

else,

[

# if mr1$ <> last_mr1 | mr2$ <> last_mr2, phsm_off

]

pcom_moveb

pcheckaxis #Check for valid rotary axis

c_mmlt$ #Multiple tool subprogram call

#comment$

#pcomment3

pcan

if plane$ < 0 | opcode$ = 3 | opcode$ = 16, plane$ = 0

if op_id$ <> last_op_id, pbld, n$, sgplane, e$

pspindchng

if coolant$ <> 0 & coolant$ <> sav_coolant & sav_coolant, pbld, n$, sm09, e$

#pbld, n$, sccomp, scoolant, psub_end_mny, "S200", e$

pbld, n$, scoolant, e$

sav_coolant = coolant$

if coolant$ = 1, sm09 = sm09_0

if coolant$ = 2, sm09 = sm09_1

if coolant$ = 3, sm09 = sm09_2

if coolant$ = 3, coolthru_flg=

if op_id$ <> last_op_id, pstock

if sav_mi9 = 1, workofs$ = sav_workofs

if (wcstype > one & workofs$ <> prv_workofs$) | (tlplnno$ <> last_tlplnno) | retractflg,

[

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

sav_absinc = absinc$

absinc$ = zero

pindex

if retractflg,

[

if safe_index,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

pbld, n$, pfxout, pfyout, e$

]

else,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, pgear, e$

pbld, n$, *sgcode, [if not(index), sgabsinc, pwcs], pfxout, pfyout, pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

# phsm1_on #must remain before G43

pbld, n$, "G43", *tlngno$, pfzout, *scoolant, [if coolant$ = 3, coolthru_flg=1, pbld, n$, "(", "HIGH PRESSURE ON", ")", ], e$, #scoolant, e$

# phsm2_on #must remain after G43

]

else,

[

if fmtrnd(prv_cabs) <> fmtrnd(cabs),

[

if safe_index,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, [if not(index), sgabsinc, pwcs], pfcout, e$

if lock_codes = one & not(index) & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

pbld, n$, pfxout, pfyout, e$

]

else,

[

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, "(", 34 , "A", 34 , " UNCLAMP)", e$

pbld, n$, [if not(index), sgabsinc, pwcs], pfxout, pfyout, pfcout, e$

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *slock, "(", 34 , "A", 34 , " CLAMP)", e$

]

#pbld, n$, pfzout, e$

]

else,

[

pbld, n$, sgabsinc, [if not(index), pwcs], pfxout, pfyout, pcout, e$ #pfzout,

]

]

pe_inc_calc

ps_inc_calc

absinc$ = sav_absinc

]

if lock_codes = one & cuttype <> last_cuttype & cuttype > 0, pbld, n$, *sunlock, sunlockcomm, e$

if cuttype = zero, ppos_cax_lin

if lock_codes = one & cuttype <> last_cuttype & cuttype = 0 & fmtrnd(prv_cabs) = fmtrnd(cabs), pbld, n$, *slock, slockcomm, e$

if gcode$ = one, plinout

else, prapidout

pcom_movea

if retractflg = 0, #output if not forced output above with the G43

[

phsm1_on

# phsm2_on

]

c_msng$ #Single tool subprogram call

plast

toolchng0 = zero

 

plast

last_op_id = op_id$

last_cuttype = cuttype

last_rotary_type = rotary_type$

last_tlplnno = tlplnno$

last_mr1 = mr1$

last_mr2 = mr2$

 


code:

pretract        #End of tool path, toolchange

phsm_off

sav_absinc = absinc$

absinc$ = one

sav_coolant = coolant$

coolant$ = zero

 

# if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless

# [ # explicitely turned off through a canned text edit

if all_cool_off,

[

 

#all coolant off with a single off code here

if coolant_on, pbld, n$, *sall_cool_off, e$

coolant_on = zero

]

else,

[

local_int = zero

coolantx = zero

while local_int < 20,

[

coolantx = and(2^local_int, coolant_on)

local_int = local_int + one

if coolantx > zero,

[

coolantx = local_int

pbld, n$, scoolantx, e$

]

coolantx = zero

]

coolant_on = zero

]

# ]

 

#cc_pos is reset in the toolchange here

cc_pos$ = zero

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

else, gcode$ = zero

if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, "(", 34 , "A", 34 , " UNCLAMP)", e$

pbld, n$, sccomp, psub_end_mny, *scoolant, "S200", e$

pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", *sm05, [if gcode$ = 1, feed], scoolant, e$

if coolthru_flg=1, pbld, n$, *pcthru, e$

pbld, n$, *scc0, *sg49, e$

#if lock_codes = one & not(index) & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

#pbld, n$, *sg28, "Y0.", protretinc, e$

#if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),

[

if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$

rotretflg = 1

pbld, n$, `sg28, protretinc, e$

rotretflg = 0

if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

absinc$ = sav_absinc

coolant$ = sav_coolant

 

pretract0 #End of tool path, null toolchange

phsm_off

sav_absinc = absinc$

absinc$ = one

# sav_coolant = coolant$

# coolant$ = zero

 

## if nextop$ = 1003, #Uncomment this line to leave coolant on until eof unless

## [ # explicitely turned off through a canned text edit

# if all_cool_off,

# [

# #all coolant off with a single off code here

# if coolant_on, pbld, n$, *sall_cool_off, e$

# coolant_on = zero

# ]

# else,

# [

# local_int = zero

# coolantx = zero

# while local_int < 20,

# [

# coolantx = and(2^local_int, coolant_on)

# local_int = local_int + one

# if coolantx > zero,

# [

# coolantx = local_int

# pbld, n$, scoolantx, e$

# ]

# coolantx = zero

# ]

# coolant_on = zero

# ]

## ]

 

#cc_pos is reset in the toolchange here

cc_pos$ = zero

if convert_rpd$ = one,

[

gcode$ = one

feed = maxfeedpm

ipr_type = zero

]

else, gcode$ = zero

# pbld, n$, sccomp, *sm05, psub_end_mny, e$

#pbld, n$, sccomp, psub_end_mny, e$

pbld, n$, scoolant, "S200", e$

pbld, n$, sgabsinc, sgcode, [if gcode$ = 1, sgfeed], *sg28, "Z0.", *sm05, [if gcode$ = 1, feed], e$ #scoolant,

if coolthru_flg=1, pbld, n$, *pcthru, e$

#pbld, n$, *scc0, *sg49, e$

#if lock_codes = one & rot_on_x, pbld, n$, *sunlock, sunlockcomm, e$

pbld, n$, *sg28, "X0.", "Y0.", protretinc, e$

#if lock_codes = one & rot_on_x & cuttype = 0, pbld, n$, *slock, slockcomm, e$

if abs(fmtrnd(cabs)) > 360 & nextop$ <> 1003 & not(index),

[

if lock_codes = one, pbld, n$, *sunlock, sunlockcomm, e$

rotretflg = 1

pbld, n$, `sg28, protretinc, e$

rotretflg = 0

if lock_codes = one & cuttype = 0, pbld, n$, *slock, slockcomm, e$

]

absinc$ = sav_absinc

coolant$ = sav_coolant

 


Link to comment
Share on other sites

Ted,

 

I think the problem is in the resetting of mr1$ and mr2$ that is going on in these postblcks. Which is what I mentioned in my last email with the most recent fixes.

 

If you look at the logic just above where the G5.1 line is you will see it checks opcode not equal to 2 (anything other than contour toolpaths) and resets mr1 and mr2.

 

code:

     if opcode$ <> 2,

[

mr1$ = 2

mr2$ = 0

]


If you look at the logic at the beginning of the postblock it resets mr1 and mr2 based on if it is drilling which would cause the output to not occur in a drilling situation.

 

code:

phsm1_on         #High speed functions before G43 

if opcode$ = 3 | opcode$ = 16,

[

mr1$ = 0

mr2$ = 0

]


I don't have the post in front of me right now so I'm not sure what or how mr1_flg is set and used but Matt might be on to something.

 

If you remember, the first piece of logic above where it is checking for opcode not equal to 2 was one of the logic problems in your post found when updating to X4. You could simply comment out the entire set of logic like shown below to see if it cleans it up for you. I never could figure why this check was in there.

 

code:

   #  if opcode$ <> 2,

# [

# mr1$ = 2

# mr2$ = 0

# ]


I'd prefer to look over the entire post and code first before I suggest the proper fix and I can do that later today. Let me know what you think.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

I ALWAYS change the logic to

 

if opcode <> 3, mr1$=2 (Or whatever type you use)

 

that way it's always on unless it's a drilling type cycle.

Link to comment
Share on other sites
Guest CNC Apps Guy 1

cont...

 

code:

phsm1_on         #High speed functions before G43

# 1 = Look Ahead - G8P1

# 2 = SHPCC or AI-NANO1 - G5.1 Q1

# 3 = HPCC or AI-NANO2 - G5 P10000

#*******************************************

if opcode$ <>3, mr1$=3 # Current State - Forcing AI-NANO on

if mr1$ = 1 & mr1_flg <> 1, #Advanced Preview (look-ahead) control - G08 P1

[

pbld, n$, "G8", "P1", e$

mr1_flg = 1

]

if mr1$ = 2, #AI-NANO 2, AI(nano)CC output (Artificial Intelligence Contour Control) - G5.1 Q1

[

if ipr_type > 1, ipr_type = 0 #Must be in G94

pbld, n$, sgfeed, e$

pbld, n$, "G5.1", "Q1", [if mr2$, "R", no_spc$, *mr2$], "(AI-NANO ON)", e$ #Mr2 gives accel/decel value/coefficient, usually R or P

mr1_flg = 2

]

code:

phsm2_on         #High speed functions after G43             

if mr1$ = 3 & mr1_flg <> 3, #AI-HPCC and AI-nanoHPCC (High Precision Contour Control) - G5 P10000

[

if ipr_type > 1, ipr_type = 0 #Must be in G94

pbld, n$, sgfeed, e$

pbld, n$, "G5", "P10000", "(HPCC ON)", e$

#pbld, n$, "G5.1", "Q2", e$ #auto arc filtering

mr1_flg = 3

]

if mr1$ = 4 & mr1_flg <> 4, #Mazak Geometry Compensation/Accuracy G61.1, Mazak High Speed Machining Mode - G05 P2

[

pbld, n$, sgfeed, e$ #Mazak can be in G94 or G95 but it must be called before G05 P2

pbld, n$, "G61.1", [if ? ,",K", no_spc$, *mr2$], e$ #Mr2 gives accel/decel value/coefficient, K

pbld, n$, "G5", "P2", e$

mr1_flg = 4

]

code:

phsm_off

if mr1_flg = 1, #Advanced Preview (look-ahead) control - G08 P1

[

pbld, n$, "G8", "P0", e$

mr1_flg = 0

]

if mr1_flg = 2, #AI-NANO 2, AI(nano)CC output (Artificial Intelligence Contour Control) - G5.1 Q1

[

pbld, n$, "G5.1", "Q0", "(AI-NANO OFF)", e$

mr1_flg = 0

]

if mr1_flg = 3, #AI-HPCC and AI-nanoHPCC (High Precision Contour Control) - G5 P10000

[

pbld, n$, "G5", "P0", "(HPCC OFF)", e$

mr1_flg = 0

]

if mr1_flg = 4, #Mazak Geometry Compensation/Accuracy G61.1, Mazak High Speed Machining Mode - G05 P2

[

pbld, n$, "G5", "P0", e$

pbld, n$, "G64", e$

mr1_flg = 0

]

HTH

Link to comment
Share on other sites

CNC Apps guy

that looks good but for one problem

code:

phsm1_on         #High speed functions before G43 

# 1 = Look Ahead - G8P1

# 2 = SHPCC or AI-NANO1 - G5.1 Q1

# 3 = HPCC or AI-NANO2 - G5 P10000

#*******************************************

if opcode$ <>3, mr1$=2 #Current State - Forcing AI-NANO on

if mr1$ = 1 & mr1_flg <> 1, #Advanced Preview (look-ahead) control - G08 P1

it's turning on with every tool that has contour turned on even the ones I don't have the "look ahead" turned on in?

Link to comment
Share on other sites
Guest CNC Apps Guy 1

That's a problem? headscratch.gif

 

I never want to even think about it so I ALWAYS have it on unless I'm drilling. It does not cause any issues in the machine at all. It performs better anyway with it on.

 

JM2C

Link to comment
Share on other sites

Slightly off tangent but Fanuc related, if you look at parameter 5203#2, this will automatically cancel G08/G05 if called in rigid tapping mode.

We have our machines set for this as standard, although we try not to call it...

 

There is also another paramter (7051) which doubles up on this.

 

HTH

Link to comment
Share on other sites

this is what I have now

code:

N1G90T14M6(1/4 HOG ENDMILL)

G0G94G17G90G59X4.1Y.6S5730M3

G43H14Z.1M8

G8P1(LOOK-AHEAD ON)

Z-.5

G1Z-.525F10.3

Y-.6

G0Z.075

Y.6

G8P0(LOOK-AHEAD OFF)

Z-.525

G1Z-.55

Y-.6

G0Z.05

Y.6

Z-.55

G1Z-.575

Y-.6

G0Z.025

Y.6

Z-.575

G1Z-.6

Y-.6

G0Z0.

Y.6

Z-.6

G1Z-.625

Y-.6

G0Z-.025

Y.6

Z-.625

G1Z-.65

Y-.6

G0Z-.05

Y.6

Z-.65

G1Z-.675

Y-.6

G0Z-.075

Y.6

Z-.675

G1Z-.7

Y-.6

G0Z-.1

Y.6

Z-.7

G1Z-.725

Y-.6

G0Z-.125

Y.6

Z-.725

G1Z-.75

Y-.6

G0Z-.15

Y.6

Z-.75

G1Z-.775

Y-.6

G0Z-.175

Y.6

Z-.775

G1Z-.8

Y-.6

G0Z-.2

Y.6

Z-.8

G1Z-.825

Y-.6

G0Z-.225

Y.6

Z-.825

G1Z-.85

Y-.6

G0Z-.25

Y.6

Z-.85

G1Z-.875

Y-.6

G0Z-.275

Y.6

Z-.875

G1Z-.9

Y-.6

G0Z-.3

Y.6

Z-.9

G1Z-.925

Y-.6

G0Z-.325

Y.6

Z-.925

G1Z-.95

Y-.6

G0Z-.35

Y.6

Z-.95

G1Z-.975

Y-.6

G0Z-.375

Y.6

Z-.975

G1Z-1.

Y-.6

G0Z-.4

Y.6

Z-1.

G1Z-1.025

Y-.6

G0Z-.425

Y.6

Z-1.025

G1Z-1.05

Y-.6

G0Z-.45

Y.6

Z-1.05

G1Z-1.075

Y-.6

G0Z-.475

Y.6

Z-1.075

G1Z-1.1

Y-.6

G0Z-.5

Y.6

Z-1.1

G1Z-1.125

Y-.6

G0Z.1

M9S200

G91G28Z0.M5

G40G49

M1

N2G90T4M6(15/32 ENDMILL 5FL)

G0G94G17G90G59X3.8231Y.5572S3056M3

G43H4Z1.125M8

G8P1(LOOK-AHEAD ON)

Z-.5

G1Z-1.125F22.9

G41D74Y.5338

G3X3.87Y.4869I.0469J0.

G2X4.2069Y.15I0.J-.3369

G1Y-.15

G2X3.87Y-.4869I-.3369J0.

G3X3.8231Y-.5338I0.J-.0469

G1G40Y-.5572

G0Z1.125

Y.5547

Z-.5

G1Z-1.125

G41D74Y.5313

G3X3.87Y.4844I.0469J0.

G2X4.2044Y.15I0.J-.3344

G1Y-.15

G2X3.87Y-.4844I-.3344J0.

G3X3.8231Y-.5313I0.J-.0469

G1G40Y-.5547

G0Z1.125

Y.5547

Z-.5

G1Z-1.125

G41D74Y.5313

G3X3.87Y.4844I.0469J0.

G2X4.2044Y.15I0.J-.3344

G1Y-.15

G2X3.87Y-.4844I-.3344J0.

G3X3.8231Y-.5313I0.J-.0469

G1G40Y-.5547

G0Z1.125

G8P0(LOOK-AHEAD OFF)

M9S200

G91G28Z0.

G40G49

G28Y0.

M30

%


the second tool is fine the first tool has no comp, so I would like to not have it turn o then?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...