A question about speed codes


Results 1 to 10 of 10

Thread: A question about speed codes

  1. #1
    Registered
    Join Date
    Dec 2017
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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!

    Similar Threads:


  2. #2
    Member
    Join Date
    Feb 2006
    Location
    india
    Posts
    1792
    Downloads
    0
    Uploads
    0

    Default 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
    Registered
    Join Date
    Dec 2017
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default 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
    Member
    Join Date
    Feb 2006
    Location
    india
    Posts
    1792
    Downloads
    0
    Uploads
    0

    Default Re: A question about speed codes

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



  5. #5
    CNCFr's Avatar
    Join Date
    Sep 2002
    Location
    Timbuktu
    Posts
    1950
    Downloads
    0
    Uploads
    0

    Default

    It depends on the controller you are using.
    There are controllers which support this feature and there are others which don't.



  6. #6
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default 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
    Registered
    Join Date
    Dec 2017
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    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
    Registered
    Join Date
    Dec 2017
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    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
    Member
    Join Date
    Jan 2010
    Location
    Norway
    Posts
    171
    Downloads
    0
    Uploads
    0

    Default 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
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: A question about speed codes

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

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

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

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


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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

A question about speed codes

A question about speed codes