Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Rotary FEEDs settings

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

okay thank you, I know more thanks to you.

 

my last questions :

 

Has this something with FRN ? :

 

PB CMD FEEDRATE NUMBER (whole custom command)

Snímka.JPG

 

*

and you can rewrite this with importing frn_fix command.

 

then I find there longer code and some highlitghs :

Snímk2a.JPG

 (whole commnd attached)

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Rotary FEEDs settings

Legend
Legend

The (latest) 'fix' looks more like:

 

    #=============================================================
    proc PB_CMD_FEEDRATE_NUMBER { } {
    #=============================================================
    # Import this custom command into your post.  It does not need
    # to be placed with any event marker. It will replace default
    # method of FRN calculation (of ugpost_base).
    # This custom command can be used for four or five axis posts.
    #
    #
    # - REVISIONS -
    #<10-09-08 gsl> Correct computation for 5-axis FRN
    #<06-05-09 gsl> Prepared for pb7.0 release
    #<06-17-09 gsl> Use mcs_goto to calculate distance for multi-axis case
    #<06-03-10 gsl> Add option to use mom_pos for calculation
    #<02-11-14 gsl> Add comments for overloading frn factor
    #<11-05-14 gsl> (pb10.01) Simplified length calculation
    #
    
    # Uncomment a statement below, if a different method of FRN calculation is preferred.
    #
    #return [PB_CMD_FEEDRATE_NUMBER__Fanuc]
    #return [PB_CMD_FEEDRATE_NUMBER__NX6]
    #return [PB_CMD_FEEDRATE_NUMBER__PB10]
    
    
    
      #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      # "__dist_cal_method" specifies method for distance calculation
      #
      #   "MOM_POS"   - use "mom_pos"  : N/C coordinates
      #   "MCS_GOTO"  - use "mcs_goto" : tool-path points
      #
      # ==> MCS_GOTO would produce proper length of a motion.
    
       set __dist_cal_method "MCS_GOTO"
      #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    
    
       global mom_feed_rate_number
       global mom_feed_rate
       global mom_kin_max_frn
       global mom_kin_min_frn
       global mom_kin_max_dpm
       global mom_warning_info
       global mom_kin_machine_type
    
    
      # Original FRN - based on mom_motion_distance
      #
       global mom_sys_frn_factor
    
    
      # Set default FRN factor, if not defined.
       if { ![info exists mom_sys_frn_factor] } {
          set mom_sys_frn_factor 1.0
       }
    
      #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      # Uncomment next statement to overload FRN factor, when necessary
      # to adjust the result of FRN calculation.
      # - It may also be set to 60 to output FRN in (1/second).
    
      # set mom_sys_frn_factor 1.0
    
    
       set frn 0.0
    
       if { [info exists mom_feed_rate_number] } {
    
          set frn [expr $mom_feed_rate_number * $mom_sys_frn_factor]
          if { [EQ_is_gt $frn $mom_kin_max_frn] } {
             set frn $mom_kin_max_frn
          }
       }
    
       set frn_org $frn
    
    
      #===============
      # Recompute FRN
      #
       global mom_motion_distance
    
       if { ![info exists mom_motion_distance] } {
           set mom_motion_distance 0.0
       }
    
       set dist $mom_motion_distance
    
    
       if { [string match "3_axis_mill" $mom_kin_machine_type] } {
    
          if { $dist < .0001 } { set dist .0001 }
          set frn [expr $mom_feed_rate / $dist]
    
       } else {
    
         # Re-compute linear & rotary delta for XZC mill post
          global mom_sys_coordinate_output_mode
    
          if { [string match "*mill_turn*" $mom_kin_machine_type] } {
             if { ![string compare "POLAR" $mom_sys_coordinate_output_mode] } {
                ASK_DELTA_4TH_OR_5TH 4
             }
          }
    
          global mom_pos mom_prev_pos
          global mom_mcs_goto mom_prev_mcs_goto
    
         #--------------------------------------
         # Switch method for computing distance
         #
          if { [string match "MOM_POS" $__dist_cal_method] } {
             set delta(0) [expr $mom_pos(0) - $mom_prev_pos(0)]
             set delta(1) [expr $mom_pos(1) - $mom_prev_pos(1)]
             set delta(2) [expr $mom_pos(2) - $mom_prev_pos(2)]
          } else {
             set delta(0) [expr $mom_mcs_goto(0) - $mom_prev_mcs_goto(0)]
             set delta(1) [expr $mom_mcs_goto(1) - $mom_prev_mcs_goto(1)]
             set delta(2) [expr $mom_mcs_goto(2) - $mom_prev_mcs_goto(2)]
          }
    
    
         # Linear distance
          set dist [VEC3_mag delta]
    
    
          if { $dist < .0001 } { set dist .0001 }
    
          set mom_motion_distance $dist
          MOM_reload_variable mom_motion_distance
    
          set frn [expr $mom_feed_rate / $dist]
    
         # Determine the maximum rotary displacement of either 4th or 5th axis.
         # For a 4-axis, x is always zero.
         #
          set rot_del [ASK_DELTA_4TH_OR_5TH 4]
          set x [ASK_DELTA_4TH_OR_5TH 5]
          if { $x > $rot_del } {
             set rot_del $x
          }
    
         # Calculate DPM.  DPM = delta degrees * FRN
         #
          set dpm [expr $rot_del * $frn]
    
         # Check for DPM being over max.  If so, calculate the time it
         # will take to move the rotary angles at maximum DPM the
         # required number of degrees.
         #
          if { $dpm > $mom_kin_max_dpm } {
             set frn [expr $mom_kin_max_dpm/$rot_del]
             CATCH_WARNING "Maximum degrees per minute exceeded, used maximum"
          }
    
          global mom_feed_rate_dpm
          set mom_feed_rate_dpm $dpm
          MOM_reload_variable mom_feed_rate_dpm
    
       } ;# multi-axis
    
    
       global mom_event_time
       set mom_event_time [expr 1.0/$frn]
       MOM_reload_variable mom_event_time
    
       set frn [expr $frn * $mom_sys_frn_factor]
    
      # Check for FRN being greater than format allows.
      #
       if { $frn > $mom_kin_max_frn } {
          set frn $mom_kin_max_frn
          CATCH_WARNING "Over maximum FRN, use maximum"
       }
    
      # Check for FRN being smaller than format allows.
      #
       if { $frn < $mom_kin_min_frn } {
          set frn $mom_kin_min_frn
          CATCH_WARNING "Under minimum FRN, use minimum"
       }
    
       set mom_feed_rate_number $frn
       MOM_reload_variable mom_feed_rate_number
    
    
      # Ensure FRN code comes out.  It is usually not modal.
      #
       MOM_force once F
    
    return $frn
    }

Re: Rotary FEEDs settings

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

yes, I attached this new cmd in last post.

This is interesting:

 

 #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      # Uncomment next statement to overload FRN factor, when necessary
      # to adjust the result of FRN calculation.
      # - It may also be set to 60 to output FRN in (1/second).
    
      # set mom_sys_frn_factor 1.0
    
    
       set frn 0.0
    

 

*And Ive noticed that "pb_cmd_fix_frn.tcl", or "pb_cmd_feeds_speeds_utils.tcl" and "pb_cmd_frn_tool_tip.tcl" overwrite pb_cmd_feedrate_number  and downgrade it to generic version.

 

jb

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Rotary FEEDs settings

Legend
Legend

According to colleague here, the only way to get this FRN thing working is to do the following:

(can't help more as I maintain the Sinumerik ctrls here, all DPM for me)

 

1) In the 'fix' PB_CMD_FEEDRATE_NUMBER, uncomment this:

 

# Uncomment a statement below, if a different method of FRN calculation is preferred.
#
return [PB_CMD_FEEDRATE_NUMBER__Fanuc]
#return [PB_CMD_FEEDRATE_NUMBER__NX6]
#return [PB_CMD_FEEDRATE_NUMBER__PB10]

 

 

2) add new cmd: PB_CMD_FEEDRATE_NUMBER__Fanuc

# This command mimics the FRN calculation of Fanuc controllers.
#
# This custom command can be imported and executed in the
# PB_CMD_FEEDRATE_NUMBER command.
#
#
# - REVISIONS -
# Oct-28-2014 gsl - Revised for PW/Fanuc FRN calculation
#
   global mom_feed_rate_number
   global mom_feed_rate
   global mom_kin_max_frn
   global mom_kin_min_frn
   global mom_kin_max_dpm
   global mom_warning_info
   global mom_kin_machine_type


  # Original FRN - based on mom_motion_distance
  #
   global mom_sys_frn_factor


  # Set default FRN factor, if not defined.
   if { ![info exists mom_sys_frn_factor] } {
      set mom_sys_frn_factor 1.0
   }


  #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  # Uncomment next statement to overload FRN factor, when necessary
  # to adjust the result of FRN calculation.
  # - It may also be set to 60 to output FRN in (1/second).

  # set mom_sys_frn_factor 1.0


   set frn 0.0

   if { [info exists mom_feed_rate_number] } {

      set frn [expr $mom_feed_rate_number * $mom_sys_frn_factor]
      if { [EQ_is_gt $frn $mom_kin_max_frn] } {
         set frn $mom_kin_max_frn
      }
   }

   set frn_org $frn


  #===============
  # Recompute FRN
  #
   global mom_motion_distance

   if { ![info exists mom_motion_distance] } {
       set mom_motion_distance 0.0
   }

   set dist $mom_motion_distance


   if { [string match "3_axis_mill" $mom_kin_machine_type] } {

      if { $dist < .0001 } { set dist .0001 }
      set frn [expr $mom_feed_rate / $dist]

   } else {

     # Rotary angles
      global mom_rotary_delta_4th mom_rotary_delta_5th DEG2RAD

     # Re-compute rotary delta for XZC mill post
      global mom_sys_coordinate_output_mode
      if { [string match "*mill_turn*" $mom_kin_machine_type] } {
         if { ![string compare "POLAR" $mom_sys_coordinate_output_mode] } {
            ASK_DELTA_4TH_OR_5TH 4
         }
      }

      set a4 [expr abs($mom_rotary_delta_4th)]
      set a5 [expr abs($mom_rotary_delta_5th)]

      global mom_pos mom_prev_pos

      set delta(0) [expr $mom_pos(0) - $mom_prev_pos(0)]
      set delta(1) [expr $mom_pos(1) - $mom_prev_pos(1)]
      set delta(2) [expr $mom_pos(2) - $mom_prev_pos(2)]


     #++++++++++++++++++++
     # According to Fanuc
     #++++++++++++++++++++
      set dist_max [expr sqrt( $delta(0)*$delta(0) + $delta(1)*$delta(1)  + $delta(2)*$delta(2) + $a4*$a4 + $a5*$a5 )]


      if { $dist_max < .0001 } { set dist_max .0001 }

      set frn [expr $mom_feed_rate / $dist_max]


     # => Fanuc uses total travel to compute DPM
     #
      set rot_del $dist_max

     # Calculate DPM.  DPM = delta degrees * FRN
     #
      set dpm [expr $rot_del * $frn]

     # Check for DPM being over max.  If so, calculate the time it
     # will take to move the rotary angles at maximum DPM the
     # required number of degrees.
     #
      if { $dpm > $mom_kin_max_dpm } {
         set dpm $mom_kin_max_dpm
         set frn [expr $dpm/$rot_del]
         CATCH_WARNING "Maximum degrees per minute exceeded, used maximum"
      }

   } ;# multi-axis


  # Fudge FRN number with the given factor
   if { ![EQ_is_equal $mom_sys_frn_factor 1.0] } {
      set frn [expr $frn * $mom_sys_frn_factor]
   }


  # Check for FRN being greater than format allows.
  #
   if { $frn > $mom_kin_max_frn } {
      set frn $mom_kin_max_frn
      CATCH_WARNING "Over maximum FRN, use maximum"
   }

  # Check for FRN being smaller than format allows.
  #
   if { $frn < $mom_kin_min_frn } {
      set frn $mom_kin_min_frn
      CATCH_WARNING "Under minimum FRN, use minimum"
   }

   set mom_feed_rate_number $frn
   MOM_reload_variable mom_feed_rate_number


  # Ensure FRN code comes out.  It is usually not modal.
  #
   MOM_force once F

return $frn

Good luck Smiley Wink

Re: Rotary FEEDs settings

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

thanks guys

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Re: Rotary FEEDs settings

Legend
Legend

And to output G93/G94 add the following to your motion/linear, circular, ect.

 

You should start getting half-decent NC Smiley Wink

 

Hope this helps a bit

 

Charles

 

Untitled-2.jpg

Re: Rotary FEEDs settings

Legend
Legend
@Ken_A wrote:
- determine distance being moved in this block ("delta distance") = delta X + delta Y + delta Z + delta Fourth + delta Fifth

This formula for delta distance is wrong, because the real movement of 5-axis machine depends on the pivots, on the position of workpiece regarding rotary table, etc. I did my own calculation of distance individually for every machine, and I had rather good results for 5-axis machining.
My output was very different against NX output.

 

Highlighted

Re: Rotary FEEDs settings

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Well, I did say it was something LIKE what I posted :-)

 

At the time I saw that equation (NX3?  PB3.x?) I was somewhat surprised by the simplicity (I knew it had to be more complicated than that) but it was all I had to work with (and I didn't have the time to figure out the "real" value)

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


Re: Rotary FEEDs settings

Legend
Legend

Yes, Ken, I was also surprised by the simplicity of NX procedures for inverse feed. Simple and wrong...

I used to do it because of the bad dynamics of the machine during 5-axis machining around blade. When tool comes to the edge of blade, tool tip point changes in microns, but the rotary changes are great enough, so that the machine's feed increases twice or three times... and I get defects on the surface Smiley Sad

So I had to refuse the NX procedures and to re-calculate the distance for each motion (using mom_mcs_goto, rotary angles, tool length, pivots, etc) to get the value as exact as possible, like the spindle moves in the real machine space. After calculation of the distance I had to get and output the inverse feed as you wrote.

Of course, my formulas were only for this concrete machine/postprocessor. For another machine with different kinematics and pivots it should be different calculation.

Re: Rotary FEEDs settings

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

@FROBI

so you need simulation model,

and on the real machine you have to put blank on exact positions to match it with simulation model

Am I right ?

---------------------------------------------
#♫ PB, 5ax, itnc, nx, vericut ♫ #

Learn online





Solution Information