<?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 OKK HMC rotary axis 1 degree increments in HSM Post Processor Forum</title>
    <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/okk-hmc-rotary-axis-1-degree-increments/m-p/7503934#M17092</link>
    <description>&lt;P&gt;Hi. I am now working on getting my post working with the OKK HMC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have everything working, but the OKK rotary table will only increment in full one degree movements.&lt;/P&gt;&lt;P&gt;basically i want the post to error out if a B axis move is not in full degrees.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like the following code may be what im looking for, but it looks like it may just round the B figure? And i am also not sure how to activate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function getWorkPlaneMachineABC(workPlane) {
  var W = workPlane; // map to global frame

  var abc = machineConfiguration.getABC(W);
  if (closestABC) {
    if (currentMachineABC) {
      abc = machineConfiguration.remapToABC(abc, currentMachineABC);
    } else {
      abc = machineConfiguration.getPreferredABC(abc);
    }
  } else {
    abc = machineConfiguration.getPreferredABC(abc);
  }
  
  try {
    abc = machineConfiguration.remapABC(abc);
    currentMachineABC = abc;
  } catch (e) {
    error(
      localize("Machine angles not supported") + ":"
      + conditional(machineConfiguration.isMachineCoordinate(0), " A" + abcFormat.format(abc.x))
      + conditional(machineConfiguration.isMachineCoordinate(1), " B" + abcFormat.format(abc.y))
      + conditional(machineConfiguration.isMachineCoordinate(2), " C" + abcFormat.format(abc.z))
    );
  }
  
  var direction = machineConfiguration.getDirection(abc);
  if (!isSameDirection(direction, W.forward)) {
    error(localize("Orientation not supported."));
  }
  
  if (!machineConfiguration.isABCSupported(abc)) {
    error(
      localize("Work plane is not supported") + ":"
      + conditional(machineConfiguration.isMachineCoordinate(0), " A" + abcFormat.format(abc.x))
      + conditional(machineConfiguration.isMachineCoordinate(1), " B" + abcFormat.format(abc.y))
      + conditional(machineConfiguration.isMachineCoordinate(2), " C" + abcFormat.format(abc.z))
    );
  }

  var tcp = false;
  if (tcp) {
    setRotation(W); // TCP mode
  } else {
    var O = machineConfiguration.getOrientation(abc);
    var R = machineConfiguration.getRemainingOrientation(abc, W);
    setRotation(R);
  }
  
  return abc;
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 31 Oct 2017 07:21:43 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-10-31T07:21:43Z</dc:date>
    <item>
      <title>OKK HMC rotary axis 1 degree increments</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/okk-hmc-rotary-axis-1-degree-increments/m-p/7503934#M17092</link>
      <description>&lt;P&gt;Hi. I am now working on getting my post working with the OKK HMC.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have everything working, but the OKK rotary table will only increment in full one degree movements.&lt;/P&gt;&lt;P&gt;basically i want the post to error out if a B axis move is not in full degrees.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like the following code may be what im looking for, but it looks like it may just round the B figure? And i am also not sure how to activate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function getWorkPlaneMachineABC(workPlane) {
  var W = workPlane; // map to global frame

  var abc = machineConfiguration.getABC(W);
  if (closestABC) {
    if (currentMachineABC) {
      abc = machineConfiguration.remapToABC(abc, currentMachineABC);
    } else {
      abc = machineConfiguration.getPreferredABC(abc);
    }
  } else {
    abc = machineConfiguration.getPreferredABC(abc);
  }
  
  try {
    abc = machineConfiguration.remapABC(abc);
    currentMachineABC = abc;
  } catch (e) {
    error(
      localize("Machine angles not supported") + ":"
      + conditional(machineConfiguration.isMachineCoordinate(0), " A" + abcFormat.format(abc.x))
      + conditional(machineConfiguration.isMachineCoordinate(1), " B" + abcFormat.format(abc.y))
      + conditional(machineConfiguration.isMachineCoordinate(2), " C" + abcFormat.format(abc.z))
    );
  }
  
  var direction = machineConfiguration.getDirection(abc);
  if (!isSameDirection(direction, W.forward)) {
    error(localize("Orientation not supported."));
  }
  
  if (!machineConfiguration.isABCSupported(abc)) {
    error(
      localize("Work plane is not supported") + ":"
      + conditional(machineConfiguration.isMachineCoordinate(0), " A" + abcFormat.format(abc.x))
      + conditional(machineConfiguration.isMachineCoordinate(1), " B" + abcFormat.format(abc.y))
      + conditional(machineConfiguration.isMachineCoordinate(2), " C" + abcFormat.format(abc.z))
    );
  }

  var tcp = false;
  if (tcp) {
    setRotation(W); // TCP mode
  } else {
    var O = machineConfiguration.getOrientation(abc);
    var R = machineConfiguration.getRemainingOrientation(abc, W);
    setRotation(R);
  }
  
  return abc;
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Oct 2017 07:21:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/okk-hmc-rotary-axis-1-degree-increments/m-p/7503934#M17092</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-10-31T07:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: OKK HMC rotary axis 1 degree increments</title>
      <link>https://forums.autodesk.com/t5/hsm-post-processor-forum/okk-hmc-rotary-axis-1-degree-increments/m-p/7566688#M17093</link>
      <description>&lt;P&gt;The &lt;A href="https://cam.autodesk.com/posts/?p=dmg_mori_nhx" target="_blank"&gt;DMG Mori NHX &lt;/A&gt;post processor has logic to limit the B-axis move in whole degrees.&amp;nbsp; You can use this post as a reference to modify your post.&amp;nbsp; Look for the string 'gotContinuousBAxis' throughout the post and use the logic that applies to !getContinuousBAxis in your post.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the onOpen function.&amp;nbsp; Since you do not need it as an option you can create abcFormat and bOuput at the top of the program where they normally are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;      bAxis = createAxis({coordinate:1, table:true, axis:[0, (properties.makeBAxisOtherWay ? -1 : 1) * -1, 0], cyclic:true, range:[0, 360]});
      abcFormat = createFormat({decimals:0, forceDecimal:true, scale:DEG});
      bOutput = createVariable({prefix:"B"}, abcFormat);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the getWorkPlaneMachineABC function.&amp;nbsp; You can change '!properties.gotContinuousBAxis' to 'true'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; var abcTest = new Vector(abc.x, abc.y, abc.z); // affects output if not copied to new vector
  if (!properties.gotContinuousBAxis) {
    abcTest.setX(toRad(abcFormat.getResultingValue(abc.x)));
    abcTest.setY(toRad(abcFormat.getResultingValue(abc.y)));
    abcTest.setZ(toRad(abcFormat.getResultingValue(abc.z)));
  }
  var direction = machineConfiguration.getDirection(abcTest);
  if (!isSameDirection(direction, W.forward)) {
    error(localize("Orientation not supported."));
  }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Nov 2017 21:19:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/hsm-post-processor-forum/okk-hmc-rotary-axis-1-degree-increments/m-p/7566688#M17093</guid>
      <dc:creator>bob.schultz</dc:creator>
      <dc:date>2017-11-22T21:19:59Z</dc:date>
    </item>
  </channel>
</rss>

