547,444 active members*
1,544 visitors online*
Register for free
Login
IndustryArena Forum > WoodWorking Machines > DIY CNC Router Table Machines > Coordinates change and scale when G-code is loaded
Results 1 to 12 of 12
  1. #1
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16

    Coordinates change and scale when G-code is loaded

    Hey everyone! I basically built a CNC recently, it consists of:

    8020 frame (1530)
    Steel rails with extended linear carriages from cncrouterparts.com
    R&P system from cncrouterparts for X&Y axes
    Homebuilt threaded rod Z axis
    Gecko G540
    Big Power Supply
    Mach3

    Basically all the electronics are from this kit HERE


    I loaded Gecko's .xml file for Mach3. Changed the motor tuning to 1909.861 steps per for X&Y, and 35000 for Z. This results in accurate movements... UNTIL I try to load some G-code in. At this point the origin moves and the motor tuning somehow changes (although all the settings remain the same). All I can think of is that the G-code has something weird in it... I don't know much about G-code though.

    The odd thing is that before I changed out the electronics the same code worked just fine (the old setup had some ghetto DIY hobbycnc board and motors that stalled out easily).

    Here's the start of my G-code:

    "( Mach2/3 Postprocessor )
    N10G00G20G17G20G90G40G49G80
    N20G70
    N30T1M06
    N40G00G43Z0.2000H1
    N50S12000M03
    N60G94
    N70X0.0000Y0.0000F250.0
    N80G00X11.9818Y42.4337Z0.2000
    N90G01Z-0.1000F60.0
    N100G01Y0.7643F250.0"



    Maybe I'm missing something really simple, but any and all help would be appreciated!!

    Frary

  2. #2
    Member
    Join Date
    Apr 2007
    Posts
    8082
    I think the default in a new Mach3 installation is metric units. Change it to inches, then be sure to save it under the Config menu list.
    CarveOne
    http://www.carveonecncwoodcraft.com

  3. #3
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16
    Quote Originally Posted by CarveOne View Post
    I think the default in a new Mach3 installation is metric units. Change it to inches, then be sure to save it under the Config menu list.
    Can G-Code affect this setting? I've had Mach3 installed for several months now, running in inches. When I open Mach3 everything works perfect, jog 6 inches and the machine tells me 6.00". Then I load some G-code and when you move 6 inches it reads out way way less, around 1.00" on the display screen

  4. #4
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    35473
    No, g-code doesn't affect the native units. However, make sure that your native units are set to inches, and your currently in inch mode (G20) when you jog the 6".
    It's possible to set up the machine with mm Native Units, but you set the step/s unit so that it appears it moves in inches. When you load a g-code with a G20 in this situation, the distances will be incorrect.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  5. #5
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16
    After reading up on G-code for awhile it seems to me that the "G90" on the first line may be better if changed to "G91".... If I'm reading this right, G90 references absolute coordinates, whereas the G91 will go off of wherever the machine was moved to and zero'd at?

    When I get home tonight I'll load the new version and see what happens

  6. #6
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    35473
    You can't just change the G90 to G91. The code won't run.

    And no, that's not how it works. When your CAM software creates code in Absolute format, it's in absolute positions from where you zero'd it.

    When g-code is in Incremental mode (G91), the position of each line of code is relative to the previous line of code.

    You're post processor adds the G90 to make sure that it is run in Absolute mode.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  7. #7
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16
    I see. I have much more learning to do. Thanks Gerry.

    So G90 is what I want. I zero it right at the origin of the part, then load G-code, and all of a sudden the display changes so it's not zero'd and the tuning gets weird.

    I'll try messing with the cam software tonight, triple check units, and maybe reinstall Mach3...

  8. #8
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    35473
    In Mach3, what are your native units set to?
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  9. #9
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16
    Quote Originally Posted by ger21 View Post
    In Mach3, what are your native units set to?
    I got it all worked out yesterday, I guess the .xml changed the native units to mm. I just re-generated the g-code in mm format and was able to get a nice looking part from it! Thanks.

    Wish I would have thought of that before posting... oh well, learned some things.

  10. #10
    Community Moderator ger21's Avatar
    Join Date
    Mar 2003
    Posts
    35473
    Mach3 defaults to mm. My guess is that you set up the machine to run in inches, but left the native Units setting on mm. That will give you the results you saw.
    If you want to run in inches, then set the Native Units to inches, and re enter the proper steps/unit, and accel and velocity.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  11. #11
    Neuer Benutzer
    Join Date
    Feb 2013
    Posts
    16
    The only odd thing is that I didn't install Mach3 when I built this machine, I ran it for months beforehand with all my files in inches. Doesn't matter what happened I guess.

    I may switch back, but I read somewhere that doing things in mm will have slightly higher resolution.... which is probably offset by my machine anyways haha.

    Thanks for the help Gerry! CNC's are amazing tools, and this is by far one of the most extensive resources of information that I've found. Gotta love forums.

  12. #12
    Quote Originally Posted by ger21 View Post
    No, g-code doesn't affect the native units. However, make sure that your native units are set to inches, and your currently in inch mode (G20) when you jog the 6".
    It's possible to set up the machine with mm Native Units, but you set the step/s unit so that it appears it moves in inches. When you load a g-code with a G20 in this situation, the distances will be incorrect.
    O too have a similar situation. Haven't ran my cnc for about a week. I open everything up, load my parts, and git the start button. Machine set to run a 3 inch circle....and it tries to make a 9 inch circle and I have not changed a thing. Any ideas?

Similar Threads

  1. G-Code Ripper - Scale, Rotate and Split G-code
    By scorch in forum OpenSource Software
    Replies: 112
    Last Post: 08-26-2020, 03:28 PM
  2. How to change drawing scale
    By APD_CNC in forum SolidEdge
    Replies: 11
    Last Post: 09-29-2015, 08:22 PM
  3. Need Help! Z Zero and Z machine coordinates change during run
    By wmpinion in forum Machines running Mach Software
    Replies: 4
    Last Post: 08-02-2013, 02:02 AM
  4. Help - Problems with Z coordinates in g code
    By Socalsurferx in forum G-Code Programing
    Replies: 4
    Last Post: 03-12-2006, 11:12 AM
  5. Help!! Problem With Z coordinates in G code
    By Socalsurferx in forum Mastercam
    Replies: 7
    Last Post: 01-30-2006, 06:24 AM

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
  •