585,743 active members*
5,039 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2007
    Posts
    15

    G-code "bigger" than machine area

    Hi,
    I have some g-code files written for bigger machine.
    I want to subtract the same number from each X coordinate in the file, so the code will fit into my machine.
    Doing this manually is a enormous job.
    Does someone knew how to do this automatically?
    Here is an example in attachment.

    Any help will be appreciated.
    mrpeja

  2. #2
    Join Date
    Mar 2003
    Posts
    35538

    Re: G-code "bigger" than machine area

    Some controls allow you to scale the g-code up or down in size.
    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)

  3. #3
    Join Date
    Nov 2012
    Posts
    1267

    Re: G-code "bigger" than machine area

    Do you want to scale the part or shift it? If you want to shift it, just change the origin on the machine itself and leave the G-code file as is.

  4. #4
    Join Date
    Dec 2007
    Posts
    15

    Re: G-code "bigger" than machine area

    Hi, CitizenOfDreams,
    Thanks for fast reply.
    I want to shift the part.
    Because machine's mechanical area is so small that I can't change the origin on the machine itself, it is still near to mechanical limit at the beginning and
    biggest X axis coordinate feeds into another mechanical limit switch.
    There is some margin incorporated in code during generating G-code file(about 0.3 inch) and I want to substract this amount from each X number.
    Is this possible (but not manually)?
    mrpeja

  5. #5
    Join Date
    Nov 2012
    Posts
    1267

    Re: G-code "bigger" than machine area

    Subtracting a fixed number from all the X coordinates would have exactly the same effect as shifting the machine origin. How much X travel does your machine have?

  6. #6
    Join Date
    May 2005
    Posts
    1662

    Re: G-code "bigger" than machine area

    If you need to split or scale gcode G-Code Ripper can do this. Don't worry his software is safe (no virus) and reliable
    Link below:
    G-Code Ripper
    Anyone who says "It only goes together one way" has no imagination.

  7. #7
    Join Date
    Dec 2007
    Posts
    15

    Re: G-code "bigger" than machine area

    My machine has travel up to 19 inch and in another file (not this I have sent) there is coordinates up to 19,5 inch.
    I have G-code ripper already downloaded, but didn't realize how to shift origin, yet.
    Shift or split?
    Maybe some help?
    mrpeja

  8. #8
    Join Date
    Nov 2012
    Posts
    1267

    Re: G-code "bigger" than machine area

    I still do not understand why you are insisting on shifting the coordinates in the g-code and not on the machine. If your file goes like this:

    G0 X7000.0
    G0 X7005.0

    you can still run this file as is on a 5-inch machine by setting the machine's origin to X=7000.

  9. #9
    Join Date
    Jun 2015
    Posts
    4154

    Re: G-code "bigger" than machine area

    hi mrpeja, i hope i got it rigth : pls check attached, about shifting X coords of your file

    you may split your code and shift each fragment, or leave the fragments as they are & shift the origin of the program ( like put the origin out of the machining area )

    also, there are other solutions, like :
    ... creating the program in the right way from the start, so to avoid later editing time; a cam that can restrain a toolpath inside a perimeter should do the job
    ... replace X15.456 with X=common_variable+15.456, and initialize the common variable with the desired translation value; this is faster then editing the entire code content

    kindly

    Code:
    M3
    N4571 T5 M06 S0 
    N4573 G81 X-14.872 Y0.591 Z-0.2800 R0.0500 F12.00
    N4575 X-14.469 
    N4577 X-19.518 
    N4579 X-19.921 
    N4581 X-24.567 
    N4583 X-24.97 
    N4585 X-29.616 
    N4587 X-14.872 Y7.795 
    N4589 X-14.469 
    N4591 Y-21.801 
    N4593 X-14.872
    N4595 X-19.518
    N4597 Y-22.205
    N4599 X-19.921
    N4601 Y-21.801
    N4603 X-24.567
    N4605 Y-22.205
    N4607 X-24.97
    N4609 Y-21.801
    N4611 X-29.616
    N4613 Y-22.205
    N4615 Y-14.596
    N4617 X-24.97
    N4619 X-24.567
    N4621 X-19.921
    N4623 X-19.518
    N4625 X-14.872 
    N4627 X-14.469 
    N4629 G00 X-14.469 Y15.404 Z0.0000
    M02 
    M30
    Attached Files Attached Files
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  10. #10
    Join Date
    Jun 2015
    Posts
    4154

    Re: G-code "bigger" than machine area

    hello again, maybe code translation will work for you :

    Code:
     
      ( this is your code, edited )
    
        #500 = - 30 ( translation value )
    
    
        M03
        T5 M06 S?
        G81 X=#500+15.1280 Y00.5910 Z-0.2800 R0.0500 F12.00
            X=#500+15.5310
            X=#500+10.4820
            X=#500+10.0790
            X=#500+05.4330
            X=#500+05.0300
            X=#500+00.3840
            X=#500+15.1280 Y07.7950
            X=#500+15.5310
                           Y08.1990
            X=#500+15.1280
            X=#500+10.4820
                           Y07.7950
            X=#500+10.0790
                           Y08.1990
            X=#500+05.4330
                           Y07.7950
            X=#500+05.0300
                           Y08.1990
            X=#500+00.3840
                           Y07.7950
                           Y15.4040
            X=#500+05.0300
            X=#500+05.4330
            X=#500+10.0790
            X=#500+10.4820
            X=#500+15.1280
            X=#500+15.5310
        G00 X=#500+15.5310 Y15.4040 Z0.0000
    
    
      ( M02 )
    
    
    M30
    or a temp work coordinate shift ?

    Quote Originally Posted by mrpeja View Post
    ... but didn't realize how to shift origin
    pls share machine and control : if you are lucky, someone will give you the right codes / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  11. #11
    Join Date
    Dec 2007
    Posts
    15

    Re: G-code "bigger" than machine area

    Hi, deadlykitten,
    Thanks for the reply. I think this will be the solution if Mach1 (Weeeery oooold!) can understand code translation. I must look in manual for Mach1.
    If someone already knew, please let me knew me to.
    By the way, my machine is homemade.
    mrpeja

Similar Threads

  1. Profile Rail Wood Frame Router, 25" x 37" x 6" working area
    By jpvonoy in forum CNC Wood Router Project Log
    Replies: 76
    Last Post: 03-01-2019, 03:47 AM
  2. Replies: 5
    Last Post: 12-08-2014, 05:00 AM
  3. X Axis "Goes Off Pattern", "Awry", "Skewed", "Travels"
    By DaDaDaddio in forum Laser Engraving / Cutting Machine General Topics
    Replies: 1
    Last Post: 05-06-2013, 09:59 AM
  4. Post adds "A0." code and machine stops
    By lookingforhelp1 in forum Fanuc
    Replies: 10
    Last Post: 08-29-2008, 06:58 PM
  5. Post adds "A0." code and machine stops
    By lookingforhelp1 in forum Post Processors for MC
    Replies: 2
    Last Post: 08-29-2008, 06:14 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
  •