I have modified the Snapmaker J1 firmware to enable several Marlin features for Octoprint users.
Filament Runout Detection/Handling.
Host Action Commands w/ Host Prompt Support.
Emergency Parser.
Support for Snapmaker’s M2000 tool-change gcode.
Runout handling is achievable using Host Action Prompts on the Octoprint web interface or on a Raspberry Pi screen running Octodash.
Configuration options:
FILAMENT_RUNOUT_SCRIPT in Configuration.h (default is M600).
NOZZLE_PARK_POINT_T0 and NOZZLE_PARK_POINT_T1 (position the nozzles park in upon runout detection or pause) in Configuration.h.
ADVANCED_PAUSE_FEATURE settings in Configuration_adv.h (lengths/speeds for retract, unload, load, and purge for M600 advanced pause, and other options as well).
You can look at the code and compile yourself, but I’ve also included the pre-compiled .bin file for you to install on your printer if you choose. Find it in the “release” folder. You need the file that doesn’t have APP in the name.
If you run into any issues or bugs, let me know and I’ll fix them asap. Enjoy!
I tested filament runout with M600 set as my runout script in configuration.h while printing via Octoprint. Works completely as expected. All configured advanced_pause_feature options worked flawlessly. I didn’t try a manual M600 from the terminal or inserted into the file before print. Just started a random print like normal with Octoprint and then cut the filament. Everything worked perfectly. I replaced the filament and repeated the process a couple more times too. Everything related to runout, including the use of other runout scripts or pause methods, should work just like standard Marlin but with HAC’s instead of an LCD.
I did a multi-extruder (non-duplication) print from HMI to make sure my code doesn’t interfere with normal prints using the Snapmaker HMI screen. Used default Prusaslicer profile to slice. Printing and tool-changes were normal. I triggered runout on each extruder and the native HMI runout handling was normal. No issues.
I did the same multi-extruder (non-duplication) print from Octoprint with the same slicer settings and ran into some issues which I have since addressed.
Issue 1. Standard Marlin allows you to configure a single NOZZLE_PARK_POINT which is where the active extruder parks on pause (ie in case of filament runout). However, the ideal park point for T0 is far left, outside of the print area and the ideal park point for T1 is far right, outside of the print area. Extruders can crash If they share a single park point that is too far left or right.
Fix 1. Configuration.h now has NOZZLE_PARK_POINT_T0 and NOZZLE_PARK_POINT_T1 so that you can configure separate park positions.
Issue 2. Snapmaker uses a custom gcode command for tool changes (M2000 S200). Originally, this gcode was incompatible with Octoprint. I have altered the code so that it works with Octoprint. This test resulted in successful tool change when switching from T0 to T1. T0 returned home and T1 continued the print in the correct location. However, when switching from T1 back to T0, T1 did not return all the way home. It stopped at x324 because it was restricted by software endstops.
Fix 2. Software endstops are now temporarily disabled during tool change. This is safe because no other motion gcode can be injected into the queue during this very brief period while M2000 S200 is executing. Software endstops are disabled just long enough for T1 to return home, and then reenabled.
These fixes are untested. I will be away from the printer for a week. Feel free to test and let me know the results.
*Current firmware version is 0.0.04.
If you’ve download a previous version prior to these fixes, please update to latest version.
Update:
I tested my previous fixes with the same dual extruder print and they were successful. The snapmaker M2000 S200 tool change gcode works with octoprint as expected now, and each extruder now parks in its own individual park position on pause/filament-runout.
I am going to call this mission accomplished. All that is left to test is filament runout during mirror and duplication modes with octoprint, but I will leave that to others. I am willing to fix any issues that you might run into if you report them to me, but I wont be doing any more testing myself. This has been a lot of work and testing for me already, and I feel like Snapmaker owes me a paycheck at this point lol.
Please enjoy. Let me know if you have any requests for firmware customization and I will be happy to oblige when i get some time.