Hello Guest it is April 25, 2024, 04:42:54 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dude1

31
Mach4 General Discussion / Re: Real G93 Gcode anyone
« on: January 30, 2018, 06:27:40 PM »
That shape part does not need inverse time it's 2 moves then one then 2, it's for when you wont to move many axis at the sametime like 3 plus axis, that toolpath I posted is a wrap 4 axis toolpath doing 4 axis moves at onces it makes it more continuous than wrap.


32
Mach4 General Discussion / Re: Real G93 Gcode anyone
« on: January 30, 2018, 03:38:07 PM »
That's from the HSM/Fusion 360 post processor it's java in there extension of .cps

Some machine can handle useing inverse time not all.

It's time of flight so it all tries to move in sink with the rotary motion, if you did not run in sink with the rotary axis the rotary axis moves slow as a wet week or you have to have it's feed rate over 2 times faster than a linear axis to just keep up

33
Mach4 General Discussion / Re: Real G93 Gcode anyone
« on: January 30, 2018, 02:39:04 PM »
Code: [Select]
Just for fun heres the code for it.

[code// Start of multi-axis feedrate logic
/***** Be sure to add 'useInverseTime' to post properties if necessary. *****/
/***** 'inverseTimeOutput' must be defined. *****/
/***** 'headOffset' should be defined when a head rotary axis is defined. *****/
/***** The feedrate mode must be included in motion block output (linear, circular, etc. *****/
var dpmBPW = 0.1; // ratio of rotary accuracy to linear accuracy for DPM calculations
var inverseTimeUnits = 1.0; // 1.0 = minutes, 60.0 = seconds
var maxInverseTime = 9999; // maximum value to output for Inverse Time feeds

/** Calculate the multi-axis feedrate number. */
function getMultiaxisFeed(_x, _y, _z, _a, _b, _c, feed) {
  var f = {frn:0, fmode:0};
  if (feed <= 0) {
    error(localize("Feedrate is less than or equal to 0."));
    return f;
  }

  var length = getMoveLength(_x, _y, _z, _a, _b, _c);

  if (true) { // inverse time
    f.frn = inverseTimeOutput.format(getInverseTime(length[0], feed));
    f.fmode = 93;
    feedOutput.reset();
  } else { // degrees per minute
    f.frn = feedOutput.format(getFeedDPM(length, feed));
    f.fmode = 94;
  }
  return f;
}

/** Calculate the DPM feedrate number. */
function getFeedDPM(_moveLength, _feed) {
  // moveLength[0] = Tool tip, [1] = XYZ, [2] = ABC

  if (false) { // TCP mode is supported, output feed as FPM
    return feed;
  } else { // DPM feedrate calculation
    var moveTime = ((_moveLength[0] < 1.e-6) ? 0.001 : _moveLength[0]) / _feed;
    var length = Math.sqrt(Math.pow(_moveLength[1], 2.0) + Math.pow((toDeg(_moveLength[2]) * dpmBPW), 2.0));
    return length / moveTime;
  }
}

/** Calculate the Inverse time feedrate number. */
function getInverseTime(_length, _feed) {
  var inverseTime;
  if (_length < 1.e-6) { // tool doesn't move
    if (typeof maxInverseTime === "number") {
      inverseTime = maxInverseTime;
    } else {
      inverseTime = 999999;
    }
  } else {
    inverseTime = _feed / _length / inverseTimeUnits;
    if (typeof maxInverseTime === "number") {
      if (inverseTime > maxInverseTime) {
        inverseTime = maxInverseTime;
      }
    }
  }
  return inverseTime;
}

/** Calculate the distance of the tool position to the center of a rotary axis. */
function getRotaryRadius(center, direction, toolPosition) {
  var normal = direction.getNormalized();
  var d1 = toolPosition.x - center.x;
  var d2 = toolPosition.y - center.y;
  var d3 = toolPosition.z - center.z;
  var radius = Math.sqrt(
    Math.pow((d1 * normal.y) - (d2 * normal.x), 2.0) +
    Math.pow((d2 * normal.z) - (d3 * normal.y), 2.0) +
    Math.pow((d3 * normal.x) - (d1 * normal.z), 2.0)
   );
  return radius;
}

/** Calculate the linear distance based on the rotation of a rotary axis. */
function getRadialDistance(axis, startTool, endTool, startABC, endABC) {
  // rotary axis does not exist
  if (!axis.isEnabled()) {
    return 0.0;
  }

  // calculate the rotary center based on head/table
  var center;
  if (axis.isHead()) {
    var pivot;
    if (typeof headOffset === "number") {
      pivot = headOffset;
    } else {
      pivot = tool.getBodyLength();
    }
    center = Vector.sum(startTool, Vector.product(machineConfiguration.getSpindleAxis(), pivot));
    center = Vector.sum(center, axis.getOffset());
  } else {
    center = axis.getOffset();
  }

  // calculate the radius of the tool end point compared to the rotary center
  var startRadius = getRotaryRadius(center, axis.getEffectiveAxis(), startTool);
  var endRadius = getRotaryRadius(center, axis.getEffectiveAxis(), endTool);

  // calculate length of radial move
  var radius = Math.max(startRadius, endRadius);
  var delta = Math.abs(endABC.getCoordinate(axis.getCoordinate()) - startABC.getCoordinate(axis.getCoordinate()));
  if (delta > Math.PI) {
    delta = 2 * Math.PI - delta;
  }
  var radialLength = (2 * Math.PI * radius) * (delta / (2 * Math.PI));
  return radialLength;
}

/** Calculate tooltip, XYZ, and rotary move lengths. */
function getMoveLength(_x, _y, _z, _a, _b, _c) {
  // get starting and ending positions
  var moveLength = new Array();
  var startTool;
  var endTool;
  var startXYZ;
  var endXYZ;
  var startABC = getCurrentDirection();
  var endABC = new Vector(_a, _b, _c);
 
  if (currentSection.getOptimizedTCPMode() == 0) {
    startTool = getCurrentPosition();
    endTool = new Vector(_x, _y, _z);
    startXYZ = machineConfiguration.getOrientation(startABC).getTransposed().multiply(startTool);
    endXYZ = machineConfiguration.getOrientation(endABC).getTransposed().multiply(endTool);
  } else {
    startXYZ = getCurrentPosition();
    endXYZ = new Vector(_x, _y, _z);
    startTool = machineConfiguration.getOrientation(startABC).multiply(startXYZ);
    endTool = machineConfiguration.getOrientation(endABC).multiply(endXYZ);
  }

  // calculate the radial portion of the move
  var radialLength = Math.sqrt(
    Math.pow(getRadialDistance(machineConfiguration.getAxisU(), startTool, endTool, startABC, endABC), 2.0) +
    Math.pow(getRadialDistance(machineConfiguration.getAxisV(), startTool, endTool, startABC, endABC), 2.0) +
    Math.pow(getRadialDistance(machineConfiguration.getAxisW(), startTool, endTool, startABC, endABC), 2.0)
  );

  // calculate the lengths of move
  // tool tip distance is the move distance based on a combination of linear and rotary axes movement
  var linearLength = Vector.diff(endXYZ, startXYZ).length;
  moveLength[0] = linearLength + radialLength;
  moveLength[1] = Vector.diff(endXYZ, startXYZ).length;
  moveLength[2] = 0;
  for (var i = 0; i < 3; ++i) {
    var delta = Math.abs(endABC[i] - startABC[i]);
    if (delta > Math.PI) {
      delta = 2 * Math.PI - delta;
    }
    moveLength[2] += Math.pow(delta, 2.0);
  }
  moveLength[2] = Math.sqrt(moveLength[2]);
  return moveLength;
}
// End of multi-axis feedrate logic]

34
Mach4 General Discussion / Re: Real G93 Gcode anyone
« on: January 28, 2018, 06:07:02 PM »
Here you go a fanuc one

35
rhtuttle just go old school and use a macro b

37
Mach4 General Discussion / Re: Is Mach4 really Hobby Material?
« on: January 21, 2018, 02:54:05 AM »
Have a look at Pokeys

38
Mach4 General Discussion / Re: Is Mach4 really Hobby Material?
« on: January 18, 2018, 07:07:15 PM »
rhtuttle 

More than likely It's just a question I have always wondered if there is a potential problem.

To add Mach4 to a basic 3 axis mill is easy if you have good clear instructions that come with the external devices.

39
Mach4 General Discussion / Re: Is Mach4 really Hobby Material?
« on: January 18, 2018, 02:52:03 PM »
Having Mach4 so you can run any machine type all in one, would there be conflicts with the G and M codes macros and scripts if you were saying useing it to run a lathe would the built in G and M codes macros whatever for a Mill or a plasma cutter interfere with it's operation of the lathe.

40
No in the post for the speed range it's set up as <1   >30000 changing the <1 to <-1 lets the real error come through what is the functions not enabled in the post.

This sort of thing depends on if ADSK or a staff member has a machine running the program or someone pays them and they allow them to let it out to the public, sometimes they just do it if they have someone to do the testing, same goes for resales.

Quite often it's users doing it. 

With the fanuc post if the codes work with Mach4 redoing the post will take time but it will work.