Welcome! Log In Create A New Profile

Advanced

Wait for external input in G-code

Posted by ellipse 
Wait for external input in G-code
June 24, 2015 06:12AM
I would like to insert G-codes in a print file in order to have the printer stop, reclaim human attention sounding a buzzer, and wait until a phisical button is pressed. Right now, I've connected a buzzer to FAN0 output and used M106/M107 for playing it.
Is there a simple way to connect a pushbutton to a free Duet input and have the printer wait for a keypress before continuing?

BTW, I think the abstract scheme (that is, activating an external device at some point in the print and waiting until it's ready to continue) is of general interest, so I'm likely overlooking some existing G-code!
Re: Wait for external input in G-code
June 24, 2015 06:57AM
AFAIK there is no G-code for this purpose yet. However it shouldn't be too difficult to implement this functionality, in theory it should be fairly easy to add a new G-code to wait until an endstop is triggered. That way you could use the E0 endstop for example and make the firmware wait until it's triggered. I'll have a look at implementing this in my next firmware version.
Re: Wait for external input in G-code
June 24, 2015 07:33AM
Quote
ellipse
I would like to insert G-codes in a print file in order to have the printer stop, reclaim human attention sounding a buzzer, and wait until a phisical button is pressed. Right now, I've connected a buzzer to FAN0 output and used M106/M107 for playing it.
Is there a simple way to connect a pushbutton to a free Duet input and have the printer wait for a keypress before continuing?

BTW, I think the abstract scheme (that is, activating an external device at some point in the print and waiting until it's ready to continue) is of general interest, so I'm likely overlooking some existing G-code!

You could send M300 (make beep sound) followed by M226 (pause). If you have a PanelDue on your system, it will generate the beep, then you can press Resume to continue the print.

Edited 1 time(s). Last edit at 06/24/2015 07:34AM by dc42.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Re: Wait for external input in G-code
June 26, 2015 07:56AM
@zpl: I didn't even noticed that the extruder channel provides an endstop input, I can't wait for the next firmware releases!

@dc42: The PanelDue is great, the cheap and dirty buzzer hack connected to fan otuput also works.

In my case, the machine is making 100 replicas of the same piece. No screens or pcs on the production line, config.g starts automatically at power on. Operator trainig is limited to check there is enough filament in the roll, turn on the machine, turn it off when it beeps and remove the piece.
I would like to experiment with the switch in order to:

  • beep the buzzer and wait the operator before continuing (e.g. placing a nut to be embedded in the print)
    e.g.:
     Mxxx E0 ;wait as long as extruder endstop input is low 
  • select one of two print, eg. adding a conditional parameter to M98 command
    e.g.
     M98 E0 P/gcodes/piece_zero.g ;print this piece if extruder endstop input is low
     M98 E1 P/gcodes/piece_one.g ;print this piece if extruder endstop input is high 
Re: Wait for external input in G-code
June 26, 2015 08:11AM
Quote
ellipse
In my case, the machine is making 100 replicas of the same piece. No screens or pcs on the production line, config.g starts automatically at power on. Operator trainig is limited to check there is enough filament in the roll, turn on the machine, turn it off when it beeps and remove the piece.
I would like to experiment with the switch in order to:
Print this [www.thingiverse.com] (I saw it in another post somewhere on this forum), and you could dispense with the operator! At the end of the print, the boxing-glove fires knocking the print off the bed and into a waiting box, then loop back and start again.

Dave
Re: Wait for external input in G-code
June 26, 2015 09:10AM
Quote
ellipse
In my case, the machine is making 100 replicas of the same piece. No screens or pcs on the production line, config.g starts automatically at power on. Operator trainig is limited to check there is enough filament in the roll, turn on the machine, turn it off when it beeps and remove the piece.
I would like to experiment with the switch in order to:

  • beep the buzzer and wait the operator before continuing (e.g. placing a nut to be embedded in the print)
    e.g.:
     Mxxx E0 ;wait as long as extruder endstop input is low 
  • select one of two print, eg. adding a conditional parameter to M98 command
    e.g.
     M98 E0 P/gcodes/piece_zero.g ;print this piece if extruder endstop input is low
     M98 E1 P/gcodes/piece_one.g ;print this piece if extruder endstop input is high 

I really think a PanelDue is what you need. It already provides the Pause/Resume functionality, and you can set up some macros for printing your 2 standard pieces, loading filament etc. It also has the Pause and Cancel buttons that your operator can use if something is going horribly wrong.



Large delta printer [miscsolutions.wordpress.com], E3D tool changer, Robotdigg SCARA printer, Crane Quad and Ormerod

Disclosure: I design Duet electronics and work on RepRapFirmware, [duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login