586,114 active members*
3,337 visitors online*
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2017
    Posts
    4

    A question about speed codes

    Hello,

    I have a cnc wood lathe and currently I only use g-code to program it, which is enough since I only produce simple things. The problem is that I cannot control acceleration or deceleration of the axes' movements. For example I want the Z axis start at a certain speed (say F15000) and I want it to slow down until F5000 when it moves 800 mm away. I read somewhere about this and it says we just write the speed code at the end of the line where we specify the end point as coordinates; for instance G01 F15000 / G01 Z825 X-110 F5000 (slash stands for next line). Supposedly it starts at F15000 and it is at Z70 X-80 for example, and it becomes F5000 when came to Z825 X-110. But this doesn't work! It just perceives the F code at the end of the last line as the speed of the whole movement. So I couldn't manage to observe any acceleration or deceleration that way.

    Anybody has any knowledge about this and a suggestion? Even if you have any idea, please tell, I most probably need it!

  2. #2
    Join Date
    Feb 2006
    Posts
    1792

    Re: A question about speed codes

    As far as I know, continuous change if feedrate is not possible. It can be changed in steps.

  3. #3
    Join Date
    Dec 2017
    Posts
    4

    Re: A question about speed codes

    Quote Originally Posted by sinha_nsit View Post
    As far as I know, continuous change if feedrate is not possible. It can be changed in steps.
    By steps you mean each code line?

  4. #4
    Join Date
    Feb 2006
    Posts
    1792

    Re: A question about speed codes

    Quote Originally Posted by Pampop34 View Post
    By steps you mean each code line?
    Yes

  5. #5
    Join Date
    Sep 2002
    Posts
    1956
    It depends on the controller you are using.
    There are controllers which support this feature and there are others which don't.

  6. #6
    Join Date
    Jan 2010
    Posts
    171

    Re: A question about speed codes

    Im thinking a macro would help you here if there aren't any other functions, i have a simple program you can try, might need to adjust it for your machine and function.

    (A=#1 NUMBER OF STEPS)
    (Z=#26 Z DISTANCE TO GO)
    (X=#24 X DISTANCE TO GO)
    #104=#5003 (CURRENT Z)
    #105=#5001 (CURRENT X)
    #106=#4109 (CURRENT F)

    #101=ABS[[#26-#5003]/#1] (Z MOVEMENT FOR EACH STEP)
    #102=ABS[[#24-#5001]/#1] (X MOVEMENT FOR EACH STEP)
    #103=ABS[[#9-#4109]/#1] (F CHANGE FOR EACH STEP)

    N1
    WHILE [#104 GE #26] DO1
    #104=#104-#101
    #105=#105-#102
    #106=#106-#103
    IF [#104 LT #26] THEN GOTO9999 (SAFETY CHECK)
    IF [#105 LT #24] THEN GOTO9999 (SAFETY CHECK)

    G1Z#104 X#105 F#106
    END1
    N9999
    M99

  7. #7
    Join Date
    Dec 2017
    Posts
    4
    Quote Originally Posted by CNCFr View Post
    It depends on the controller you are using.
    There are controllers which support this feature and there are others which don't.
    I am using Mach3 software on my PC, if it is what you mean as controller. If so, does it support this feature?

  8. #8
    Join Date
    Dec 2017
    Posts
    4
    Quote Originally Posted by ProToZyKo View Post
    Im thinking a macro would help you here if there aren't any other functions, i have a simple program you can try, might need to adjust it for your machine and function.

    (A=#1 NUMBER OF STEPS)
    (Z=#26 Z DISTANCE TO GO)
    (X=#24 X DISTANCE TO GO)
    #104=#5003 (CURRENT Z)
    #105=#5001 (CURRENT X)
    #106=#4109 (CURRENT F)

    #101=ABS[[#26-#5003]/#1] (Z MOVEMENT FOR EACH STEP)
    #102=ABS[[#24-#5001]/#1] (X MOVEMENT FOR EACH STEP)
    #103=ABS[[#9-#4109]/#1] (F CHANGE FOR EACH STEP)

    N1
    WHILE [#104 GE #26] DO1
    #104=#104-#101
    #105=#105-#102
    #106=#106-#103
    IF [#104 LT #26] THEN GOTO9999 (SAFETY CHECK)
    IF [#105 LT #24] THEN GOTO9999 (SAFETY CHECK)

    G1Z#104 X#105 F#106
    END1
    N9999
    M99
    Thanks for this. But I don't know anything about what this is. Is it another type of code for CNC like g-code?

  9. #9
    Join Date
    Jan 2010
    Posts
    171

    Re: A question about speed codes

    A macro is a routine or sub-program that includes non-G-code commands. It is typically used for common operations that will be called many times in a program.
    So the program works like a sub program, so put that in program O8000 or something then change G01 Z825 X-110 F5000 to G65 P8000 Z825 X-110 F5000 A1000(this value can be bigger og smaller depends on how often you want the feed to change)

  10. #10
    Join Date
    Mar 2003
    Posts
    35538

    Re: A question about speed codes

    Mach3 does not support If...Then and While in g-code.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Similar Threads

  1. Chiron FZ12W High speed Siemens 810m error codes
    By efret in forum SIEMENS -> Sinumerik 810M/810T
    Replies: 14
    Last Post: 10-15-2022, 08:36 PM
  2. Absolute Newbie Question on G-Codes
    By smokediver576 in forum Tormach PathPilot™
    Replies: 6
    Last Post: 07-15-2015, 11:44 AM
  3. Have question on several G codes
    By colby2000 in forum CNC Swiss Screw Machines
    Replies: 2
    Last Post: 09-28-2013, 03:10 PM
  4. NH4000 DCG only uses M speed codes on
    By guitarzycki in forum Mori Seiki Mills
    Replies: 1
    Last Post: 09-20-2010, 05:39 PM
  5. Spare M Codes Question?
    By AMCTony in forum Haas Lathes
    Replies: 12
    Last Post: 09-14-2007, 03:59 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
  •