Page 1 of 2 12 LastLast
  1. #1
    we all know (??) that G4 is the gcode for dwell
    it takes a parameter to indicate the dwell (pause) duration

    I have seen various ways of expressing this
    I asked in another forum and wasn't entirly happy with the answers
    they included - "you can specify seconds or milliseconds"!!

    so:
    G4 X123 // dwell for 123 seconds or 123 milliseconds?
    G4 X123.0 // dwell for 123 seconds or 123 milliseconds?
    G4 P123 // dwell for 123 seconds or 123 milliseconds?
    G4 P123.0 // dwell for 123 seconds or 123 milliseconds?
    which is right?

    actually what I really want to know is how to decode the dwell command
    (I'm working on a gcode interpreter for an Arduino based controller)

  2. #2
    I do not know Arduino but in Mach3 it is specified in the controller (General Config) whether it is seconds or milli seconds

    And the code is G04 P50

    Phil

  3. #3
    Quote Originally Posted by M250cnc View Post
    I do not know Arduino but in Mach3 it is specified in the controller (General Config) whether it is seconds or milli seconds

    And the code is G04 P50

    Phil
    Thanks Phil,
    I guess that would set a dwell time of 50 seconds/milliseconds depending on what is configured?

    I had considered hijacking an unused M code to set seconds or milliseconds!

    cheers
    Mike

  4. #4
    NIST specifies P as seconds. But as said above Mach3 for example allows modification of the way this is interpreted to be secs or ms. However as you're writing the interpreter you could take the view that P can mean whatever you want it to mean. Then whenever you or anyone else writes a POST for your interpreter you/they will write it accordingly.

  5. #5
    Hello Striling
    Thanks for that

    sounds like a definitive source rather than the "I have a mate whose friend said that he read somewhere..."

    seconds it is then

    (might still have a configuration option for mS - and an Mcode to flip between the two)

    is there a standard way of using unused Mcodes - or do you just get on with it?
    for example I have already implemented:
    M111 to set debug level
    M226 pause until user hits Go button
    M254 program start (initialise everything)
    M255 request current command completion status

  6. #6
    Quote Originally Posted by mmcp42 View Post
    is there a standard way of using unused Mcodes - or do you just get on with it?
    The simple answer is - I don't know. The problem with standards is that there are so many of them. I've referred to NIST - but this doesn't mean it's the only one (googlify gcode standards!) - a lot of implementations for example take the view - if it's good enough for Fanuc - it's good enough for me. Certainly some m codes are "standard" in the sense that they mean the same thing in "most" implementations. BUT as far as I'm aware there is no "standard" for using the "unused" codes.

  7. #7


    I'll just keep hijacking codes until I see another implementation/definition that uses them!

  8. #8
    Quote Originally Posted by mmcp42 View Post


    I'll just keep hijacking codes until I see another implementation/definition that uses them!
    What exactly do you need the dwell for as sometimes there are better ways of doing things.

    Example, i have a 4 second delay after every toolchange where coolant needs to come on so allows the coolant to flow before the tool starts cutting.

    Phil

  9. #9
    Quote Originally Posted by M250cnc View Post
    What exactly do you need the dwell for as sometimes there are better ways of doing things.

    Example, i have a 4 second delay after every toolchange where coolant needs to come on so allows the coolant to flow before the tool starts cutting.

    Phil
    well there are two answers:
    a) I want to implement a gcode interpreter "properly" so I need to know what the G4 syntax means
    b) I am using Eagle to lay out PCBs; the gcode converter spits out a (G4 P3) delay after starting the spindle
    clearly that needs to be 3 seconds not 3 mSeconds!

    make sense?

  10. #10
    Quote Originally Posted by mmcp42 View Post
    well there are two answers:
    a) I want to implement a gcode interpreter "properly" so I need to know what the G4 syntax means
    b) I am using Eagle to lay out PCBs; the gcode converter spits out a (G4 P3) delay after starting the spindle
    clearly that needs to be 3 seconds not 3 mSeconds!

    make sense?
    Yes, so you need to configure the control so that P3 is 3 seconds and not 3 milli seconds.

    Phil

Page 1 of 2 12 LastLast

Similar Threads

  1. Optimize parameters for mills with tips
    By hoezap in forum Tool & Tooling Technology
    Replies: 0
    Last Post: 15-06-2013, 01:18 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •