584,826 active members*
5,275 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > OpenSource Software > G-Code Ripper - Scale, Rotate and Split G-code
Page 1 of 6 123
Results 1 to 20 of 113
  1. #1
    Join Date
    Dec 2010
    Posts
    226

    G-Code Ripper - Scale, Rotate and Split G-code

    I have posted a new program one my web page called G-Code Ripper that can read an existing g-code file and scale, rotate and split the g-code as needed.

    This program takes an existing g-code file and splits it into two halves. Linear and arc movements are broken into smaller lines and arcs on either side of the parting line. The attached pictures show a design that I cut using the program. I used the splitting and rotation features to allow my small CNC machine to cut a larger image. The smaller eagle in the last picture is the largest eagle I could cut on my machine without splitting the image.

    In addition to the basics the program understands the following g-code features:
    • Reads "Absolute" and "incremental" coordinates
    • Evaluates expressions (i.e. [2*3])
    • Understands parameters (i.e. #1,#2 and #)
    • Understands and interprets YZ and ZX arcs (converted to linear motions for compatibility with splitting and rotation)

    Attachment 196010Attachment 195996Attachment 196004

    Scorch

  2. #2
    Join Date
    Dec 2007
    Posts
    362
    Good to see some open source CNC stuff I can use on Linux.
    As soon as I re-assemble my CNC router (too cold in the shed) , I'll try these out.
    Regards
    Geoff

  3. #3
    Join Date
    Jul 2009
    Posts
    419
    Very cool Scorch!

    I wish I could code as easily as you seem to be able to!
    Sven
    http://www.puresven.com/?q=building-cnc-router

  4. #4
    Join Date
    Jul 2008
    Posts
    340
    FYI, neither of the download links for the zipped executables work. I'm getting 404, page not found.


    Sent from my Xoom using Tapatalk 4
    CRP-4848 CNC Router, CNC G0463 (Sieg X3) Mill, 9"x20" HF CNC Lathe (current project)

  5. #5
    Join Date
    Dec 2010
    Posts
    226
    Thanks, the links are fixed now.

    Scorch
    Scorch
    www.scorchworks.com

  6. #6
    Join Date
    Jul 2008
    Posts
    340
    Quote Originally Posted by scorch View Post
    Thanks, the links are fixed now.

    Scorch
    Thank you. Links confirmed working. I was able to download the window package.

    Sent from my Xoom using Tapatalk 4
    CRP-4848 CNC Router, CNC G0463 (Sieg X3) Mill, 9"x20" HF CNC Lathe (current project)

  7. #7
    Join Date
    Dec 2010
    Posts
    226
    I uploaded a new version of G-Code Ripper based on comments in another thread.

    - G-code Ripper will now ignore line numbers (previously it aborted reading on N codes)
    - Added a option for scaling the feed rate.

    Version 0.02 is available here: G-Code Ripper


    When I have time I think I will add the following features:
    - Option to set the output precision (number of decimal places)
    - Option to include line numbers in the output (N codes)
    - Option to lock the scaling of Z, XY and Feed so you only need to enter the scale once if they are all the same
    - Only output feed rate and axis positions when they change. (Reduces the output file size)

    Scorch

  8. #8
    Join Date
    Jan 2011
    Posts
    40
    Quote Originally Posted by scorch View Post
    I uploaded a new version of G-Code Ripper based on comments in another thread.

    - G-code Ripper will now ignore line numbers (previously it aborted reading on N codes)
    - Added a option for scaling the feed rate.

    Version 0.02 is available here: G-Code Ripper


    When I have time I think I will add the following features:
    - Option to set the output precision (number of decimal places)
    - Option to include line numbers in the output (N codes)
    - Option to lock the scaling of Z, XY and Feed so you only need to enter the scale once if they are all the same
    - Only output feed rate and axis positions when they change. (Reduces the output file size)

    Scorch
    Thanks Scortch .. posting here as requested. As it turns out, scaling would not be required, but for the fact that this New machine, with an advertised Y axis of 400mm (15.748"), is actually only 379.8mm (14.953"). A quarter inch end mill would have no problem cutting a 15" circle with +/- 7.625 on the Y axis if this machine was built as advertised. I appreciate your efforts .. I was about to just tweak the steps per inch down from it's normal 10,160 on the X and Y steppers, but meanwhile this most serious deficit had come to light. So buyer beware .. it's over 20mm short on the Y axis from that which is advertised. Cheers!

    CNC X6-1500GT ROUTER ENGRAVER DRILLING AND MILLING MACHINE - carving-cnc.com

  9. #9
    Join Date
    Dec 2010
    Posts
    226

    G-Code Wrapping now available in G-Code Ripper

    G-Code Ripper version 0.03 has been posted to the G-Code Ripper Homepage. The new version has more plotting options including more isometric view angles. The big addition in this version is the ability to map g-code from the X or Y axis to a rotary axis A or B. This functionality is very similar to CNCWrapper.

    G-Code Ripper: G-Code Wrapping Features
    -Graphical preview of the resulting g-code.
    -Automatically maps g-code arcs to linear movements prior to conversion to rotary moves.
    -Options for scaling feed rates to make them compatible with the rotary movements.
    -Interpret g-code variables and equations.
    -G-code Rippers basic features can also be used to scale and rotate the g-code before wrapping the code for the rotary axis.
    Scorch
    www.scorchworks.com

  10. #10
    Join Date
    Jun 2012
    Posts
    817
    Hey Scorch, I needed a very simple file wrapped, just a tube with three slots cut into it. I found out that the other popular program is $25, but I stumbled across yours for free. It worked beautifully. Kudos my friend, and thank you.

  11. #11
    Join Date
    Dec 2010
    Posts
    226

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    I just released a new version of G-Code Ripper (V0.6). I added another option to add probing to the G-Code file. Using the "Auto Probe" function you can load a g-code file then G-Code Ripper will define a grid of probe points. Then G-Code Ripper will write a new g-code file with added code for performing probe operation on the stock material and then adjust the tool paths to follow the stock material surface profile. This is great for adding designs to curved surfaces.

    Get the new version here G-Code Ripper

    If you think you need an expensive or complex probe for this to work, think again. I put some links and a video in a BLOG post to help explain the minimum requirements and concept.
    Scorch
    www.scorchworks.com

  12. #12
    Join Date
    Apr 2004
    Posts
    733

    G-Code Ripper - Scale, Rotate and Split G-code

    Software works great!!

    Instead of building a touch probe, I bought a Mitutoyo Touch Signal Inspection Probe model 192-001 on eBay for $7. I cut off the original wire harness and soldered a wire to the circuit board that connects to the internal touch probe switch. The wire then connects to the mach3 probe input pin.

    Here is the setup I used to test cut a circle on a slanted piece of wood.

    Attachment 245656
    Attachment 245658
    Click image for larger version. 

Name:	ImageUploadedByTapatalk1408126788.688601.jpg 
Views:	5 
Size:	215.2 KB 
ID:	245660

    Thanks Scorchworks!!

  13. #13
    Join Date
    Sep 2005
    Posts
    371

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    I'm confused on how you used the probe to cut the circle on the slanted wood. Did you touch off somehow with the probe to determine the angle and somehow modify the existing code for the circle?

  14. #14
    Join Date
    Dec 2010
    Posts
    226

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    Vogavt, G-Code Ripper generates the the g-code for probing to the stock material and writes a new g-code file that probes the stock material and cuts the pattern (A circle in his case). The probe data is temporarily stored in g-code variables until the g-code program ends. There is a video of my machine doing a similar operation embedded in the blog post I linked above.
    Scorch
    www.scorchworks.com

  15. #15
    Join Date
    Sep 2005
    Posts
    371

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    Gotcha! I inadvertently scrolled passed your post on my "Smartphone". I see it now.

  16. #16
    Join Date
    Feb 2009
    Posts
    95

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    Great effort and a lot of coding has gone into this program.
    In my practice a different case has arisen. I am trying to engrave a logo on a plate which is roughly a sphere cut out. Probing went fine and code worked as expected. But it seems the DIY touch probe is not accurate enough.
    The depth is set to 0.1 mm so just 0.05 mm error in Z height is enough to just scratch the surface. Or maybe the holding jig gave in a bit. Anyway, at one end the symbols did not engrave well, too shallow.
    I can try to save the work by setting a slightly corrected tool height in Mach3 but I can't repeat the process because new probing will give inaccurate readings due to the already engraved surface.
    But if there is an option to just do the probing and save the points cloud to file and then read probing data from it and directly assign corrected values into the G-code, then the machining process could be repeated as many times as needed.
    I've downloaded the source but am quite rusty from programming POV and it will take a lot of time to comprehend the code, refresh my memory and eventually write a modified program.
    I was thinking if scorch finds the idea of repeatable corrected machine code useful he could implement it faster and with greater efficiency.

  17. #17
    Join Date
    Sep 2005
    Posts
    371

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    One option would be for the incorporation of a double probing routine at each location. Another for perfect spheres is a program called "ballengrave.exe". It takes your code and wraps it based in the diameter of the sphere. Not a my PC but I can get a link later.

  18. #18
    Join Date
    Dec 2010
    Posts
    226

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    @Dragonfly, I have run into the same problem. I do plan on adding the ability to read probe data from a file. I have not gotten around to writing the code yet. I am not sure how I am going to implement it.
    Scorch
    www.scorchworks.com

  19. #19
    Join Date
    Feb 2009
    Posts
    95

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    I've done some thinking over the strategy. As I see it:
    1. G-code Ripper (GCR) reads a G-code file the usual way as it is now. The user sets the probing grid like now. Then there is a new button (menu option) to save a probing code only. For Mach3 'M40' is inserted on the first line which causes Mach3 to open file save dialog and ask for a folder and file name to save the probed data. After that it performs the probing (and optionally returns to the starting position). The probing data is stored as a text file with three comma separated numbers on a line - X,Y,Z values. Each line is the next probing point on the grid. Here it is important to apply an uniform same probing order as it is important for the next step.
    2. Having done the probing we return to GCR which has a command for reading probed data. Z values and X/Y coordinates a read into an array. Code modification is done but instead of inserting calculation lines using #100-#102 variables real Z corrections are calculated and written to the output file. This G-code file can be restarted time and again and it will always execute with the hard coded tool height correction values. Such feature would be very useful if there are a number of identical objects for engraving, provided that there is a jig to fix them at constant position. All can be done with one probing cycle.


    @Vogavt - I said sphere but it is actually a thin aluminum circle punched to convex shape and better be regarded as an irregular curved surface.

  20. #20
    Join Date
    Sep 2005
    Posts
    371

    Re: G-Code Ripper - Scale, Rotate and Split G-code

    Quote Originally Posted by Dragonfly View Post
    ... But it seems the DIY touch probe is not accurate enough.
    Seems you still must resolve this issue no matter how many times you probe.

    GIGO - Remember that acronym from days gone by?

    That's why I thought about incorporating a double touch-off probing sequence like others have coded for Mach3. Just a thought although I have only played with it and have yet to actually cut any material following the current routine.

    -
    -
    -

    Not overshadowing G-Ripper, only sharing information for other tools for our repertoire.

    Neither of these use probing routines but for future reference
    - Ball Engrave
    - WarpDriver

Page 1 of 6 123

Similar Threads

  1. Coordinates change and scale when G-code is loaded
    By frare bear in forum DIY CNC Router Table Machines
    Replies: 11
    Last Post: 08-27-2021, 03:23 AM
  2. Replies: 51
    Last Post: 09-16-2020, 01:28 AM
  3. corel.hpgl > sheetcam.tap > pronterface.g-code > slic3r.g.code> ramps 1.4 > H-BOT
    By thesignworks in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 05-25-2014, 02:11 PM
  4. Split G-Code
    By DavidJHolmes in forum Uncategorised CAM Discussion
    Replies: 5
    Last Post: 04-07-2014, 02:33 PM
  5. Cut3d g-code changing "scale" in mach3?
    By LaGrasta in forum Vectric
    Replies: 2
    Last Post: 10-08-2012, 01:10 AM

Posting Permissions

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