G-code array/transform without CAM


Results 1 to 5 of 5

Thread: G-code array/transform without CAM

  1. #1
    Member
    Join Date
    Jul 2013
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default 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

    Similar Threads:


  2. #2
    Member
    Join Date
    Jul 2013
    Location
    Ecuador
    Posts
    6
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Jul 2013
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    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
    Member
    Join Date
    Jul 2017
    Location
    Italy
    Posts
    63
    Downloads
    0
    Uploads
    0

    Default 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


    Attached Thumbnails Attached Thumbnails G-code array/transform without CAM-001-png   G-code array/transform without CAM-002-jpg  


  5. #5
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    2844
    Downloads
    0
    Uploads
    0

    Default 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

    Last edited by deadlykitten; 11-13-2019 at 05:31 PM.
    ... chip happens


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

G-code array/transform without CAM

G-code array/transform without CAM

G-code array/transform without CAM