Need Help! Sorting code in spreadsheet


Results 1 to 9 of 9

Thread: Sorting code in spreadsheet

  1. #1
    Member
    Join Date
    Dec 2007
    Location
    USA
    Posts
    123
    Downloads
    0
    Uploads
    0

    Default Sorting code in spreadsheet

    I want to be able to use a spreadsheet to make some changes in the g code my cam program is outputting. I am fairly handy with a spreadsheet, so I would like to use one to do the programming, unless someone knows of something better.

    I have included some images of what I want to do, to make it easier to understand.

    Step one - g code
    Step two - insert spaces in code
    Step three - import into spreadsheet
    I know how to do these three steps, so that I end up with what is shown in the images.

    Step four - I want to sort the data in step three into the appropriate columns, as shown.

    Step five - I want to fill in the blank fields with the value of the field above it.

    I want to use the math formula capabilities of a spreadsheet to average the value of certain Z values to smooth out the Z portion of the tool path. The cam software is giving me a lot of up and down values, along a steep sidewall, that are effecting the quality of my cut for a mold I am making. If I average those z values, I will end up with a smooth transition, as the tool moves along the sidewall.

    Similar Threads:
    Attached Thumbnails Attached Thumbnails Sorting code in spreadsheet-step-one-g-code-jpg   Sorting code in spreadsheet-step-two-insert-spacing-jpg   Sorting code in spreadsheet-step-three-import-spreadsheet-jpg   Sorting code in spreadsheet-step-four-sort-columns-jpg  

    Sorting code in spreadsheet-step-five-fill-empty-cells-jpg  


  2. #2
    Member
    Join Date
    Dec 2007
    Location
    USA
    Posts
    123
    Downloads
    0
    Uploads
    0

    Default

    I solved my problem using a different post code, one that gives me all the X,Y,Z values in every line, even when they don't change. I averaged the Z values, over about 30 lines and it completely solved the problem. Now my code does a nice helix spiral into the cavity, and is always trending up or down, and not sawtoothing up and down.

    I am using a post written for a "Holz her Conquest 510". I have to hand code the header, ending, and rapid moves, but that is a piece of cake, compared to the alternative. I also found quite a few posts that write all the axis in mm such as the Proma, and Model Master 3 axis. Until I found the Holz post, I was considering using one of them, and writing the conversion formula in the spread sheet.

    Depending on the type of contour I am trying to shape, this is a great fix. In this case the spiral tool path allows very gradual transitions in Z, so the averaging works well. If I were doing a raster path, I could still use it, but would need to average over a much smaller sampling of lines to avoid being way off on abrupt Z changes.



  3. #3
    Registered
    Join Date
    Apr 2010
    Location
    UK
    Posts
    294
    Downloads
    0
    Uploads
    0

    Default

    I can think of two ways to do this. For me, I'd write some VB code to interrogate avery line and shift spacing to suit. But for a non-VB user you could proceed as follows:


    Create a new column on the left, becomes a new column A.
    Put 1,2,3,... in sequence down your new column.
    Sort your whole sheet by column C (the new C, it was B before you added the extra column).
    Now all the "X" entries that need shifting to the right are grouped together, so you can shift them in one go. There may be some "Y" entries to be shifted further over.
    Choose another column to sort by, and shift to the right as required.
    Keep sorting and shifting.
    When you're done sorting and shifting, sort again, by column A. This will restore you sheet back into its original sequence.
    then delete column A.



  4. #4
    Member
    Join Date
    Dec 2007
    Location
    USA
    Posts
    123
    Downloads
    0
    Uploads
    0

    Default

    Thanks UUU,

    The solution was obvious, just not immediately obvious to me. Simply use a different post out of the CAM software. As I mentioned before, I found a post that will give me all of the axis values, even if they don't change from the previous line. I now can put that code into the spread sheet, and manipulate the values, without needing to sort the columns. I have to hand code the header, ending, and rapid moves, but that is easy.

    Last edited by twoartistic; 12-05-2010 at 12:36 PM. Reason: me no spell real good ;-)


  5. #5
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default

    What CAM software are you using?

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


  6. #6
    Member
    Join Date
    Dec 2007
    Location
    USA
    Posts
    123
    Downloads
    0
    Uploads
    0

    Default

    Art Cam

    I have seen this before, where the tool path wants to stair step down an incline. The fix is to increase the tolerance settings, to allow longer line segments, and to use a radiused tool. If you use an end mill, and tight tolerance, the software will stair step an incline every time. In this case, I am making a precision part, and need the tight tolerance. Normally I work in wood, and I don't care about precision better than 0.01", you get that much variation in swelling if you breath on wood, so no big deal. In this case, I am making a mold out of Delrin plastic, and I am going to mold some silicone parts. I have never tried this before, so I may abandon the whole idea, and start from scratch.

    I think the stair stepping must have something to do with the fact that the software is creating the toolpath from a greyscale image, and is contouring over individual pixels. Since I rarely need to be anywhere close to precision greater than the greyscale image, I doubt I will ever need to mess with this again.



  7. #7
    Gold Member BobWarfield's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    2502
    Downloads
    0
    Uploads
    0

    Default

    Hey, twoartistic, this concept of being able to get all the coordinates on every move sounds useful. Probably also useful to be able to take that back out again. I'm going to put that on my G-Wizard G-Code Editor wish list. It's in Beta test at the moment, so still adding lots of functionality to it for the next few months at least.

    I do g-code transformations in Excel myself sometimes.

    Cheers,

    BW

    Try G-Wizard Machinist's Calculator for free:
    http://www.cnccookbook.com/CCGWizard.html


  8. #8
    Member
    Join Date
    Dec 2007
    Location
    USA
    Posts
    123
    Downloads
    0
    Uploads
    0

    Default Happy to report the project turned out perfect

    My inquiry of how to sort g-code in a spreadsheet did not get a response that would work better than the solution I found. Duh... how come the obvious answers elude me sometimes.

    One aspect of this project that came out better than expected, is what I did with the data after loading it in the spreadsheet. I was able to use a simple averaging formula to get the Z column of code to trend, rather than have all of the ups and downs of the original code.

    I also used to the spreadsheet to create overlapping passes, and a better ramping algorithm for my needs on this project.

    I would like to have a g-code editor that made looking at, and tweaking the code easier than loading into a spreadsheet, but once in, a spreadsheet lets you do a lot of things very quickly.

    Thank you for what ever grey matter you may have put to this question, I appreciate the knowledge shared on this forum.



  9. #9
    Member wjbzone's Avatar
    Join Date
    Apr 2003
    Location
    United States
    Posts
    416
    Downloads
    0
    Uploads
    0

    Default Re: Sorting code in spreadsheet

    Sorry to reply so late on an old thread. I thought this post might be helpful...
    http://www.cnczone.com/forums/g-code...code-file.html



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Sorting code in spreadsheet

Sorting code in spreadsheet