585,759 active members*
3,985 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2013
    Posts
    2

    G-code array/transform without CAM

    Hello,

    I run a CNC mill. I would like to be able to post an nc file that could cut the same part multiple times and for different size blanks, without having to recam a file for each blank of material. We end up with a lot of scrap material that can still be used, but they are all different sizes. Ideally, the operator would start the file and be asked the "x" and "y" sizes of the blank, then the file would cut the appropriate amount of parts to fit the blank size. My idea is to cam the single part, then paste that code into this other file with all the variables and "IF {?!?!} THEN M81L32" statements to be able to achieve this. This seems faster to me than an operator having to stop and start his file (that he did not create and is only slightly familiar with) or using fixture offset or moving the blank or having to cam a different file for each blank. I do realize this might be a little ... over the top, especially since I could just change the transform numbers in MasterCAM and repost pretty quickly. Advice, comments, concerns, my rambling make sense?

    I have a file set up that is close, but it keeps adding the transform distance again to itself hence doubling the necessary distance each column or row cut. Getting tired of "X axis out of bounds",

    I'm using lots of variables for counting parts in the x and y direction and G92 X0 Y 48 to keep resetting my part location. My machine does not understand G92.1

    It just seems like there should be an easier way than 50 some lines of code for this, but I've only been doing this 3 years and still see that I could learn loads more.

    Thank you,
    Geremy

  2. #2

    Re: G-code array/transform without CAM

    Hello @Physcie. Did you find any solution to your problem? I'm in a similar situation

  3. #3
    Join Date
    Jul 2013
    Posts
    2
    Quote Originally Posted by ernestop View Post
    Hello @Physcie. Did you find any solution to your problem? I'm in a similar situation
    I have not yet. My best solution is arraying in the X direction and programming the original file wider than 1 part. I also haven't worked on it that hard for a while. Might be time to bring it back to the forefront.

  4. #4

    Re: G-code array/transform without CAM

    I can try classic Fanuc commands to place a CAM output file in your stock material using translations, rotations and scaling:

    - G65 P<file name> = load an exernal file in CNC
    - G52 X Y Z = active a local offset to move the single job
    - G51 I J = operate a scaling of job
    - G68 R = operate a rotation of job

    I use often this G codes to replicate the CAM output file in a pattern:

    Code:
    G17 G21 G40 G49 G80 G90 G91.1
    
    
    G54
    
    
    ; place  piece 1
    G52 X-500 Y-200 Z-100
    G0 X0 Y0 Z0
    G65 P"Disco Freno.ngc"
    
    
    ; place piece 2
    G52 X-500 Y-300 Z-100
    G0 X0 Y0 Z0
    G65 P"Disco Freno.ngc"
    
    
    ; place piece 3
    G52 X-500 Y-400 Z-100
    G0 X0 Y0 Z0
    G65 P"Disco Freno.ngc"
    
    
    ; place piece 3 ZOOM X2
    G52 X-700 Y-400 Z-100
    G0 X0 Y0 Z0
    G51 I2 J2
    G0 X0 Y0 Z0
    G65 P"Disco Freno.ngc"
    
    
    ; place piece 4 Zoom x1.5 rotate 45
    G52 X-600 Y-600 Z-100
    G0 X0 Y0 Z0
    G51 I1.5 J1.5
    G68 R45
    
    
    G0 X0 Y0 Z0
    G65 P"Disco Freno.ngc"
    
    
    m2

  5. #5
    Join Date
    Jun 2015
    Posts
    4154

    Re: G-code array/transform without CAM

    hy, if possible, generate the coordinates of the minimal bounding rectangle, like 150*100

    ... get blank dimensions
    ... if blank_width<150 or blank_height<100 then halt
    ... repetitions among x := floor [ blank_width / 150 ]
    ... repetitions among y := floor [ blank_height / 100 ]
    ... generate a nc file that shifts the origins, and loads the main program after each shift
    ... load that file & execute

    if the nc can't generate a file, then store the origins inside global variables; for example, initialize 100 variables with -1 ( considering that each potential origin is > 0, so to avoid conflicts ), then start loading data into them :
    ... v1, v2 := x1, y1
    ... v3, v4 := x2, y2
    etc

    from 1 to 50, if v [ i ] + v [ i + 1 ] <> -2 then shift origin & run program, else halt / kindly

    ps : if possible ($$$), build a soubroutine to search the blank on the table
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. More transform help
    By orion_134 in forum Mastercam
    Replies: 3
    Last Post: 01-20-2014, 01:02 PM
  2. Transform in NX6
    By mongo46538 in forum UG NX
    Replies: 12
    Last Post: 12-16-2009, 04:27 PM
  3. Pin array
    By sp1nm0nkey in forum Mastercam
    Replies: 1
    Last Post: 07-05-2009, 03:27 AM
  4. G-Code editor with array copy possibility
    By thorswill in forum G-Code Programing
    Replies: 10
    Last Post: 10-23-2008, 04:44 PM
  5. Array with v20
    By DEW in forum BobCad-Cam
    Replies: 1
    Last Post: 11-21-2007, 12:50 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
  •