cancel
Showing results for 
Search instead for 
Did you mean: 

Post processor to claculate RPM based on SFM & output spindle range for turning ?

Programmer enter SFM & Post calculates RPM as well decide spindle range based on mom pos(0) & give error if need different range for that turn dia based on comparision...

 

But the problem is we only encounter the correct X values at first cut to have correct range & we want to output M41etc,, after tool change or at initial move. any suggestions.

 

What canbe the problem of doing so ?

 

17 REPLIES

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Valued Contributor
Valued Contributor

Try to unset the variable so it will output again later.

 

unset mom pos(0)

 

The question was a little vague, but it sounds like you want the output at each tool change?

Production: NX 11.0.1.11 MP2 Primarily CAM

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Hi, Sorry for the clumsyness of the question & thank you for your time.

The problem is,

N0030 (OPERATION - ROUGH_TURN_OD)

N0040 T1000 M08

N0050 G50 S99999  M41 - Spindle Range

N0060 G96 S300 M04

N0070 G00 X906.557 Z1015.722

N0080 X630. Z754.2

N0090 G99 G01 Z753. F.25

N0100 Z360.

N0110 X650. --- First Cut event

N0120 X651.697 Z360.849

N0130 G00 Z754.2

N0140 X610.

N0150 G01 Z753.

I want to claculate RPM based on X value at first cut event.

RPM=SFM**/D**.

Where D is X value & SFM will be taken from NX input.

Besed on RPM i get i will output spindle range code M41 M42..etc...

But we hit cut event lil later in the process....??

 

i can think of opening & writing code at the desired place & closing the file..but it is the only way ?

 

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Esteemed Contributor
Esteemed Contributor

If you look at the tcl when NX calculates the range, it is based on the previous position.

This is good at the end of path (before going "home")

This is not so good at the start of path.

I would move the output of the spindle range to the initial & first move events (so mom_pos(0) replects the X axis value the machine is moving TO)

Then re-writethe code that calculates spindle range to use mom_pos, ratherthan mom_prev_pos.

Note you might want the code to check - if the event is first/initial move, use mom_pos, else use mom_prev_pos.

 

Note the above may be based on older versions of Post Builder - Looking in a new PB10.0.3 lathe post, I don't see ANY code where they calculate the spindle range?!?!

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Valued Contributor
Valued Contributor

You could set a variable immediately after the event is called, and then recall it later. Let me know if you understand what I mean by this. 

Production: NX 11.0.1.11 MP2 Primarily CAM

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

@ Ken,

That is exactly i want to do...but how to move the output of the spindle range to the initial & first move events which is calculated at first cut or engage event ?

Please see the attched JPEG...

 

 @TechniCsNC 

I do follow you..

But variables generated in current event you can use later in the process easily..

question is how to use the variable at initial move which will be generated later in the process... ?

Please see the attched JPEG...

 

Thank you for your time

 

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Legend
Legend

Hi,

The most simple way is:

1) Output templates with some marker, like G50 S9999 M<marker1> for first operation,  G50 S9999 M<marker2> for second operation, etc.

2) In each operation calculate the value for this marker and store it in some global list RangeValuesList.

3) After postprocessing close the program and rewrite it to replace each <marker1> , <marker2>,... with proper value from RangeValuesList.

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

@FROBI

I haven't done something like this before :

1) G50 S9999 M<marker1>  where if i set sp_range1 do i need to keep it increasing like sp_range2 etc.. ?

2) calculation part i got it & i am adding it to lappend Op1_range_list $sp_range1, lappend Op1_range_list $sp_range2....?

3) I am able to opened the file But can you please help me with "Replacing part" right value at right place ?

     if you have any Sample code..

 

Thank you so much for your time.. 

 

 

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Legend
Legend

Read 2 topics about rewriting programs after postprocessoring (see references below). Use this idea and try to do some test to understand the algorithm how to transfer any data in program file back to any point.

https://community.plm.automation.siemens.com/t5/Discussion-Forum-NX/PostProcessor-The-minimum-and-ma...

https://community.plm.automation.siemens.com/t5/Discussion-Forum-NX/How-can-i-do-tool-code-replace-t...

Re: Post processor to claculate RPM based on SFM & output spindle range for turning ?

Legend
Legend

VijayRR_prince wrote:
1) G50 S9999 M<marker1>  where if i set sp_range1 do i need to keep it increasing like sp_range2 etc.. ?

2) calculation part i got it & i am adding it to lappend Op1_range_list $sp_range1, lappend Op1_range_list $sp_range2....?


1) For your situation you can do it without increasing and output the same marker everywhere, for example, G50 S9999 MRANGE.

 BLOCK_TEMPLATE spindle_max_rpm 
 {
 G[$mom_sys_spindle_max_rpm_code]
 S[$mom_spindle_maximum_rpm]
 Text[MRANGE]
 }

2) After each calculation add a value: lappend Op_range_list "M41"  or lappend Op_range_list "M42"  (as you need).

3) During rewriting (see procedure PB_cmd_reprocess) you should use the cycle while like this:

global Op_range_list 

set count 0
while { [gets $handle_r buf] > 0 } {
if { [string match "*MRANGE" $buf] } {
set Mcode [lindex $Op_range_list $count]

set start_pos [string first "MRANGE" $str]
set substr [string range $buf 0 [expr $start_pos-1]]
set buf "$substr$Mcode"
incr count
}
puts $handle_w $buf
}

 

Learn online





Solution Information