Cancel
Showing results for 
Search instead for 
Did you mean: 

Look Ahead in postprocessor, not so easy question..

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Hello, ALL!

I have not so easy problem. Try to explain:

I have a postprocessor for simple 3axis mill machine, and example of my nc-programm:

 

N1 G01 X0 Y0 F234.0 (for example F234.0)

N2 X20 Y32 Z23

N3 X-20 Y43

N4 X-25 Y29 Z22

N5 X-35 Y22 Z0

......

N12 X45 Y98 Z0

N13 X44 Y-98

 

All XYZ values random, just for example

 

Very easy, very simple, and for first view point - no any problem. BUT!

Motion at line N13 change a vector motion, and feed MUST BE F100.0, for example. Why? CNC machine cannot change direction of motions at a short distance, will be impact and machine will be stop.  

But this is ordinary cut motion, with common feed for all cut motions F234. - see line N1

I cannot use slowdown at corners, correct nc-programm must be:

 

 

N1 G01 X0 Y0 F234.0 (for example F234.0)

N2 X20 Y32 Z23

N3 X-20 Y43

N4 X-25 Y29 Z22

N5 X-35 Y22 Z0

......

N10 X55 Y88 F200.

N11 X64 Y76.0 F150.

N12 X45 Y98 Z0 F125.

N13 X44 Y-98 F100.

 

Postprocessor must decreas feed not in previous line, but postprocessor must to make complex procedure - "rewind" line-by-line already postprocessed nc-program and change feed if it must be changed.

 

Problem - I will be know feed for current line after postprocessing 5-10 lines after current line.

 

I know one possible solution - close output file after postprocessing, reopen, read line-by-line, analyse and - "rewind" line-by-line, recalc feed and output correct feed.

 

U-u-u-ff..

 

I hope - understandable.

 

6 REPLIES

Re: Look Ahead in postprocessor, not so easy question..

Phenom
Phenom

One thing I have done is load the whole program into an array by override of MOM_before_output. This way - you can still use block templates and MOM_output_literal - but even while processing the program you can change output in any previous lines.

NX10.03
Windows 7 Pro

Re: Look Ahead in postprocessor, not so easy question..

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom
I thinking about it.. But - how I can use MOM_before_output? Have you any simple example just for idea?

Re: Look Ahead in postprocessor, not so easy question..

Phenom
Phenom

Something like this:

 

  if {[string length [info procs MOM_before_output]]} {rename MOM_before_output MOM_UGS_before_output}
  #=============================================================
  proc MOM_before_output { } {

    if {[string length [info procs MOM_UGS_before_output]]} {MOM_UGS_before_output}
    
    global mom_o_buffer my_mom_o_buffer my_mom_o_buffer_cnt

    if {![info exists my_mom_o_buffer_cnt]} {set my_mom_o_buffer_cnt 0}
    incr my_mom_o_buffer_cnt
    set my_mom_o_buffer($my_mom_o_buffer_cnt) $mom_o_buffer
    set mom_o_buffer ""

  }

 

NX10.03
Windows 7 Pro

Re: Look Ahead in postprocessor, not so easy question..

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Thanks.

I need some time to build my postprocessor, and - I will mark your advise as solution.

Re: Look Ahead in postprocessor, not so easy question..

Are you sure that you can't set some machine parameter on the real cnc machine instead?

 

In the past I developed a post for a Taiwanese machine that follow any block but it keeped the feed value and the parts were machined well but with very high errors in dimensions.

 

I found on the manual that giving to the controller a M command, the machine looks ahead the toolpath and basing on a machina parameter calcolate the maximum feedrate to respect the tolerance.

 

So the machine slows down automatically whenever the toolpath has a tight corner or little radius.

 

If you find this on your machine you could set the special M code in the post, automatically setted basing on the type of operation (ad example for all the milling operation and turned off in drilling operations).

Thanks!!

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Thank you, Study!

I have marked your advise as solution, today I finish my postprocessor, I save all motions to array in MOM_before_output, at end of programm close output file, analyse all motions in array, calc new feeds and - open output file and output all motions. Working!!

 

Thank you for idea. Of course, a lot of surprises from MOM_before_output.. 

Learn online





Solution Information