584,879 active members*
5,053 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Mach Software (ArtSoft software) > Somehow my machine is only accurate when running handwritten g-code
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2019
    Posts
    4

    Somehow my machine is only accurate when running handwritten g-code

    Hello guys, newbie here.

    Not really sure where to post this. Is there a Mach4 Sub-Forum? Maybe G-Code forum? Feel free to move if necessary.

    I built the R-CNC from makerfr.com, using a PMDX-416 and Mach4 as a controller.
    CAD and CAM are done in Fusion 360 with the mach4 post-processor.

    Setting it up, I've noticed that the machine is not accurate. "Well, adjust the steps-per-unit, duh!"
    Been there, done that. Multiple times. With multiple different measuring methods. 30+ year old Mitutoyo 10mm 0.01mm resolution indicator and a long ruler. Interestingly they differ quite a lot.
    Calculated the steps-per-unit (SPU) with the built-in wizard in mach4 using the mitutoyo. That resulted a movement of 390mm when told to move 400mm, reading on the long ruler. Its a cheap basic ruler but it can't be off by 10mm over 400mm, can it?!
    So I used the ruler to re-calculate it as I trust a long distance more than the 10mm of the mitutoyo and it looks to be ok when running manual code:

    I wrote a little piece of test code, using a 4mm endmill, I plunged about 0.2mm into a piece of wood before running the code.
    G00 x24
    G00 y24
    G00 x0
    G00 y0

    The result was a perfect rectangle, measuring 20x20mm with my calipers and above mentioned ruler.

    Now comes the fun part.

    I created a small 15x15mm square pocket and a 15mm diameter hole in Fusion, 3mm deep.
    Used a 2D Pocket to generate the toolpath with my 4mm Endmill, all well and good in the simulation.

    Ran the code on the machine and measured the diameters.

    Both the square and the hole were 13mm in diameter. WTF

    I checked everything. Tooldiameter in Fusion is correct, even in the G-Code there's a line finishing the rectangle:
    G1 X35.998
    Y-46.438
    X46.998
    Y-35.438
    X37.619

    I'm no expert but seeing y-46.438 and y-35.438 looks suspiciously like a 15mm distance routed with a 4mm endmill. (11mm distance + 2mm on each side of the endmill)
    So there must be a problem with mach4, right? But then again, the dimensions are fine with the handwritten code.

    I'm slowly going insane.

    Beginning of the G-Code looks like so:
    (ACCURACY-TEST)
    (T2 D=4. CR=0. - ZMIN=-3. - SCHAFTFRSER)
    G90 G94 G91.1 G40 G49 G17
    G21

    (2D POCKET3)
    M5
    T2 M6
    (4MM ALUFRSER 12MM)
    S10000 M3
    G54
    G0 X61.651 Y-42.757
    G43 Z15. H0
    Z5.
    G1 Z2.898 F500.
    X61.677 Y-42.764 Z2.754 F333.
    X61.753 Y-42.784 Z2.628
    X61.868 Y-42.808 Z2.54
    X62.009 Y-42.828 Z2.5

    Just noticed it uses G54 while I'm using G55. Or do I? Offsets have not been an issue. idk.


    Any hints would be greatly appreciated.

    cheers

  2. #2
    Join Date
    Apr 2004
    Posts
    5728

    Re: Somehow my machine is only accurate when running handwritten g-code

    It sounds like it's applying an offset to run inside the rectangle instead of outside it. If your hand-written Gcode works, but the Fusion-generated code doesn't, it's not likely to be a Mach4 problem; I'd look at the G-codes Fusion is inserting at the top of your program (like that G54).. Eliminate any that you wouldn't put in on purpose, and see what it does when run. There's probably a setting in Fusion that tells the tool where the tool should be in relationship to that rectangle; and since it's set incorrectly, it's deducting the radius twice instead of once.
    Andrew Werby
    Website

  3. #3
    Join Date
    Nov 2017
    Posts
    591
    I'm pretty sure 2d pocket defaults with stock to leave. Look at your passes tab and see if there's 1mm radial stock to leave

  4. #4
    Join Date
    Jul 2019
    Posts
    4

    Re: Somehow my machine is only accurate when running handwritten g-code

    Stock to leave is turned off, my first thought too

    I've tried removing all arguments, the code literally started with the move to the entry position. No difference.
    I even ran the generated code from the MDI but still no difference.
    Reinstalled Mach4 and setup a profile from scratch (Had been using the default PMDX-Profile), no difference.

    I cut into the side of a piece of wood by moving the y-axis, then ran "g00 x14" and moved the y-axis again into the wood, and the resulting distance between the two cuts was 10mm, as it should be.
    I then did the same thing with "G1 x14 F500" and again the result was accurate. So it can't be something about the G1 vs G00 moves. But there's nothing left.
    I will try further and manually program with the MDI, going through the program step by step.

    The most frustrating thing is that it worked. The damn thing was accurate. But I had some stability issued with my Windows install, so I upgraded to a 64-Bit Dual Core and reinstalled Win7 Professional. And then trying to make a fixture plate I discovered the issue.

  5. #5
    Join Date
    Jul 2019
    Posts
    4

    Re: Somehow my machine is only accurate when running handwritten g-code

    Reinstalled the driver for the PMDX-Controller, no difference.

    Then I ran this part of the g-code from the MDI. Its the "finishing" pass of the square.
    G1 X2.
    Y-13.
    X13.
    Y-2.
    X3.621
    X3.545 Y-2.007 Z-2.985
    X3.471 Y-2.029 Z-2.97
    X3.413 Y-2.058 Z-2.926
    X3.361 Y-2.096 Z-2.883
    X3.329 Y-2.126 Z-2.818
    X3.302 Y-2.159 Z-2.753
    X3.284 Y-2.184 Z-2.6
    G0 Z5.

    Aaaand it produced the error. So there's gotta be something wrong in here.
    Only thing I can think of is the fact that G1 is only expressed once and not at the beginning of every line. But as I said, I'm no expert and I have basically no experience with g-code except for the last few weeks playing around with the cnc.

  6. #6
    Join Date
    Nov 2017
    Posts
    591
    Quote Originally Posted by dj_ordje View Post
    Reinstalled the driver for the PMDX-Controller, no difference.

    Then I ran this part of the g-code from the MDI. Its the "finishing" pass of the square.
    G1 X2.
    Y-13.
    X13.
    Y-2.
    X3.621
    X3.545 Y-2.007 Z-2.985
    X3.471 Y-2.029 Z-2.97
    X3.413 Y-2.058 Z-2.926
    X3.361 Y-2.096 Z-2.883
    X3.329 Y-2.126 Z-2.818
    X3.302 Y-2.159 Z-2.753
    X3.284 Y-2.184 Z-2.6
    G0 Z5.

    Aaaand it produced the error. So there's gotta be something wrong in here.
    Only thing I can think of is the fact that G1 is only expressed once and not at the beginning of every line. But as I said, I'm no expert and I have basically no experience with g-code except for the last few weeks playing around with the cnc.
    Really hard to figure out what's going on here. I can see from the code it's commanding 11mm moves. With a 4mm cutter, that should be a 15mm square. I hate to ask this, but are you sure your cutter is 4mm? I'm sure it is, just have to ask lol. The only other explanation here is inconsistent cutter comp setup. In fusion 360 under passes tab, what is your compensation type?

    I personally don't use cutter comp so not really sure what to look for in the mach4 end, but cutter comp settings is the only possibility I see here other than your cutter not actually being 4mm. When you ran the small snippet shown here, there must have still been something modal activated causing the comp. Like I said, I'm not really experienced with cutter comp setup, but I'm guessing it's related to that.

  7. #7
    Join Date
    Jul 2019
    Posts
    4

    Re: Somehow my machine is only accurate when running handwritten g-code

    Cutter comp in Fusion is set to "In computer". So there is no compensation going on in mach4, I think there's even a G40 command at the top to turn it off.
    I did a cut with the endmill (Its two weeks old btw) and it was 4mm wide.

    It might just be my new pc hardware. I've since completely reinstalled my machine, including new downloads of all software/plugins and a softwareupdate of the PMDX Controller. No difference.
    I'm reverting back this night and tomorrow to the old 32 bit system and we'll see it that makes a difference. If it does not, I will officially declare the experiment over

  8. #8
    Join Date
    Apr 2014
    Posts
    215
    Quote Originally Posted by dj_ordje View Post
    .....

    Beginning of the G-Code looks like so:
    (ACCURACY-TEST)
    (T2 D=4. CR=0. - ZMIN=-3. - SCHAFTFRSER)
    G90 G94 G91.1 G40 G49 G17
    G21

    (2D POCKET3)
    M5
    T2 M6
    (4MM ALUFRSER 12MM)
    S10000 M3
    G54
    G0 X61.651 Y-42.757
    G43 Z15. H0
    Z5.
    G1 Z2.898 F500.
    X61.677 Y-42.764 Z2.754 F333.
    X61.753 Y-42.784 Z2.628
    X61.868 Y-42.808 Z2.54
    X62.009 Y-42.828 Z2.5

    Just noticed it uses G54 while I'm using G55. Or do I? Offsets have not been an issue. idk.


    Any hints would be greatly appreciated.

    cheers
    can you machine handle a feedrate of 500mm/min while cutting?

    is something slipping mechanically?

Similar Threads

  1. Y Axis + Slave not running together when running G-Code
    By Fierra in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 05-19-2017, 08:56 AM
  2. Running G-Code for only one machine setup
    By f1oat in forum BobCad-Cam
    Replies: 3
    Last Post: 02-09-2015, 11:22 PM
  3. Need HELP uploading a handwritten program
    By keystone76 in forum Fadal
    Replies: 2
    Last Post: 01-05-2012, 10:53 PM
  4. Joe's 2006 running smooth and accurate.
    By robertmonroe in forum Joes CNC Model 2006
    Replies: 0
    Last Post: 05-12-2009, 05:55 AM
  5. My machine should be more accurate right?
    By idtkid in forum DIY CNC Router Table Machines
    Replies: 4
    Last Post: 04-27-2009, 10:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •