Page 1 of 2 12 LastLast
Results 1 to 12 of 16

Thread: calculate machining time from G-Code

  1. #1
    Registered
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    12
    Downloads
    0
    Uploads
    0

    calculate machining time from G-Code

    I want to calculate machining time for every command of a G-code
    Example

    N01 X10 F20 machining time = ?
    N02 X20 Y20 Z20 machining time = ?
    N03 X30 Y25 Z25
    N04
    N05

    for N01:
    Distance travelled= S = 10 mm
    machining time = completion time = ?

    for N02:
    Distance travelled =sqrt ( ( 20-10)^2 + ( 20-0)^2+( 20-0)^2 ) = 22.5 mm
    machining time = completion time = ?
    Thanks
    smar


  2. #2
    Registered
    Join Date
    Jun 2008
    Location
    United States
    Posts
    1,509
    Downloads
    0
    Uploads
    0
    This is much more difficult then it appears. You have to also take into consideration if you are using CSF as your RPM will then change and your mm/rev will change depending on the diameter of the part you are at.

    It appears that by your numbers that you have rather short feed moves that you are trying to calculate out a time for. If that is the case you can be overshadowed by any rapid moves or position moves with in a given time. These should be taken in to account as well. I would suggest using the machine timers.

    Can you not use the machine timers to get what you need? I have spreadsheet that I developed that you can put the rough and finish stock with the SF and feed per rev and it gives you a run time.

    Stevo


  3. #3
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    11,964
    Downloads
    0
    Uploads
    0
    The time it takes to travel a certain distance is the distance divided by the speed.

    So for your first move on a single axis the time is 0.5 minutes, the three axis move is 1.125 minutes.
    An open mind is a virtue...so long as all the common sense has not leaked out.


  4. #4
    Registered
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    12
    Downloads
    0
    Uploads
    0
    Tanks for the replies.
    Using a machine timer may not be possible for me, as I am tying to do it offline in computer.
    I am not sure if I simple can derive distance by speed to get time. As the machine accelerates/decelerates for every move and there are rounds when it change direction.
    I would be thankful for father help or correction.


  • #5
    Registered neilw20's Avatar
    Join Date
    Jun 2007
    Location
    Australia
    Posts
    3,424
    Downloads
    0
    Uploads
    0

    The perfect program.

    This works well.
    www.ncplot.com
    Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.


  • #6
    Registered
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    12
    Downloads
    0
    Uploads
    0
    hello
    actually I want to code it in my program. Thus I am looking to write my own function doing this.
    I would be thankful for further assisstance.
    smar


  • #7
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by smar View Post
    hello
    actually I want to code it in my program. Thus I am looking to write my own function doing this.
    I would be thankful for further assisstance.
    smar
    so, you are authoring something in VB or some such or do you mean a function on the CNC?


  • #8
    Registered Superman's Avatar
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1,769
    Downloads
    0
    Uploads
    0
    One major stumbling block that everyone has not noticed

    How is the part programmed ? tool comp etc. if you use tool radius comp of zero then the g-code is actual distance travelled

    but

    if you program to tool radius and the radius is in the comp value, then you are not calculating true tool paths

    Sorry guys for thowing in this furfy


  • #9
    Registered
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    12
    Downloads
    0
    Uploads
    0
    thanks for the useful replies,
    I am doing it in Matlab. I imported a simple CNC code and I want to calculate the completion time for each command.

    Should I use equations of accelerated motion to calculate completion time?
    v=u+at
    s=ut+1/2at^2
    v^2=u^2+2as

    if yes what would be the initial velocities u (zero every time or final velocity of previous step ?)

    @superman
    In my understanding, for a straight line cut for example

    Tool path = distance travelled for a CNC command line = profile to be cur to work piece - 2 x tool radios
    = actual distance travelled on work piece - 2 x tool radios

    Thus distance travelled for a specific CNC command line represents the path tool moved (which I am concerned).
    Please correct me if my understanding is not right.

    thanks
    smar


  • #10
    Registered Superman's Avatar
    Join Date
    Dec 2008
    Location
    Krypton
    Posts
    1,769
    Downloads
    0
    Uploads
    0
    See if I can explain

    method 1--- comp in machine = 0
    the actual g-code file to run the machine is the actual toolpath, the compensation value is adjusted to compensate for cutter wear ( usually by only a small amount )

    method 2--- comp in machine = tool radius
    actual g-code is the part profile, if compensation is 0, then the tool will travel on this line, as the comp is increased in radius, the tool path is automatically offset by this radius. To cut the correct profile the comp. value must not be smaller than the tool radius.

    eg. 100mm square block being cut with a 50mm cutter

    the cutter centreline must travel on a 150mm square with 25mm corner radii to go around the 100mm square
    ---the g-code for method 1 is this 150mm square path ( total programmed distance=478.54mm---total traved distance=478.54mm when tool radius,R=0)
    ---the g-code for method 2 is the 100mm square( total programmed distance =400mm---total travel distance=478.54 when tool radius,R=25.0mm---total travel distance=478.54mm when tool radius,R=25.0mm)[ 4 x 25mm quadrants + 4 x 100mm straight sides ]

    As you can see this is only 1 profile path, 78.5mm is lost out of the calculation, now add multiple cut depths, and many other toolpaths and the estimate time will be very short of actual time

    Your requirements will only work with toolpaths using method 1.
    Last edited by Superman; 02-20-2009 at 05:20 PM. Reason: changed to metric


  • #11
    Moderator tobyaxis's Avatar
    Join Date
    Jan 2006
    Location
    USA
    Posts
    4,394
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by neilw20 View Post
    This works well.
    www.ncplot.com
    I second that. NC Plot is a very useful tool.
    Toby D.
    "Imagination and Memory are but one thing, but for divers considerations have divers names"
    Schwarzwald

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

    www.refractotech.com


  • #12
    Registered
    Join Date
    Feb 2009
    Location
    Germany
    Posts
    12
    Downloads
    0
    Uploads
    0
    Thanks superman,
    I had understood that CNC commands distance is path that tool will finally travel. Tool radius compensation is done while writing CNC code or generating CNC code from CAM.

    But as you corrected me that the CNC commands distance is actually the distance that would be cut on work piece. The tool travel will be equal to CNC command distance + radius compensation.

    Could you please confirm the concept for me once again?


    About computing time for each CNC command line, I am doing this way.
    Time of completion a CNC command = (CNC commands distance + radius compensation ) x Feed rate

    But I guess, this would be the case when I feed rate is constant overall. Theatrically feed rate is constant in whole CNC program. But I was just confusing one point.
    When, for example, machine change direction. Does feed rate(speed) remain constant over the turn? If not, i may not be able to use (distance = feed rate x time) formula to calculate time?

    I have to write my own code that software NCPlot may not help me. unfortunately, I could not find the option in this software where it calculates time of completion of each CNC command for a given CNC code and tool radius.

    I would be very thankful for any further help.
    Smar


  • Page 1 of 2 12 LastLast

    Similar Threads

    1. Machining Time Off
      By extanker59 in forum CamWorks
      Replies: 0
      Last Post: 11-25-2008, 09:42 AM
    2. Machining time
      By jrobson in forum General Metalwork Discussion
      Replies: 6
      Last Post: 04-13-2008, 03:28 PM
    3. Estimating machining time
      By wildcat in forum Mach Software (ArtSoft software)
      Replies: 4
      Last Post: 11-20-2006, 08:35 PM
    4. Machining Time
      By mmike76 in forum General CAM Discussion
      Replies: 9
      Last Post: 04-09-2006, 09:07 AM
    5. Getting the machining time
      By HuFlungDung in forum OneCNC
      Replies: 8
      Last Post: 05-15-2003, 02:06 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.