<?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: Force spindle percentage instead of RPM in HSM Post Processor Forum</title>
    <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7007126#M19118</link>
    <description>&lt;P&gt;You are welcome, glad I could help&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2017 16:27:35 GMT</pubDate>
    <dc:creator>pdelioussine</dc:creator>
    <dc:date>2017-04-10T16:27:35Z</dc:date>
    <item>
      <title>Force spindle percentage instead of RPM</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7003209#M19114</link>
      <description>&lt;P&gt;I'm currently working on an HSMWorks post for an older Bostomatic SPC II control.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The current max RPM spindle speed range&amp;nbsp; is 400 - 4000. (If I change the belt, the range would change to 700 - 7000.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I post to convert the rpmFormat into the required percentage?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The integer representing the percentage following the S in the output should be from 10 to 100, with no decimals. (S10 - S100)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can HSMWorks use the RPM data from the tool library, limited to 400 - 4000 rpm, and post the S code as a percentage?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...any help appreciated....&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2017 16:01:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7003209#M19114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-07T16:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Force spindle percentage instead of RPM</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7005737#M19115</link>
      <description>&lt;PRE&gt;  if (insertToolCall ||
      isFirstSection() ||
      (rpmFormat.areDifferent(tool.spindleRPM, sOutput.getCurrent())) ||
      (tool.clockwise != getPreviousSection().getTool().clockwise)) {
		  
		var percentSpeed = 100*tool.spindleRPM/4000; // Variable for percent mode
		  
//    if (tool.spindleRPM &amp;lt; 1) {
    if (percentSpeed &amp;lt; 10) {	// Lower limit of percentage
      error(localize("Spindle speed out of range."));
    }
//    if (tool.spindleRPM &amp;gt; 99999) {
    if (percentSpeed &amp;gt; 100) {	// Upper limit of percentage
      warning(localize("Spindle speed exceeds maximum value."));
    }

    writeBlock(
      //gFormat.format(141), sOutput.format(tool.spindleRPM), mFormat.format(tool.clockwise ? 3 : 20) // RPM mode
	  gFormat.format(141), sOutput.format(percentSpeed), mFormat.format(tool.clockwise ? 3 : 20) // Percent mode
    );
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above should do the trick. I have also included a few screenshots, as reference (used a fresh Bostomatic post for this).&lt;/P&gt;&lt;P&gt;All it does is substitutes the original spindleRPM with the percentage, which is a calculated variable at the start&amp;nbsp;of the "S" output code block.&lt;/P&gt;&lt;P&gt;In addition to performing the arithmetic, it also binds the value between 10 and 100(%).&lt;/P&gt;&lt;P&gt;Once its past all that, just ended up reusing the sFormat as it proved very convenient.&lt;/P&gt;&lt;P&gt;A note: Just be careful with ridgid tapping with this one, as I do not know how well percentage will correlate with actual spindle speed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Plus you can get even fancier with it, you could add a user option for the post which would ask if you are using the 7k belt.&lt;/P&gt;&lt;P&gt;Then it would use the appropriate denominator...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 03:40:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7005737#M19115</guid>
      <dc:creator>pdelioussine</dc:creator>
      <dc:date>2017-04-10T03:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Force spindle percentage instead of RPM</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7005774#M19116</link>
      <description>&lt;PRE&gt;// user-defined properties
properties = {
  writeMachine: true, // write machine
  writeTools: true, // writes the tools
  preloadTool: false, // preloads next tool on tool change if any
  showSequenceNumbers: true, // show sequence numbers
  sequenceNumberStart: 10, // first sequence number
  sequenceNumberIncrement: 1, // increment for sequence numbers
  optionalStop: true, // optional stop
  separateWordsWithSpace: true, // specifies that the words should be separated with a white space
  belt7k: false // specifies if the 7000rpm belt is in use
};&lt;/PRE&gt;&lt;PRE&gt;		var sDenom = (properties.belt7k ? 7000 : 4000); // Set the denominator per belt setting		
		var percentSpeed = 100*tool.spindleRPM/sDenom; // Variable for percent mode&lt;/PRE&gt;&lt;P&gt;Well here it is... now there is a setting in the post processor menu for 7k belt, default is false.&lt;/P&gt;&lt;P&gt;Based on this it will set the correct denominator, and output the correct percentage.&lt;/P&gt;&lt;P&gt;Like last time screenshots attached, both of code and test NC.&lt;/P&gt;&lt;P&gt;Hope this works out, let me know if you have any questions.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 04:36:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7005774#M19116</guid>
      <dc:creator>pdelioussine</dc:creator>
      <dc:date>2017-04-10T04:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Force spindle percentage instead of RPM</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7006511#M19117</link>
      <description>&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3863614" target="_blank"&gt;pdelioussine&lt;/A&gt; : Thank you very much... This did the trick...much appreciated&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 12:40:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7006511#M19117</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-04-10T12:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Force spindle percentage instead of RPM</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7007126#M19118</link>
      <description>&lt;P&gt;You are welcome, glad I could help&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2017 16:27:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/force-spindle-percentage-instead-of-rpm/m-p/7007126#M19118</guid>
      <dc:creator>pdelioussine</dc:creator>
      <dc:date>2017-04-10T16:27:35Z</dc:date>
    </item>
  </channel>
</rss>

