Setting the printer to ready via an input pin on the GPIO
I've modified my MK4S with an auto eject scrapper so I can queue up multiple prints with having to unload the printer manually.
It sends a finish signal Via the GPIO to a micro controller to start the sequence.
If you are curious this is the set up for the auto eject. Not my design, but works great: https://github.com/d-weber/prusa-chain-production/
Hats off the the designer d-weber.
However, the thorn in the lions paw is the set ready on the printer.
On the store page for the GPIO it claims it can be used to set the printer to ready.
This is what I have tried:
I've made Pin 6 on the GIPO to an input so I can have it execute a macro from a gcode file on the USB.
The macro is 2 lines of code:
- M72 S1 ; Set printer to ready State
- M300 ; Buzz to confirm macro was executed
I'm trying to use the M72 command to set the printer to the ready state. It seems like it should work.
https://help.prusa3d.com/article/prusa-firmware-specific-g-code-commands_112173#m-commands
I know the macro is executed because it buzzes. But the printer doesn't change.
- Does anyone understand the M72 command?
- Is there an alterative to way to do set the printer to ready through gcode?
I'm not much of a programmer so I'm out of my element.
Any help would be appreciated!
RE: Setting the printer to ready via an input pin on the GPIO
M1200 can be used to set the printer to ready from gcode.
RE: Setting the printer to ready via an input pin on the GPIO
Hi @QmcMurray. I was pointed to this thread from this one, where I am trying to execute endless printing on an XL by having the printer bump the part off the bed and then automatically proceed with the next print. I added M1200 to the end of the G-code, but the print is still finishing with the printer in the "busy" state, and requiring me to press "Set Ready" at the end of every job to resume. Can you elaborate more on how M1200 can be used to automatically "Set Ready" at the end of a print? Here is how I added it to my end G-code.
RE: Setting the printer to ready via an input pin on the GPIO
Hi @maxfagin,
I'm using the M1200 command in combination with the Prusa GPIO. So the m1200 command is being executed by a macro triggered buy a sperate microcontroller after the gcode is finished. The printer is in the idle state when it resets. I haven't done any testing while the printer is running gcode to set ready. I have a feeling it can't do that.
I don't own and XL so I can't run any tests.
You might want to try to adding a dwell before the M1200 it might be trying to execute too many things at a time. Or it can't do the change set ready when the z axis is in motion.
G4 P200; dwell for 200 milliseconds
If you Decide to add a GPIO I can elaborate on the setup I have. You can see in the video the printer is finished then it sets ready with the buzz.
RE: Setting the printer to ready via an input pin on the GPIO
I tried adding the dwell before the M1200, as well as just appending M72 S1 to the end of the gcode file, but the printer is still finishing in the "Set Ready" state and not proceeding with the next print.
Can you elaborate more on the required steps you took to get the GPIO board to set the printer to the ready state? (The link to the video you posted is showing broken).
RE:
Hi Maxfagin,
Sorry about the broken link, this one should work: Video
Regarding my setup:
I have a GPIO connected to an Arduino that runs my auto eject setup. These are the basic steps that that just focuses on the auto reset.
- Solder headers onto the GPIO and Solder the jumpers for pins 6 and 7 (The this connects the internal pull up resistors on the GPIO, the pins are active low. I used these so that I didn't have to worry about the drifting voltage)
- Connect the GPIO to the Printer and Pin 6/7 to the Arduino Digital I/O Pins (or microcontroller of choice)
- You'll have to power the Arduino/or micro controller separate from the GPIO
- Run setup.gcode on your printer.
- This is a custom gcode that you run to set the behavior of the I/O pins on the GPIO. (You can use wordpad or any other text editor to create this by saving the .txt file then changing the file extension to .gcode)
- This is my setup code (Pin 5 is not used for the auto reset but for the auto eject to move the bed to an unload position)
- Pin 7 is wrote to high so that it doesn't accidently signal the Arduino on start up.
- In this case Pin 7 is going to tell the Arduino to run it's program. Pin 6 is going to run a macro on the usb located in the macros folder.
- Create the Macro folder and the macros on the usb
- On the usb plugged into the Pinter create a folder called macros
- In this folder add your custom gcode macros. (Use the same process as with the setup file to create the gcode)
- The gcode needs to use this naming convention: btn_X where x is the pin that is connected to the macro you want to run.
- In this case btn_6.gcode
- This is the code in the macro for button 6.
- M1200 to reset the printer, M300 to buzz for conformation.
- Set up the Auto eject code on the printer.
- The printer is now ready for auto reset.
- Set up the Arduino for the auto eject.
- This may change if you want the Arduino to do other things.
- I have included a basic .ino file if you want to use it.
I have included a zip file with all the code snips in the instructions above.
Please let me know if this helps!