586,700 active members*
2,580 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2009
    Posts
    19

    gcode problem with drilling operation

    EMC2 does not like the following gcode (3 sequential drilling operations) generated by CamBam:

    ======== begin gcode =========
    ( Begin Drill Operation 1 )
    S0
    G81 X1.0 Y-1.297 R1.0 F4.0
    G80

    ( Begin Drill Operation 2)
    S0
    G81 X0.0 Y1.297 Z-0.26
    G80

    ( Begin Drill MOP 3 )
    S0
    G81 X-6.22 Y0.0 Z-0.26
    G80

    M5
    M30
    ======== end of gcode =======

    Notice that G81 for operation 1 has an R and no Z.
    Operations 2 and 3 both have a Z and no R.

    EMC2 complains unless both R and Z are included in all three lines.

    Is this a problem with CamBam or with EMC2 (or with me)?

    Thanks,
    Paul

  2. #2
    Join Date
    Nov 2007
    Posts
    188
    Try this
    ======== begin gcode =========
    ( Begin Drill Operation 1 )
    S0
    G81 X1.0 Y-1.297Z-0.26 R1.0 F4.0
    X0.0 Y1.297
    X-6.22 Y0.0
    G80
    G28G91Z0
    M5
    M30
    ======== end of gcode =======

  3. #3
    Join Date
    Feb 2009
    Posts
    19
    Quote Originally Posted by chucker View Post
    Try this
    ======== begin gcode =========
    ( Begin Drill Operation 1 )
    ... etc...
    M5
    M30
    ======== end of gcode =======
    Oops! Sorry, I didn't make myself clear. I wasn't looking for replacement code. I have already hand edited the output of CamBam to satisfy EMC2. My question is "Has CamBam produced proper code and EMC2 should not complain or is CamBam producing invalid code?" so that I know where to go to for a fix.

    Does every G81 require all four parameters (X, Y, Z, and R)? The docs I am reading on gcode are not clear on this.

    Thanks,
    Paul

  4. #4
    Join Date
    Jun 2008
    Posts
    1511
    yes that is why it is complaining. With the canned cycle call you have to tell it how deep to drill(Z) and the start point(R).

    Now what Chucker is suggesting is the easiest way to write what you are trying to do. Seens how you are going to the same depth but just changing your X,Y locations you can just put your new X,Y locations after the canned cycle call and it will move to that location and do the same routine as in the G81 line. This is nice for if you have 15 holes at different locations you just put the new X,Y.

    G81 X1.0 Y-1.297Z-0.26 R1.0 F4.0
    X0.0 Y1.297
    X-6.22 Y0.0
    ...
    ...
    ...-----------as many X,Y locations you want
    G80
    G28G91Z0
    M5
    M30

    Stevo

  5. #5
    Join Date
    Feb 2009
    Posts
    19
    Quote Originally Posted by stevo1 View Post
    yes that is why it is complaining. With the canned cycle call you have to tell it how deep to drill(Z) and the start point(R).
    CamBam support replied to me:
    The canned cycles should 'reset' any modal parameters at the start of the block so they are always output in the first command of the block. This will be fixed in the next release.

    There is a work around by altering the EMC post processor file to make R non-modal.
    A description of this method can be found in this thread.

    http://www.cambam.co.uk/forum/index.php?topic=404.0

  6. #6
    Join Date
    Jun 2008
    Posts
    1511
    I don't know much about CAM software but couldn't you just put an R in all the G81 lines?

    I still think that the easiest way if you are drilling many holes that have the sam depth just different locations that you should not have to have the program keep calling the G81 line and canceling the canned cycle for everyhole. Call it one time then just put in new X,Y locations 1 after another.

    What kind of control are you using to run this program? Your R should remain modal until you put a G80. Have you tried removing the G80's at the end of your lines like this. I would think this should take care of your problem.

    ( Begin Drill Operation 1 )
    S0
    G81 X1.0 Y-1.297 R1.0 F4.0

    ( Begin Drill Operation 2)
    S0
    G81 X0.0 Y1.297 Z-0.26

    ( Begin Drill MOP 3 )
    S0
    G81 X-6.22 Y0.0 Z-0.26
    G80
    M5
    M30

    If this works...now to what Chucker and I were saying you can remove your G81 and Z-.26 S0 out of the 2nd and 3rd hole. To have this.

    S0
    G81 X1.0 Y-1.297 R1.0 F4.0(Drill hole 1)
    X0.0 Y1.297(Drill hole 2)
    X-6.22 Y0.0(Drill hole 3)
    G80
    M5
    M30

    Stevo

  7. #7
    Join Date
    Feb 2009
    Posts
    19
    Quote Originally Posted by stevo1 View Post
    I don't know much about CAM software but couldn't you just put an R in all the G81 lines?
    This works
    S0
    G81 X3.0 Y-1.34778 Z-0.26 R1.0
    G81 X2.0 Y1.3477 Z-0.26 R1.0
    G81 X-1.345 Y0.0 Z-0.26 R1.0
    G81 X-4.22 Z-0.26 R1.0
    G80

    Thanks,
    Paul

  8. #8
    Join Date
    Jun 2008
    Posts
    1511
    As it should work...glad you got it.

    If you want as I stated before you can remove your G81,Z-.26, and R1. from your other lines. You can put as many X,Y locations as your heart desires...no need to keep calling the same codes. You can also not input a X or Y if you are using the same position as the position before.

    S0
    G81 X3.0 Y-1.34778 Z-0.26 R1.0
    X2.0 Y1.3477
    X-1.345 Y0.0
    X-4.22
    X,Y
    X,Y
    X,Y
    G80

    Stevo

  9. #9
    Join Date
    Feb 2009
    Posts
    19
    Quote Originally Posted by stevo1 View Post
    If you want as I stated before you can remove your G81,Z-.26, and R1. from your other lines. You can put as many X,Y locations as your heart desires...
    Thanks, Stevo... I understand now.

    Paul

Similar Threads

  1. Problem with pauses in drill operation
    By LuckyStrike in forum SprutCAM
    Replies: 3
    Last Post: 01-15-2009, 08:43 PM
  2. Need gcode or dxf file for drilling UHU PCB
    By visky in forum UHU Servo Controllers
    Replies: 0
    Last Post: 10-07-2008, 08:45 PM
  3. Drill operation problem
    By nomodoh in forum CamBam
    Replies: 1
    Last Post: 07-27-2007, 03:56 PM
  4. Drilling operation - 1st hole always skipped?
    By JMFabrications in forum Mastercam
    Replies: 6
    Last Post: 07-16-2007, 12:02 AM
  5. Replies: 0
    Last Post: 03-10-2005, 07:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •