<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Macro to calculate circular feedrate in PowerMill Forum</title>
    <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/9118936#M14715</link>
    <description>&lt;P&gt;Hi karbidhegyu!&lt;/P&gt;&lt;P&gt;You can share post processor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Oct 2019 07:27:37 GMT</pubDate>
    <dc:creator>thaont.cnc</dc:creator>
    <dc:date>2019-10-31T07:27:37Z</dc:date>
    <item>
      <title>Macro to calculate circular feedrate</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8919987#M14712</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new to creating macros and this went very quickly over my head so any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.I would like to create a macro that would look at the active toolpath, pull the tool dia, number of flutes of tool, rpm, and IPT, then ask me for the dia of circle and then calculate actual feed rate needed to maintain the correct chip load at the cutting edge of tool, then input new value into the feed rate box of toolpath.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically I want to incorporate something like&amp;nbsp; this great little calc from guhring web site (&lt;A href="http://WWW.guhring.com/tech/endmillcalc" target="_blank"&gt;WWW.guhring.com/tech/endmillcalc&lt;/A&gt;) for inside circular feed rate correction into an automated process inside PM&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for any help you can provide!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2019 17:46:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8919987#M14712</guid>
      <dc:creator>josh.cowley.ctd</dc:creator>
      <dc:date>2019-07-19T17:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to calculate circular feedrate</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8920346#M14713</link>
      <description>&lt;P&gt;In Heidenhain controllers similar function M109/M110&amp;nbsp;&lt;A title="Feed rate for circular arcs: M109/M110/M111" href="https://www.manualslib.com/manual/382926/Heidenhain-Itnc-530-Conversational-Programming.html?page=368" target="_blank" rel="noopener"&gt;Feed rate for circular arcs: M109/M110/M111&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;I create a simplified/limited calculator macro:&lt;/P&gt;&lt;PRE&gt;// Demo feedrate multiplier calculator for circle contouring
// It only works if active toolpath type 'Curve profile',calculated and path is full circle
IF NOT entity_exists('toolpath','') {
   RETURN
}
ENTITY TP=entity('toolpath','')
IF (NOT $TP.Computed) OR ($TP.Strategy !='curve_profile') {
   RETURN
}
DEACTIVATE WORKPLANE
DEACTIVATE TOOLPATH
ACTIVATE TOOLPATH $TP.Name
ACTIVATE PATTERN $TP.Pattern.Name
IF $TP.Statistics.CuttingMoves.Lengths.Linear != 0 {
   RETURN
}
REAL ARRAY limsT[] = toolpath_cut_limits($TP.Name)
IF round($TP.Statistics.CuttingMoves.Lengths.Arcs,2) != round(PI*($LimsT[1]-$LimsT[0]),2) {
// Not a circle
   RETURN
}
REAL TPX=round($LimsT[1]-$LimsT[0],3)
REAL TPY=round($LimsT[3]-$LimsT[2],3)
REAL TPZ=round($LimsT[5]-$LimsT[4],3)
IF $TPX != $TPY OR $TPZ !=0 {
   RETURN
}

REAL ARRAY limsP[] = $LimsT
IF NOT entity_exists('workplane','') {
   REAL ARRAY tmp[]= limits(Pattern)
   $LimsP=$tmp
} ELSE {
   REAL ARRAY tmp[] = limits_workplane_rel(entity('pattern', ''), entity('workplane', ''))
   $LimsP=$tmp
}
REAL PX=round($LimsP[1]-$LimsP[0],3)
REAL PY=round($LimsP[3]-$LimsP[2],3)
IF $PX != $PY {
   RETURN
}

REAL Ratio=1
IF $PX &amp;lt; $TPX {
// Outer path
// Calculate with nominal size (ignore curve thickness)
   $Ratio=($PX+$TP.Tool.Diameter)/$PX
// Calculate with REAL size (include curve thickness)
// ver1.
   $Ratio=$TPX/($TPX-$TP.Tool.Diameter)
// ver2.
   $Ratio=$TPX /($PX+2*$Tp.CurveThickness)
} ELSE {
// Inner path
// Calculate with nominal size (ignore curve thickness)
   $Ratio=($PX-$TP.Tool.Diameter)/$PX
// Calculate with REAL size (include curve thickness)
// ver1.
   $Ratio=$TPX /($TPX+$Tp.Tool.Diameter)
// ver2.
   $Ratio=$TPX /($PX-2*+$Tp.CurveThickness)
}
MESSAGE INFO 'Feedrate multiplier '+round($Ratio,4)&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Jul 2019 21:15:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8920346#M14713</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-19T21:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to calculate circular feedrate</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8920699#M14714</link>
      <description>&lt;P&gt;&lt;FONT&gt;I modify Fanuc generic PP for emulate Heidenhain M109.&lt;BR /&gt;Steps in AMPPU:&lt;BR /&gt;1. Copy/paste Feed Rate parameter to User Parameters, then rename "Feed Rate Calculated".&lt;BR /&gt;2. Replace Feed Rate parameter with Feed Rate Calculated in Move Linear and Circular Move XY commands.&lt;BR /&gt;3. Add Script function to Move Linear command:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;function MoveLinear()
{
   if ((GetParam("%p(Feed Rate Calculated)%") != GetParam("%p(Feed Rate)%")) ){
      SetParam("%p(Feed Rate Calculated)%",GetParam("%p(Feed Rate)%"));
   }
   return StandardResponse();
}&lt;/PRE&gt;&lt;P&gt;&lt;FONT&gt;4. Add Script function to Circular Move XY:&lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;function CircularMoveXY()
{
   if ((GetParam("%p(Cutter Compensation Mode)%") == "LEFT") || (GetParam("%p(Cutter Compensation Mode)%") == "RIGHT")) {
      if (((GetParam("%p(Motion Mode)%") == "CW") &amp;amp;&amp;amp; (GetParam("%p(Cutter Compensation Mode)%") == "LEFT")) || ((GetParam("%p(Motion Mode)%") == "CCW") &amp;amp;&amp;amp; (GetParam("%p(Cutter Compensation Mode)%") == "RIGHT"))) {
         // Outer path
         var Ratio=(GetParam("%p(Arc Radius)%")+GetParam("%p(Tool Diameter)%")/2)/GetParam("%p(Arc Radius)%");
         // Limit max. feedrate to 150%
         Ratio=Math.min(1.5,Ratio);
         var FeedRateCalculated=Math.min(Ratio*GetParam("%p(Feed Rate)%"),GetParam("%p(Max Cutting Rate)%"));
         SetParam("%p(Feed Rate Calculated)%",FeedRateCalculated);
       } else {
         // Inner path
         var Ratio=(GetParam("%p(Arc Radius)%")-GetParam("%p(Tool Diameter)%")/2)/GetParam("%p(Arc Radius)%");
         // Limit min. feedrate to 20%
         Ratio=Math.max(0.2,Ratio);
         var FeedRateCalculated=Ratio*GetParam("%p(Feed Rate)%");
         SetParam("%p(Feed Rate Calculated)%",FeedRateCalculated);
       }
   } else {
      if ((GetParam("%p(Feed Rate Calculated)%") != GetParam("%p(Feed Rate)%")) ){
         SetParam("%p(Feed Rate Calculated)%",GetParam("%p(Feed Rate)%"));
      }
  }
  return StandardResponse();
}&lt;/PRE&gt;&lt;P&gt;&lt;FONT&gt;The test contour:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Inner + Outer" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/659341iE83F62ABDE5FE12D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TestContour.JPG" alt="Inner + Outer" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Inner + Outer&lt;/span&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="The result" style="width: 387px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/659342i6C96AEC7A0D66668/image-size/medium?v=v2&amp;amp;px=400" role="button" title="FanucM109 Result.JPG" alt="The result" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;The result&lt;/span&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;This is&lt;U&gt; not&lt;/U&gt; a fully tested industrial strength solution, only experiment.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2019 08:24:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/8920699#M14714</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-20T08:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to calculate circular feedrate</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/9118936#M14715</link>
      <description>&lt;P&gt;Hi karbidhegyu!&lt;/P&gt;&lt;P&gt;You can share post processor&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 07:27:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/9118936#M14715</guid>
      <dc:creator>thaont.cnc</dc:creator>
      <dc:date>2019-10-31T07:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro to calculate circular feedrate</title>
      <link>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/9119311#M14716</link>
      <description>&lt;P&gt;Modification: new 'udp_AtBottom' user parameter, if it is set to "TRUE" it will only slow down on the inner arcs, keep the original feed rate on the outer arcs.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AtBottom.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/693274iF3EECEF9C91B4431/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AtBottom.JPG" alt="AtBottom.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Oct 2019 10:42:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/powermill-forum/macro-to-calculate-circular-feedrate/m-p/9119311#M14716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-31T10:42:07Z</dc:date>
    </item>
  </channel>
</rss>

