585,589 active members*
3,353 visitors online*
Register for free
Login
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2014
    Posts
    42

    am I doing this right?

    I've written a short parametric program for doing vise clamps out of bar stock. I'm new to this and am wanting to learn and implement best practices for programming in G-code. Would anyone be willing to comment on what I've done here:
    Code:
    (tableClamps)
    (program cuts in quadrant I)
    
    #<countparts> = 3 ;how many parts to do
    #<spaceparts> = 8 ;distance between repititions of the parts
    #<zstep> = 1 ;distance to feed in z for every pass around
    
    #<positionslot> = 9
    #<heightslot> = 7.5
    #<depthslot> = 5.5
    #<diameterclearance> = 10.5
    #<diametercounterbore> = 16.0
    
    #<widthclamp> = 19
    #<lengthclamp> = [#<positionslot> + #<diameterclearance>/2 + #<diametercounterbore>/2 + #<depthslot>]
    
    G21 G90
    G00 X0 Y0 Z10.0
    G00 X0 Y-8.0
    M03 S1200
    
    o100 repeat [#<countparts>]
      M01
      G00 Z0
      G41.1 D6
      G01 Y0 F300
      o200 while [#<_z> GT [-#<widthclamp> + #<zstep>]]
        G91
        G01 Z-#<zstep>
        G01 Y[#<heightslot> + #<positionslot>]
        G02 X#<positionslot> Y0 I[#<positionslot>/2] J0
        G03 X#<positionslot> Y-#<positionslot> I#<positionslot> J0
        G01 X[#<lengthclamp> - #<positionslot> *2]
        G01 Y-#<heightslot>
        G01 X-[#<lengthclamp>]
      o200 endwhile
      G90 G40
      G00 Y-8.0
      G00 Z1.0
      G00 X[#<_x> + #<lengthclamp> + #<spaceparts>]
    o100 endrepeat
    
    M30
    %

  2. #2
    Join Date
    Feb 2006
    Posts
    1792

    Re: am I doing this right?

    It is not Custom Macro B. Someone who knows about your control may help you.
    But you should come up with specific problems. People may not have patience to read and analyze your whole program.

  3. #3

    Re: am I doing this right?

    Is that program for an Okuma control?

  4. #4
    Join Date
    Aug 2014
    Posts
    42

    Re: am I doing this right?

    It's for LinuxCNC.

    Sent from my E5803 using Tapatalk

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
  •