586,214 active members*
3,748 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Need help to modify gcode so spindle does not turn off at the end of the cycle
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2006
    Posts
    205

    Need help to modify gcode so spindle does not turn off at the end of the cycle

    Hi,
    I have a repetitive job on my cnc mill.
    The code from Fusions stops the spindle at the end of the cycle.
    I would like to keep the spindle running at the end of the cycle while I swap out parts
    and then hit run again.

    Any help would be appreciated.

    Thank you all in advance.
    Rod in San Francisco

    (1001)
    (T144 D=0.3125 CR=0. TAPER=118DEG - ZMIN=-1.275 - DRILL)
    G90 G94 G91.1 G40 G49 G17
    G20
    G90
    (DRILL1)
    M5
    M9
    S2000 M3
    M8
    G0 X0. Y0.
    G43 Z1.4 H144
    Z1.
    G98 G73 X0. Y0. Z-1.375 R0.1275 Q0.1 F4.
    G80
    Z1.4
    G90
    M30

  2. #2
    Join Date
    Dec 2013
    Posts
    5717

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    M5 turns off the spindle so deleting that line might help. M30 may shut the spindle off also, depends on the controller software. It may be possible to replace the M30 with an M2, but i'm not sure if it would cycle again. Can't hurt to try.

    On the other hand, it doesn't seem safe to leave the spindle running when changing parts, but I'll leave it to you to evaluate the conditions.
    Jim Dawson
    Sandy, Oregon, USA

  3. #3
    Join Date
    Aug 2009
    Posts
    1573

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    One way is to LOOP the Program add a G04 Pxxx (Dwell time of your choice) and a M1 to be able to Stop for Lunch.

  4. #4
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    Quote Originally Posted by rodjava View Post
    Hi,
    I have a repetitive job on my cnc mill.
    The code from Fusions stops the spindle at the end of the cycle.
    I would like to keep the spindle running at the end of the cycle while I swap out parts
    and then hit run again.

    Any help would be appreciated.

    Thank you all in advance.
    Rod in San Francisco

    (1001)
    (T144 D=0.3125 CR=0. TAPER=118DEG - ZMIN=-1.275 - DRILL)
    G90 G94 G91.1 G40 G49 G17
    G20
    G90
    (DRILL1)
    M5
    M9
    S2000 M3
    M8
    G0 X0. Y0.
    G43 Z1.4 H144
    Z1.
    G98 G73 X0. Y0. Z-1.375 R0.1275 Q0.1 F4.
    G80
    Z1.4
    G90
    M30
    You would have to remove the M5 and M9 at the start of the program, the program looks kind of strange how that was done
    Mactec54

  5. #5
    Join Date
    Oct 2006
    Posts
    205

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    Quote Originally Posted by mactec54 View Post
    You would have to remove the M5 and M9 at the start of the program, the program looks kind of strange how that was done
    Thanks everybody who chimed in.
    The job was to drill a 9/32 through hole down the center of a 1/2-13 x 3/4 hex bolt which are M8 hardness.
    Since there are 500 pieces, I thought I could save wear and tear on the spindle motor by keeping it on for the 500 cycles.

    Turned out that auto spindle turn off and then a simple cycle start worked best.

    Things I learned from this job was a slow constant downward pressure worked 10x better than peck drilling.
    9/32 drill 900 rpm with flood coolant. Each cycle was only 60 seconds.
    I could get about 15 cycles from each new 9/32 bit before sharpening.

    Since I am only a home shop machinist, I never know how much to charge.
    I settled on $2.25 each piece.

    Thanks again for all your help.

    Rod in SF



  6. #6
    Join Date
    Dec 2013
    Posts
    5717

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    At $2.25 each, I think you did OK. :cheers:
    Jim Dawson
    Sandy, Oregon, USA

  7. #7
    Join Date
    Jun 2015
    Posts
    4154

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    hi

    i thought I could save wear and tear on the spindle motor by keeping it on for the 500 cycles
    to avoid spindle stop, use something like this :

    Code:
        spindle running
        G00 Z_up
        G00 Y_bring_table_near_door
         /... or M01 (*1)
        G00 Y_send_table_at_work_position
        G00 Z_down
    
    (
    *1
    search a parameter inside the machine, that won't stop the spindle during optional stop 
    )
    Turned out that auto spindle turn off and then a simple cycle start worked best
    also a ctr capability will save some time :

    Code:
        G00 Z_up
        G00 Z_down S M03 ( rpm and linear travel, both of them, begin at same moment )
    Things I learned from this job was a slow constant downward pressure worked 10x better than peck drilling
    the truth is in between : somehow, you have to change the peck distance and the cutting feeds as you go deeper, so to keep ( almost ) same torque on the spindle, and also the chips to come out; it may be needed, after a certain depth, to retreat the drill at a much greater clearance in front of the part, so to have time to throw the chips ... decisions about what to do, where to change, etc, requires to inspect the Zand/orS axis load diagram

    Quote Originally Posted by Jim Dawson View Post
    On the other hand, it doesn't seem safe to leave the spindle running when changing parts, but I'll leave it to you to evaluate the conditions
    is needed to mess with the keylocks, so to be able to open the cabinet door at any time; i have done this, and it was ok, but i started to worry when someone else was working on the machine, so, i told that person to open the door only when blue light is on ( thus machine is in stop state ) / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  8. #8
    Join Date
    Aug 2009
    Posts
    1573

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    only 15 parts per Drill? Spindle Speed to fast and not enough Chip Load. You may be work hardening the material.

    What does the dull Drill look like? Burned up corners of drill is a dead give away of Spindle to fast.

  9. #9
    Join Date
    Jan 2005
    Posts
    15362

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    Quote Originally Posted by rodjava View Post
    Thanks everybody who chimed in.
    The job was to drill a 9/32 through hole down the center of a 1/2-13 x 3/4 hex bolt which are M8 hardness.
    Since there are 500 pieces, I thought I could save wear and tear on the spindle motor by keeping it on for the 500 cycles.

    Turned out that auto spindle turn off and then a simple cycle start worked best.

    Things I learned from this job was a slow constant downward pressure worked 10x better than peck drilling.
    9/32 drill 900 rpm with flood coolant. Each cycle was only 60 seconds.
    I could get about 15 cycles from each new 9/32 bit before sharpening.

    Since I am only a home shop machinist, I never know how much to charge.
    I settled on $2.25 each piece.
    Sounds like your drill was not that great, if you do it again use a screw machine drill, jobbers are not very good for a job like this, Quality Drills most likely do the whole job with a drill like this and then some

    They are in CA

    North Bay Cutting Tools
    [email protected]
    Ph 707-773-2240
    Mactec54

  10. #10

    Re: Need help to modify gcode so spindle does not turn off at the end of the cycle

    Quote Originally Posted by rodjava View Post
    Hi,

    Thank you all in advance.
    Rod in San Francisco

    (1001)
    (T144 D=0.3125 CR=0. TAPER=118DEG - ZMIN=-1.275 - DRILL)
    G90 G94 G91.1 G40 G49 G17
    G20
    G90
    (DRILL1)
    M5
    M9
    S2000 M3
    M8
    G0 X0. Y0.
    G43 Z1.4 H144
    Z1.
    G98 G73 X0. Y0. Z-1.375 R0.1275 Q0.1 F4.
    G80
    Z1.4
    G90
    M30
    Hi Rod,

    I know your job is done, but save this for next time.

    It pains me to see such, let's say, very dirty code. I'm thinking your Fusion CAM post processor still has a long way to go in needed tweaks. The following is a cleaned up version of your program. It will leave the spindle running in one version and off and on in another.

    First thing I see is you're waaaay too fast on the spindle and waaaaaaaaaay too slow on your feed. Remember if you ever find yourself with chips wrapping around your drill in a nest, nine times out of ten it means you're feeding too slow. You don't mention your control type so I'll assume Fanuc. My apologies if otherwise.

    I would also suggest a 135 deg split point Cobalt drill on a non-spotted hole in medium carbon alloy steel like you're doing. Even TIN coated if you could find it. Program assumes Z zero is top of bolt. Assuming material hardness at roughly 325 Brinell. I left G49 (cancel tool offset) out of your lead setup line as it can mess with how Z acts on some controls in a repeat situation like this. Careful at first run of this to be sure Z acts properly. Your reload work clearance height will be at two inches. (G43 Z2.) Adjust to your comfort level. (Z0.1 suggested minimum)

    O1001 (DRILL 9/32 THRU 1/2-13 X 3/4 GRD 8 BOLT)

    (CONSTANT SPINDLE VERSION)

    (T144 9/32 COBALT DRILL 135DEG)

    (TURN OFF BLOCK SKIP AFTER)
    (LAST PART TO END PROGRAM)

    G17 G20 G40 G54 G80 G90 G94 G98 -- (I didn't see a work offset so added G54 here. Also, what was G91.1? I left it out.)

    G0 X0. Y0.
    G43 Z2. H144 S750 M3
    M8
    G98 G83 Z-1.24 R0.1 Q0.475 F4.9 --- (If having favorable chip control, you can try G73 instead)
    G80
    M9
    G53Y0 (TABLE FORWARD AND RELOAD)
    G4P1500 ----(you got 1.5 sec to hit FEED HOLD. Adjust to suit. If you miss it just let it rerun till next round)
    /M30
    M99

    ************************************

    O1001 (DRILL 9/32 THRU 1/2-13 X 3/4 GRD 8 BOLT)

    (STOP/START SPINDLE VERSION)

    (T144 9/32 COBALT DRILL 135DEG)

    G17 G20 G40 G54 G80 G90 G94 G98

    G0 X0. Y0.
    G43 Z2. H144 S750 M3
    M8
    G98 G83 Z-1.24 R0.1 Q0.475 F4.9
    G80
    M9
    G53Y0
    M30

    Good luck with what I hope is a next time.

  11. #11
    Join Date
    Aug 2007
    Posts
    414
    Do you know system variable (#3003) for automatic operation control? You start the program in AUTOMATIC. From N10 Switch to Single Block. #3003 = 1 (HAAS) disable Single Block and the program goes through to #3003 = 0 (HAAS). This is where the function becomes active and the Program does stop.
    The program runs in an endless loop without spindle stop.
    Fanuc similar to HAAS.

    T144 M6
    S2000 M3
    G54
    N10
    #3003=1 (HAAS, disable Single Block)
    M8
    G0 X0 Y0
    G43 Z1.4 H144
    G73 X0. Y0. Z-1.375 R0.1275 Q0.1 F4.
    G80 M9
    G53 Z0
    G53 Y0
    #3003=0 (HAAS, enable Single Block)
    GOTO 10
    M30

Similar Threads

  1. G71 ID Turn Cycle On TL-1 Lathe
    By matthill in forum Haas Lathes
    Replies: 2
    Last Post: 05-31-2017, 03:54 PM
  2. KFLOP: How to modify spindle speed PWM from SpindleMach3PWM.c
    By PapstDFrisco in forum Dynomotion/Kflop/Kanalog
    Replies: 2
    Last Post: 10-04-2013, 08:29 PM
  3. Gcode Turn A axis CCW
    By kNucklBustr in forum Mach Software (ArtSoft software)
    Replies: 9
    Last Post: 09-24-2012, 06:47 PM
  4. Modify Hole Cycle
    By tummen in forum EdgeCam
    Replies: 0
    Last Post: 08-23-2010, 07:02 PM
  5. ever modify spindle speed range?
    By spindlenut in forum Fadal
    Replies: 3
    Last Post: 02-28-2010, 08:55 AM

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
  •