585,996 active members*
4,222 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Oct 2007
    Posts
    31

    4th axis code?

    Hello everyone, we have an HRT 210 4th axis we rarely use. I need to plug this in and use it to repeat a simple milling pattern on a 10" diameter part every 15 degrees or so. My plan was to simply generate code for the milling pass then insert a command into the code to rotate the 4th axis 15 degrees, then repeat the milling procedure and so on. My problem is that I don't know what code to insert in to allow the 4th axis to turn. Thanks for any help you may provide!

  2. #2
    Join Date
    Oct 2005
    Posts
    11
    Just put in G0 A15. to move it 15 degrees. You could make a subprogram to have it repeat enough times to machine all around the part.

  3. #3
    Join Date
    Oct 2005
    Posts
    11
    You could do this...

    After the tool change put this.

    M97 P100 L24 (Call the sub 24 times)

    (put all of your retracting moves here... coolant off or whatever)

    M30

    N100
    G91 A15.
    G90
    (your main program)
    M99

  4. #4
    Join Date
    Nov 2006
    Posts
    490
    You can use "A" codes inside a drill cycle. You also have the option of using G90/G91 for the angles too. Like this...
    G81 X0 Y0 A0 (also need R,F,Z of course)
    A15.
    A30.
    A45.
    A60.
    ...

    or use incremental...
    G91 A15
    A15
    A15
    A15
    ...

    You might be able to use an L number to signify number of repeats, I can't remember if that works.

  5. #5
    Join Date
    Oct 2007
    Posts
    31
    Cooool! Thanks so much...I THINK I can take it from here. Looks good so far. Thanks guys!

  6. #6
    Join Date
    Oct 2007
    Posts
    31
    Hi again everyone, after refining the program, I end up with the need to rotate every 60 degrees instead of 15. I there a possibility that one of you (possibly Stickerman)can show me where to insert the data you've provided me? For example, I feel that I should insert:
    "M97 P100 L6"
    "M30"
    "N100"
    "G91 A15"
    "G90" and finally,
    "M99"........but I'm not 100 percent on exactly WHERE they should all fall in the mix. Thanks so much AGAIN for any help you guys may provide. Below is the current program I'm running now that is producing perfect parts....

    %
    O1234(slit,cbore,drill,tap6-1-2010)
    N1G0G40G80G91G28Z0
    T1M6(0.25,user_adjust_02500-00000)
    G90G00G115X0.119Y-0.127S5200M3
    G43Z2.0H1
    Z1.0M8
    Z.1
    Z0.1
    G85Z-0.25R0.1F8.32
    G80
    Z1.0
    Y-0.521
    Z0.1
    G85Z-0.25R0.1F8.32
    G80
    Z1.0
    G0Z2.0M9
    G91G28Z0
    M1
    N2G0G40G80
    T2M6(0.0781,center_2)
    G90G00G115X0.119Y-0.127S5200M3
    G43Z2.0H2
    Z1.M8
    Z-0.15
    G81Z-0.373R-0.15F10.14
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G81Z-0.373R-0.15F10.14
    G80
    Z1.0
    G0Z2.0M9
    G91G28Z0
    M1
    N3G0G40G80
    T3M6(0.136,TD_01360_29:J)
    G90G00G115X0.119Y-0.127S5200M3
    G43Z2.0H3
    Z1.M8
    Z-0.15
    G83Z-0.4959Q0.205R-0.15F10.61
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G83Z-0.4959Q0.205R-0.15F10.61
    G80
    Z1.0
    G0Z2.0M9
    G91G28Z0
    M1
    N4G0G40G80
    T4M6(0.12,TD_01200_31:J)
    G90G00G115X0.119Y-0.127S5200M3
    G43Z2.0H4
    Z1.M8
    Z-0.15
    G83Z-0.7911Q0.26R-0.15F9.36
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G83Z-0.7911Q0.26R-0.15F9.36
    G80
    Z1.0
    G0Z2.0M9
    G91G28Z0
    M1
    N5G0G40G80
    T5M6(2.75,2.75 slitting end mill)
    G90G00G115X-0.8714Y1.8764S600M3
    G43Z2.0H5
    Z1.M8
    Z-0.315
    G1Z-0.416F100.0
    X-1.195Y0.8616F20.0
    Y-2.3468
    G0Z1.0
    X-0.8714Y1.8764
    Z-0.315
    G1Z-0.416F100.0
    X-0.795Y1.2164F20.0
    Y-2.3468
    S500
    F40.0
    X-0.775Y1.2279
    Y-2.3468
    G0Z1.0
    G0Z2.0M9
    G91G28Z0
    M1
    N6G0G40G80
    T6M6(0.138,tap#6-32 Form)
    G90G00G115X0.119Y-0.127S1000M3
    G43Z2.0H6
    Z1.M8
    Z-0.15
    G84R-0.15Z-0.7547F31.25
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G84R-0.15Z-0.7547F31.25
    G80
    Z1.0
    G91G28Z0M9
    G91G28Y0
    M30
    %
    THANK YOU!!!!

  7. #7
    Join Date
    Oct 2005
    Posts
    11
    This is what I do when I have a program that's been written for a single part. Take the main part of each tool operation and put it as a sub. Just be sure to run this in the graphic view and don't trust anything I have done blindly since I know I can screw up anything!

    I added a G90 and the starting X and Y coordinates in each subroutine and at the end there is a G91 A15. then a M99 so it will repeat the operation.

    %
    O1234(slit,cbore,drill,tap6-1-2010)
    N1G0G40G80G91G28Z0
    T1M6(0.25,user_adjust_02500-00000)
    G90G00G115X0.119Y-0.127 A0 S5200M3
    G43Z2.0H1
    G97 P100 L24
    G91G28Z0
    M1
    N2G0G40G80

    T2M6(0.0781,center_2)
    G90G00G115X0.119Y-0.127 A0 S5200M3
    G43Z2.0H2
    G97 P200 L24
    G91G28Z0
    M1
    N3G0G40G80

    T3M6(0.136,TD_01360_29:J)
    G90G00G115X0.119Y-0.127 A0 S5200M3
    G43Z2.0H3
    G97 P300 L24
    G91G28Z0
    M1
    N4G0G40G80

    T4M6(0.12,TD_01200_31:J)
    G90G00G115X0.119Y-0.127 A0 S5200M3
    G43Z2.0H4
    G97 P400 L24
    G91G28Z0
    M1
    N5G0G40G80

    T5M6(2.75,2.75 slitting end mill)
    G90G00G115X-0.8714Y1.8764 A0 S600M3
    G43Z2.0H5
    G97 P500 L24
    G91G28Z0
    M1
    N6G0G40G80

    T6M6(0.138,tap#6-32 Form)
    G90G00G115X0.119Y-0.127 A0 S1000M3
    G43Z2.0H6
    G97 P600 L24
    G91G28Z0M9
    G91G28Y0
    M30

    N100
    G90 X0.119Y-0.127
    Z1.0M8
    Z.1
    Z0.1
    G85Z-0.25R0.1F8.32
    G80
    Z1.0
    Y-0.521
    Z0.1
    G85Z-0.25R0.1F8.32
    G80
    Z1.0
    G0Z2.0M9
    G91 A15.
    M99

    N200
    G90 X0.119 Y-0.127
    Z1.M8
    Z-0.15
    G81Z-0.373R-0.15F10.14
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G81Z-0.373R-0.15F10.14
    G80
    Z1.0
    G0Z2.0M9
    G91 A15.
    M99

    N300
    G90 X0.119 Y-0.127
    Z1.M8
    Z-0.15
    G83Z-0.4959Q0.205R-0.15F10.61
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G83Z-0.4959Q0.205R-0.15F10.61
    G80
    Z1.0
    G0Z2.0M9
    G91 A15.
    M99

    N400
    G90 X0.119 Y-0.127
    Z1.M8
    Z-0.15
    G83Z-0.7911Q0.26R-0.15F9.36
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G83Z-0.7911Q0.26R-0.15F9.36
    G80
    Z1.0
    G0Z2.0M9
    G91 A15.
    M99

    N500
    G90 X-0.8714 Y1.8764
    Z1.M8
    Z-0.315
    G1Z-0.416F100.0
    X-1.195Y0.8616F20.0
    Y-2.3468
    G0Z1.0
    X-0.8714Y1.8764
    Z-0.315
    G1Z-0.416F100.0
    X-0.795Y1.2164F20.0
    Y-2.3468
    S500
    F40.0
    X-0.775Y1.2279
    Y-2.3468
    G0Z1.0
    G0Z2.0M9
    G91 A15.
    M99

    N600
    G90 X0.119 Y-0.127
    Z1.M8
    Z-0.15
    G84R-0.15Z-0.7547F31.25
    G80
    Z1.0
    Y-0.521
    Z-0.15
    G84R-0.15Z-0.7547F31.25
    G80
    Z1.0
    G91 A15.
    M99
    %

  8. #8
    Join Date
    Oct 2007
    Posts
    31
    Stickerman, thanks so much. I've got a much better understanding of why the code is placed where it is now. Got a quick question on the "L" though. Is the "L" just a repeat value? For example L50 repeats a particular operation 50 times I assume? Also, I notice that the "P" and "N" values are incremented by 100..ex...P100, P200, N100, N200, etc. It seems that the N100 references the P100 and so on? One last thing, will this scenario run the parts through on the first tool then the second, third, etc.....or will it run one part then the second part, etc? Thanks again for your help!!

  9. #9
    Join Date
    Oct 2005
    Posts
    11
    Yes, the L is how many times it repeats. The N100 could be N1 or N10 or whatever you want it to be. I started to do it with N1, N2, but then saw you had that in your other code and added the zeros.

    The way I edited it the one tool would work all the way around the part then go to the next tool. It would be really simple to do it the other way, but would waste a bunch of time with tool changes.

  10. #10
    Join Date
    Oct 2007
    Posts
    31
    Stickerman, you're right, it certainly would waste a ton of time. I guess I was so focused on just getting it to happen that I wasn't thinking past the repeating. Thanks so much for the help. You guys are invaluable and I hope as time goes on I can contribute to solutions like these in return.

    Gratefully yours,

    J.Berto

  11. #11
    Join Date
    Jul 2005
    Posts
    12177
    When you use G91 for rotating the 4th axis you sometimes end up with it rotated several complete revolutions from zero. Haas has a feature called Quick Rotary G28 which lets you zero the 4th axis to the nearest zero point instead of 'unwinding' all the revolutions.

    I cannot remember whether they are a Setting or Parameter that has to be turned on but I think there are two; one is called Quick rotary G28 and the other is Circle Wrap.
    An open mind is a virtue...so long as all the common sense has not leaked out.

  12. #12
    Join Date
    Oct 2007
    Posts
    31
    Thanks Geof, I'll look into that at the end of the day when the operator has gone. We've been getting away with it because the end of the program contains optional stops that allow the operator to roll the 4th axis back around one position at a time. We need to do this to allow ease of part load/unload so it works well and we don't end up "wrapped." Thanks again everyone!

  13. #13
    Join Date
    Oct 2007
    Posts
    31
    Stickerman, the code in post 7 is giving me a bad g-code alarm. I'm assuming the G97's should be replaced with M97's. Going to try that. Thanks again!

  14. #14
    Join Date
    Oct 2005
    Posts
    11
    Yep, M97 not G97... I said I could screw it up

  15. #15
    Join Date
    Oct 2007
    Posts
    31
    Works great now. You guys are great for taking the time to help out. Thanks again.

Similar Threads

  1. 4 axis g-code help
    By THend in forum G-Code Programing
    Replies: 3
    Last Post: 03-26-2009, 12:27 AM
  2. Homing axis in G-Code
    By Des Jacobsen in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 10-21-2008, 07:06 AM
  3. G code help C-X axis
    By slkret in forum G-Code Programing
    Replies: 1
    Last Post: 05-10-2008, 02:53 PM
  4. zero axis key code?
    By drafterman in forum Mach Software (ArtSoft software)
    Replies: 2
    Last Post: 03-06-2008, 03:18 PM
  5. Z-Axis Arc G-Code?
    By GTmike400 in forum G-Code Programing
    Replies: 16
    Last Post: 01-27-2006, 06:15 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
  •