586,061 active members*
4,619 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > please help with G132
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2015
    Posts
    4154

    please help with G132

    hello this code cuts 2 cw arches among the surface of a cilinder : 360-270* & 270-180*

    problem is that only 1st G132 works, while 2nd shows attached funky error

    however, if i put 1st G132 into brakets, than there is no error

    please help ! kindly

    Code:
     
        G50 S1900
    
        LRAD = 10
        LDIA = 100
        V1   = LRAD / [ VPAI * LDIA ] * 360
    
      ( * )
    
        G00 X500 Z250
        T0808
        M110
        SB = 1000 M13
    
        G119
     
        G00  X + LDIA
        G00  Z + LRAD C-V1
        G132 Z      0 C  0 L + LRAD F0.12 G95
        G132 Z - LRAD C-V1 L + LRAD F0.12 G95
    
        M02
     
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  2. #2
    Join Date
    Jun 2015
    Posts
    4154

    Re: please help with G132

    hello, i simplified the code even more + attached image

    i also sent it to my okuma rep / kindly

    Code:
        G50 S1900
    
        G00 X500 Z250
        M110 T0808
        SB = 1000 M13 G119 F0.12 G95
    
        V1 = 10 / [ VPAI * VSIOX ] * 360
    
        G00  Z+10 C-V1 X50
        G132 Z  0 C  0 L10   ( it works only if i cancel this line )
        G132 Z-10 C-V1 L10 
    
        M02
     
    Attached Thumbnails Attached Thumbnails untitled.PNG  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Aug 2011
    Posts
    419

    Re: please help with G132

    I think V1 calculation is wrong.
    Need material cylinder diameter

    THIS CODE WORKS
    Code:
    G50 S1900
    VTLIN[8]=35
    VTLFN[8]=1
    VTLL[8]=50
    VTLD[8]=4
    
    DEF WORK
     PS LC,[-50,0],[100,160]
     PS LC,[-50,0],[100,156],0
    END
    CLEAR
    DRAW
    
        G00 X500 Z250
        M110 T080808
        SB = 1000 M13 G119 G95
    
        G00   X170 Z0 C90
        G01   X152 F[SB*0.2]
        G01   Z0    C80 M16 G41
        G01   Z10
    
        G132  Z20   C90   L10 M15
        G132  Z10   C100  L10 
    
        G01   Z0
        G00   C90  M16 G40
        G00   X170 G40
        G00   X500 Z250 M12
        M02
    "Imagination is more important than knowledge."

  4. #4
    Join Date
    Aug 2011
    Posts
    419

    Re: please help with G132

    Compensation codes are not used.
    Calculating

    Code:
    G50 S1900
    VTLIN[8]=35
    VTLFN[8]=1
    VTLL[8]=50
    VTLD[8]=10
    
    DEF WORK
     PS LC,[-50,0],[100,160]
     PS LC,[-50,0],[100,156],0
    END
    CLEAR
    DRAW
    
    V1=76 (RADIUS OF CYLINDER TOOL PATH)
    V2=5 (CUTTER RADIUS)
    V3=0 (CENTER C VALUE)
    
        G00 X500 Z250
        M110 T080808
        SB = 100 M13 G119 G95
    
        G00   X170 Z0 C[V3]
        G01   X[2*V1] F[SB*0.2] M16
        V4=[V2/V1] V4=ATAN[V4/SQRT[1-V4*V4]]
        G01   C[V3-V4]
        G01   Z10
    
        G132  Z[20-V2]   C[V3]   L[10-V2] M15
        G132  Z10   C[V3+V4]  L[10-V2] 
    
        G01   Z0
        G01   C[V3]  M16
        G00   X170
        G00   X500 Z250 M12
        M02
    Click image for larger version. 

Name:	screenshot.jpg 
Views:	3 
Size:	54.9 KB 
ID:	403482
    "Imagination is more important than knowledge."

  5. #5
    Join Date
    Aug 2011
    Posts
    419

    Re: please help with G132

    More complex macro for radial and axial variable sized slot machining on lathe with Caxis

    Code:
    G50 S1900
    VTLIN[8]=35
    VTLFN[8]=1
    VTLL[8]=50
    
    DEF WORK
     PS LC,[-50,0],[100,160]
     PS LC,[-50,0],[100,156],0
    END
    CLEAR
    DRAW
    (*** INPUT VALUES ***)
    V1=76 (RADIUS OF CYLINDER TOOL PATH)
    V2=10 (CUTTER RADIUS)
    V3=0 (CENTER C VALUE 1)
    V4=0 (CENTER Z VALUE 1)
    V5=22 (SLOT WIDTH)
    V6=55 (SLOT LENGTH)
    (*** CALCULATED VALUES ***)
    VTLD[8]=2*V2
    V7=V5/2
    V10=V7-V2 V10=V10/V1 V10=ATAN[V10/SQRT[1-V10*V10]]
    (*** AXIAL SLOT CODE ***)
        G00 X500 Z250
        M110 T080808
        SB = 100 M13 G119 G95
        G00   X200 Z=V4 C=V3
        G01   X[2*V1] F[SB*0.2]
        G01   C=V3-[V10] M16
        G01   Z=V4+[[V6-V5]/2]
        G132  Z=V4+[[V6/2]-V2]  C=V3   L[V7-V2] M15
        G132  Z=V4+[[V6-V5]/2]  C=V3+[V10]  L[V7-V2] M15
        G01   Z=V4-[[V6-V5]/2]
        G132  Z=V4-[[V6/2]-V2]  C[V3]   L[V7-V2] M16
        G132  Z=V4-[[V6-V5]/2]  C[V3-V10]  L[V7-V2] M16
        G01   Z=V4
        G01   C=V3 M15
        G00   X200
    
    (*** INPUT VALUES ***)
    V1=76 (RADIUS OF CYLINDER TOOL PATH)
    V2=5  (CUTTER RADIUS)
    V3=45 (CENTER C VALUE 2)
    V4=0  (CENTER Z VALUE 1)
    V5=22 (SLOT WIDTH)
    V6=55 (SLOT LENGTH)
    (*** CALCULATED VALUES ***)
    V7=V5/2
    V20=[V6-V5]/2 V20=V20/V1 V20=ATAN[V20/SQRT[1-V20*V20]]
    V21=[V6/2]-V2 V21=V21/V1 V21=ATAN[V21/SQRT[1-V21*V21]]
    (*** RADIAL SLOT CODE ***)
        G00  Z=V4 C=V3
        G00  X200
        G01  X[2*V1] F[SB*0.2]
        G01  Z=V4+[[V5/2]-V2]
        G01  C=V3+[V20] M15
        G132 Z=V4 C=V3+[V21] L[V7-V2] M15
        G132 Z=V4-[[V5/2]-V2] C=V3+[V20] L[V7-V2] M16
        G01  C=V3-[V20]
        G132 Z=V4 C=V3-[V21] L[V7-V2]
        G132 Z=V4+[[V5/2]-V2] C=V3-[V20] L[V7-V2] M15
        G01  C=V3 M15
        G01  Z=V4
        G00  X200
        G00  X500 Z250 M12
        M02
    Attachment 403486
    "Imagination is more important than knowledge."

  6. #6
    Join Date
    Jun 2015
    Posts
    4154

    Re: please help with G132

    I think V1 calculation is wrong
    hy kurmay, you are right : there was a mistake ... i tried to simplify the code that i shared, but i did no test it duuuh

    i looked over your code from #3, and i noticed that you used M15, so i added it to my code, and voila, it works

    thanks a lot man, you hit it

    F[SB*0.2]
    i guess you should execute it in G94



    i looked also over the codes that you shared at #4 & #5; i did not tried to understand them, but thanks for your time to create those

    now i will go to run some trials and create the comp codes / thx
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #7
    Join Date
    Jun 2015
    Posts
    4154

    Re: please help with G132

    hello kurmay, after using G132, program duration reduced with cca 2seconds, and that is cool thanks again !


    i also hit a case : for example the arch is among a cilinder o27.74, but tool is cutting at X7.5 ( attached image )

    even if i wish the arch to be cut at o27.74, this won't happen, because tool position is 7.5, and 7.5<>27.74

    to get it right, i needed to put also the tool at X27.74, and this would mean cutting with a lot of overhang

    so i did a trick :

    Code:
        NOEX VZSHX = - [ 27.74 - 7.5 ]
        G00 X27.74
        G132 etc
        NOEX VZSHX = 0
    like this, the tool was positioned at X7.5, but the controller did the math like how it was at X27.74

    there are also other methods to deliver this "trick"

    if tool_X <> cilinder_diameter, then G132 won't perform as it should; like how G132 will deliver as expected only for engraving operations ( when tool cutting edge is positioned right on the cilinder )




    there is a thing with your code; pls check this section from #3:

    Code:
        G00   X170 Z0 C90
        G01   X152 F[SB*0.2]
        G01   Z0    C80 M16 G41
    last line comands only the C axis ( from 90* to 80*; even if the program line does not modify the position of Z axis, Z will move because of the G41 ), and this requires a different feed; that movement, even if it is in feed, is not cutting, but is a simple positioning so to begin the compensation; but you may loose time because feed value is not correct

    in other words, the cnc will generate the toolpath, but it won't travel among it at desired feed

    to fix it, use this formula : feed_for_CZ_G94 = sqrt ( ( a ^ 2 + b ^ 2 ) / ( a ^ 2 + c ^ 2 ) ) * F, where :
    ... a = 360 * dz
    ... b = 500 * dc
    ... c = X * dc * pi
    ... F = desired feed in G94

    dz&dc represents how much Z&C axis changes; they are always positive; if Z goes from 0 to -30, or to +30, in both cases, dz will be 30; same for dc

    example 1 )
    G00 Z0 C0 X100
    G01 Z-10 F100 G94
    in this case dz=10, dc=0 and X=100; do the math, calculate a b c; b & c will be 0, and the final result will be 1*F; so the correct feed will be F100, thus the code is correct

    example 2 )
    G00 Z0 C0 X33
    G01 C-10 F100 G94
    in this case dz=0, dc=10 and X=33; a will be 0; do the math, and the result will be ( 500 * 10 ) / ( 33 * 10 * 3.14 ) * 100 = 500*100/(33*3.14)=482; you need to rewrite the 2nd line like this G01 C-10 F482 G94

    example 3 )
    G00 Z0 C0 X50
    G01 Z11 C45 F100 G94
    in this case dz=11, dc=45 and X=50; write your 2nd line like this :
    G01 Z11 C45 G94 F = sqrt ( ( (360 * dz) ^ 2 + (500 * dc) ^ 2 ) / ( (360 * dz) ^ 2 + (X * dc * pi) ^ 2 ) ) * 100
    G01 Z11 C45 G94 F = sqrt ( ( (360 * 11) ^ 2 + (500 * 45) ^ 2 ) / ( (360 * 11) ^ 2 + (50 * 45 * 3.14) ^ 2 ) ) * 100

    kindly sorry for the long reply, i tried to write it as short as possible ?!
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  8. #8
    Join Date
    Jun 2015
    Posts
    4154

    Re: please help with G132

    hy kurmay, if you shared those parametric examples at posts 4 & 5, then this is how i would code such pockets : toolpath inside a dwg ( attached image ), that i convert to G-code, and that code is inserted inside a general structure

    to make it parametric like yours, then i would edit this code

    comments are there to help locating each segment of the toolpath

    i shared it to show that i use a soubroutine for shortest_path, and another to compute CZ feed; like this, i can edit it futher more, without worries about the need to change feed or to add M15,M16

    code is pretty versatile: to put the pocket to another diameter, is enough to change LDIA value; it's fast, at least faster than recreating it inside a CAM / kindly

    Code:
     
    
        NOEX V1 = 4000      ( n )
        NOEX V2 = 4*0.036   ( f )
    
      ( * )
    
        G50 S1900
        M867
    
        G00 X500 Z250
        M110 T+7*10101
    
        NOEX LDIA     = + 50                          ( cilinder dia 50    )
        NOEX VZSHX    = - [ LDIA - 40 ]               ( tool cuting at X40 )
    
        CALL OSUB
    
        NOEX VZSHX    =     0
        G00 X500 Z250 M12 M63
    
        M02
    
    OSUB
    
        NOEX V3 = - 360 / VPAI / LDIA                 (*1)
    
        CALL OCAXS LV01 =                  -V3*[6]    (*2)
    
        SB=V1 M13 M08 G00 X+LDIA Z-42.286 C-V3*[6] M63 G95 G119
    
        G132  M15   Z = -44.286    C = -V3*[8]    F = V2   L2 ( arch intro )
        CALL OFCZT LZ = -60       LC = -V3*[8]   LF = V2      ( left       )
        G132  M16   Z = -62        C = -V3*[6]    F = V2   L2 ( corner 1   )
        CALL OFCZT LZ = -60       LC = +V3*[6]   LF = V2      ( up         )
        G132  M16   Z = -60        C = +V3*[8]    F = V2   L2 ( corner 2   )
        CALL OFCZT LZ = -15       LC = +V3*[8]   LF = V2      ( right      )
        G132  M15   Z = -13        C = +V3*[6]    F = V2   L2 ( corner 3   )
        CALL OFCZT LZ = -13       LC = -V3*[6]   LF = V2      ( down       )
        G132  M15   Z = -15        C = -V3*[8]    F = V2   L2 ( corner 4   )
        CALL OFCZT LZ = -46.286   LC = -V3*[8]   LF = V2      ( left       )
        G132  M16   Z = -48.286    C = -V3*[6]    F = V2   L2 ( arch exit  )
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    (*1) ( transformation factor, that allows converting a distance among cilinder perimeter into spindle phase )
    (*2) ( soubroutine that helps indexing C axis among the shortest path )
     
    Attached Thumbnails Attached Thumbnails 01.png  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. Replies: 51
    Last Post: 09-16-2020, 01:28 AM
  2. Program to Convert Mill g code To Laser g code - CMTL
    By doanwannapickle in forum Visual Mill
    Replies: 0
    Last Post: 02-20-2017, 06:08 PM
  3. mach3 crashing with run of code/drilling holes through table with other code
    By normalform in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 07-28-2014, 03:38 AM
  4. 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
  5. Replies: 8
    Last Post: 12-15-2010, 09:32 PM

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
  •