Hello Guest it is March 29, 2024, 01:53:39 AM

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 - Benjammann

Pages: « 1 2 3 »
11
Hi Craig,

   Sorry about that. You are right, this code is from the post processor. I had it in my head that it is what is causing the issue and needs to be changed. Please find the Gcode below.

The error occurs before the final descent to start cutting.  I might start a new run today and try to get it on video.

Code: [Select]
(1001)
( .125 MILL)
(T4  D=0.25 CR=0. - ZMIN=-0.325 - FLAT END MILL)
N1 G90 G94 G91.1 G80 G40 G49 G17 G0
N2 G20
N3 G53 Z-2
N4 G53 Y2

(SINGLE POCKET)
N6 M5
N7 M9
N8 T4 M6
N9 M0 (CHANGE-TOOL)
(14 2 FLUTE ENDMILL)
N10 S5500 M3
N11 G54
N12 M9
N13 G17
N14 G0 X2.0681 Y2.0217
N15 G43 Z0.925 H4
/ N16 M0 (CHECK-TOOL)
N17 G0 Z0.255
N18 G1 Z0.1345 F10.
N19 G3 X2.0687 Y2.0214 Z0.1288 I0.0569 J0.1033
N20 X2.0704 Y2.0205 Z0.1235 I0.0563 J0.1036
N21 X2.0732 Y2.0191 Z0.1186 I0.0546 J0.1046
N22 X2.0769 Y2.0173 Z0.1147 I0.0518 J0.106
N23 X2.0815 Y2.0154 Z0.1117 I0.0481 J0.1077
N24 X2.0866 Y2.0135 Z0.11 I0.0435 J0.1096

12
Hi,

  Thanks for the help. I think I've found the relevant post processor code. Ill post it below. Ill try to describe one of my ideas: So in Fusion 360, you can set a retract plane, a feed plane, a safe plane, it's like 3-4 different planes that admittedly are a bit confusing. I'm wondering if there is something I'm doing something slightly different on the failing runs with the z height that is interacting with one of the plane heights in a strange way, like it doesnt know what to do if it starts above vs below a certain point.  I guess I could test by trying a completly different post processor and see if anything changes. I'm going to be doing another prototype production run this weekend, so im sure ill run into this issue again. I might even try to capture it on video. It happens on at least 1 out of 5 runs. I agree it does seem like it would be a step or motor issue. It's super frustrating to know that at any moment the end mill will try to plunge 2" below the table.

Thanks again.

Code: [Select]
function onSection() {
  var insertToolCall = isFirstSection() ||
    currentSection.getForceToolChange && currentSection.getForceToolChange() ||
    (tool.number != getPreviousSection().getTool().number);
  
  var retracted = false; // specifies that the tool has been retracted to the safe plane
  var newWorkOffset = isFirstSection() ||
    (getPreviousSection().workOffset != currentSection.workOffset); // work offset changes
  var newWorkPlane = isFirstSection() ||
    !isSameDirection(getPreviousSection().getGlobalFinalToolAxis(), currentSection.getGlobalInitialToolAxis());
  if (insertToolCall || newWorkOffset || newWorkPlane) {
    
    if (properties.useG28) {
      // retract to safe plane
      retracted = true;
      //writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(machineConfiguration.getRetractPlane())); // retract
 writeBlock(gFormat.format(53), "Z-2");// FRANCO 1-22-17
 writeBlock(gFormat.format(53), "Y2");// FRANCO 1-22-17
      writeBlock(gAbsIncModal.format(90));
      zOutput.reset();
    }
  }

  writeln("");

  if (hasParameter("operation-comment")) {
    var comment = getParameter("operation-comment");
    if (comment) {
      writeComment(comment);
    }
  }

  if (insertToolCall) {
    forceWorkPlane();
    
    onCommand(COMMAND_STOP_SPINDLE);
    onCommand(COMMAND_COOLANT_OFF);
  
    if (!isFirstSection() && properties.optionalStop) {
       onCommand(COMMAND_OPTIONAL_STOP);
     }

    if (tool.number > 256) {
      warning(localize("Tool number exceeds maximum value."));
    }

    if (properties.useM6) {
      writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
 writeBlock(mFormat.format(0), "(CHANGE-TOOL)"); // FRANCO 1-22-17
    } else {
      writeBlock("T" + toolFormat.format(tool.number));
    }
    if (tool.comment) {
      writeComment(tool.comment);
    }
    var showToolZMin = false;
    if (showToolZMin) {
      if (is3D()) {
        var numberOfSections = getNumberOfSections();
        var zRange = currentSection.getGlobalZRange();
        var number = tool.number;
        for (var i = currentSection.getId() + 1; i < numberOfSections; ++i) {
          var section = getSection(i);
          if (section.getTool().number != number) {
            break;
          }
          zRange.expandToRange(section.getGlobalZRange());
        }
        writeComment(localize("ZMIN") + "=" + zRange.getMinimum());
      }
    }

    if (properties.preloadTool && properties.useM6) {
      var nextTool = getNextTool(tool.number);
      if (nextTool) {
        writeBlock("T" + toolFormat.format(nextTool.number));
      } else {
        // preload first tool
        var section = getSection(0);
        var firstToolNumber = section.getTool().number;
        if (tool.number != firstToolNumber) {
          writeBlock("T" + toolFormat.format(firstToolNumber));
        }
      }
    }
  }
  
  if (insertToolCall ||
      isFirstSection() ||
      (rpmFormat.areDifferent(tool.spindleRPM, sOutput.getCurrent())) ||
      (tool.clockwise != getPreviousSection().getTool().clockwise)) {
    if (tool.spindleRPM < 1) {
      error(localize("Spindle speed out of range."));
      return;
    }
    if (tool.spindleRPM > 99999) {
      warning(localize("Spindle speed exceeds maximum value."));
    }
    writeBlock(
      sOutput.format(tool.spindleRPM), mFormat.format(tool.clockwise ? 3 : 4)
    );
  }

  // wcs
  if (insertToolCall) { // force work offset when changing tool
    currentWorkOffset = undefined;
  }
  var workOffset = currentSection.workOffset;
  if (workOffset == 0) {
    warningOnce(localize("Work offset has not been specified. Using G54 as WCS."), WARNING_WORK_OFFSET);
    workOffset = 1;
  }
  if (workOffset > 0) {
    if (workOffset > 6) {
      var p = workOffset; // 1->... // G59 P1 is the same as G54 and so on
      if (p > 254) {
        error(localize("Work offset out of range."));
      } else {
        if (workOffset != currentWorkOffset) {
          writeBlock(gFormat.format(59), "P" + p); // G59 P
          currentWorkOffset = workOffset;
        }
      }
    } else {
      if (workOffset != currentWorkOffset) {
        writeBlock(gFormat.format(53 + workOffset)); // G54->G59
        currentWorkOffset = workOffset;
      }
    }
  }

  forceXYZ();

  if (machineConfiguration.isMultiAxisConfiguration()) { // use 5-axis indexing for multi-axis mode
    // set working plane after datum shift

    var abc = new Vector(0, 0, 0);
    if (currentSection.isMultiAxis()) {
      forceWorkPlane();
      cancelTransformation();
    } else {
      abc = getWorkPlaneMachineABC(currentSection.workPlane);
    }
    setWorkPlane(abc);
  } else { // pure 3D
    var remaining = currentSection.workPlane;
    if (!isSameDirection(remaining.forward, new Vector(0, 0, 1))) {
      error(localize("Tool orientation is not supported."));
      return;
    }
    setRotation(remaining);
  }

  // set coolant after we have positioned at Z
  {
    var c = mapCoolantTable.lookup(tool.coolant);
    if (c) {
      writeBlock(mFormat.format(c));
    } else {
      warning(localize("Coolant not supported."));
    }
  }

  forceAny();
  gMotionModal.reset();

  var initialPosition = getFramePosition(currentSection.getInitialPosition());
  if (!retracted) {
    if (getCurrentPosition().z < initialPosition.z) {
      writeBlock(gMotionModal.format(0), zOutput.format(initialPosition.z));
    }
  }

  if (insertToolCall || retracted) {
    var lengthOffset = tool.lengthOffset;
    if (lengthOffset > 256) {
      error(localize("Length offset out of range."));
      return;
    }

    gMotionModal.reset();
    writeBlock(gPlaneModal.format(17));
    
    if (!machineConfiguration.isHeadConfiguration()) {
      writeBlock(
        gAbsIncModal.format(90),
        gMotionModal.format(0), xOutput.format(initialPosition.x), yOutput.format(initialPosition.y)
      );
      writeBlock(gMotionModal.format(0), gFormat.format(43), zOutput.format(initialPosition.z), hFormat.format(lengthOffset));
 writeBlockSkip(mFormat.format(0), "(CHECK-TOOL)");// FRANCO 1-22-17
 gMotionModal.reset(); // FRANCO 2/7/17
    } else {
      writeBlock(
        gAbsIncModal.format(90),
        gMotionModal.format(0),
        gFormat.format(43), xOutput.format(initialPosition.x),
        yOutput.format(initialPosition.y),
        zOutput.format(initialPosition.z), hFormat.format(lengthOffset)
      );
    }
  } else {
    writeBlock(
      gAbsIncModal.format(90),
      gMotionModal.format(0),
      xOutput.format(initialPosition.x),
      yOutput.format(initialPosition.y)
    );
  }
}

function onDwell(seconds) {
  if (seconds > 99999.999) {
    warning(localize("Dwelling time is out of range."));
  }
  if (properties.dwellInSeconds) {
    writeBlock(gFormat.format(4), "P" + secFormat.format(seconds));
  } else {
    milliseconds = clamp(1, seconds * 1000, 99999999);
    writeBlock(gFormat.format(4), "P" + milliFormat.format(milliseconds));
  }
}

function onSpindleSpeed(spindleSpeed) {
  writeBlock(sOutput.format(spindleSpeed));
}

function onCycle() {
  writeBlock(gPlaneModal.format(17));
}

function getCommonCycle(x, y, z, r) {
  forceXYZ();
  return [xOutput.format(x), yOutput.format(y),
    zOutput.format(z),
    "R" + xyzFormat.format(r)];
}

13
Hi Craig,  Yes, I did follow the exercising of the Z axis as suggested and it followed the commands perfectly. Also, the DRO will suddenly set itself to be lower than what I set it to be before hitting run. I haven’t been able to document the exact moment it does this, but it’s within the first few moves I described in the above text.

Thanks
Ben

14
Hello,

  I'm having a strange issue where my Z will reset itself to be a few inches below what I set it to. It does not do this all the time, but very often. I set my X and Y, then Z. I leave the mill at Z zero and hit run. Due to the post processor I am using, the arbor then moves up and forward expecting a tool change, which i just skip though and then it goes and hovers to what I think is the retract plane I set in fusion 360, usually .6" above the part, until I hit run again and it finally starts cutting. Very often though it does not stop and hover, but somehow it keeps setting the z to be a few inches below the part, and it tries to plunge itself down into the table. I can usually catch it, just very frustrating. I have to stop, reset zero, then it will work usually.

I'm starting to think this might be some sort of conflict with my post processor and how I have the retract and clearance planes set up in Fusion 360. I don't think it's missing steps. Ive tuned my motors well.

Anyone have any ideas? Ive attached my post processor that shows the starting moves it's doing.

Thanks,
Ben

15
Hey, Thanks for all your help. This was the solution!

Code "G90 G0 Z.500" 'retract Z to .500 inch
   Code "G91 G0 Y-.100 X1.0"
   Code "G90 G0 Z-.200"
   Code "F" &CurrentFeed 'Returns to prior feed rate
  While IsMoving ()
   Wend

End If

16
Yes because my table travel is short so I have to locate in the middle of a part. But whenever I get it working ill take this code and transfer it to the other buttons for other corners.

17
I think it stops before it gets that far, but I'll give it a shot this evening.

18
Thanks so much! I'll try this as soon as I get home tonight. I'm working in Imperial (Inches)

EDIT:  Although in looking at the code you posted, it doesn't seem you changed anything above my problem area. I get the error when Z retracts to .5" near the beginning...

19
Looks like I made an error copying the above code. I've posted the correct code below.

The code is supposed to automatically zero the XYZ axis by first probing down to the top of the plate, then jogs over to find the X, then the Y.  I can get it to work by manually touching the plate to the probe, but any time the plate is resting on the wood or aluminum material a grounding error occurs. I think it's because I can quickly pull the plate away and some sort of double signal is not sent that causes the error.

Here is the code that causes the error:

Code: [Select]
Rem   Auto corner finding X-Y-Z-(button3) With tool diameter Input

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825)<>0 Then 'Check to see if the probe is already grounded or faulty
Call ProbeGrounded()
Exit Sub
Else
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' two second delay
Code "G90 G31 Z-1.0 F5" 'Z goes down a max of 1.0 at 5IPM
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2,0.000)
Code "G4 P0.25" 'Pause for Dro to update.
Code "G90 G0 Z.500" 'retract Z to .500 inch
Code "G91 G0 Y-.100 X1.0"
Code "G90 G0 Z-.200"
Code "F" &CurrentFeed 'Returns to prior feed rate
End If

Rem VBScript For probing In the x- direction

If GetOemLed (825)<>0 Then      'May need to use =0 if it errors
Call ProbeGrounded()          'Check to see if the probe is already grounded or faulty
Exit Sub
Else
Code "G4 P1" 'Pause 1 second to give time to position probe plate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F4"

Rem Probe Left

XNew = GetDro(0) - 3 'probe to current position - 3 inches
Code "G31 X" &XNew
While IsMoving() 'wait for prob move to complete
Wend
XNew = GetVar(2000) 'read the touch point

Rem move back To the hit point incase there was an overshoot

Code "G90 G0 Z.500"
Code "G90 G0 X" &XNew
Code "G91 X-" &CurrentToolDiameter/2  'moves the probe half the tool diameter to center on edge
        

While IsMoving ()
Wend
        Call SetDro (0,0.000)
        Code "G4 P0.25"
        Code "G91 G0 X-.200 Y1.0"
        Code "G90 G0 Z-.200"
Code "F" &CurrentFeed 'restore original feed rate
End If

Rem VBScript For probing In the Y- direction

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Call ProbeGrounded()
Exit Sub
Else
Code "G4 P1" 'Pause 1 second to give time to position probe plate

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F4" 'Slow feedrate to 4 ipm

Rem Probe up

YNew = GetDro(1) - 3 'move to current y position + 3 inches
Code "G31 Y" &YNew
While IsMoving() 'wait for the move to finish
Wend
YNew = GetVar(2001) 'read the touch point

Rem move back To the hit point incase there was an overshoot

        Code "G90 G0 Z.500"
Code "G90 G0 Y" &YNew
        Code "G91 Y-" &CurrentToolDiameter/2  'moves the probe half the tool diameter to center on edge

While IsMoving ()
Wend
        Call SetDro (1,0.000)
        Code "G4 P0.25"
        Code "G90 G0 X0.0"
Code "F" &CurrentFeed 'restore original feed rate
        Code "(X, Y, and Z axis' are now zeroed)"
        Call ReturnG90G91State()
        Exit Sub
End If

Sub ProbeGrounded()
Code "(Probe plate is grounded, check connection and try again)"
Call ReturnG90G91State()
End Sub

Sub ReturnG90G91State()
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
End Sub    

 

20
Yes, when I go to diagnostics there are no lights on until I touch the plate to the probe. Also, when I run the auto-zero, I can make it work by manually touching the plate to Z and then quickly removing it. That's the only way it will continue to probe X and Y.

I put a two-second pause between every line of code and still It does not work. I also tried commenting out as much code as possible to isolate the issue. Every time after It touches the plate, the next move causes the plate grounding error.

Pages: « 1 2 3 »