M226 M24 Sequence not working
-
I am trying to insert a pause to wipe the nozzle periodically using the Cura 5.6 post processing "pause at height" function. Manually pressing the DWC pause and resume buttons works as expected. Executing the following gcode the pause works as expected but the resume does not. The pause.g file gets executed then nothing happens. After waiting a bit I pressed the DWC resume button. The extruder resumes the previous print X & Y positions but instead of printing it returns to the pause position after extruding the 10mm called for in resume.g. While at the pause position it then tries to retract and extrude 10mm. This cycle repeats without human intervention until I hit the DWC emergency stop. Something is different with the M226, M24 sequence vs the DWC pause and resume.
Any ideas?
Board: Duet 3 MB6HC (MB6HC)
DSF Version: 3.4.5
Firmware: RepRapFirmware for Duet 3 MB6HC 3.4.5 (2022-11-30);added code by post processing ;script: PauseAtHeight.py ;current layer: 5 M83 ; switch to relative E values for any needed retraction M104 S0 ; standby temperature M84 S3600 ; Keep steppers engaged for 1h M226 ; Do the actual pause M24 M104 S230 ; resume temperature G1 F2700 ; restore extrusion feedrate M83 ; switch back to relative E values G92 E0.23155 ;LAYER:5
; pause.g ; called when a print from SD card is paused ; ; generated by RepRapFirmware Configuration Tool v3.1.4 on Thu Sep 03 2020 12:19:15 GMT-0400 (Eastern Daylight Time) M83 ; relative extruder moves G1 E-10 F3600 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm G90 ; absolute positioning ;G1 X0 Y0 F6000 ; go to X=0 Y=0 G1 X0 F6000 ; go to X=0 M98 P"0:/macros/wipe"
; resume.g ; called before a print from SD card is resumed ; ; generated by RepRapFirmware Configuration Tool v3.1.4 on Thu Sep 03 2020 12:19:15 GMT-0400 (Eastern Daylight Time) G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R1 X0 Y0 ; go back to the last print move M83 ; relative extruder moves G1 E10 F3600 ; extrude 10mm of filament
-
Why not just insert your call for the wipe macro at height instead of trying to repurpose pause and resume?
-
@Phaedrux
Well, I was hoping it would be that simple unfortunately it is not. I tried replacing the M24 with M98 P"0:/macros/wipe". After the wipe macro nothing happened, no resume. So I selected the DWC resume and the print head moved to the last position and extruded some filament then returned to the wipe position so I cancelled the print. Then I tried adding M24 to a copy of the wipe macro. That functioned just like having the M24 in the print gcode. It is a coreXY printer so the wipe mechanism is mounted to the frame of the printer vs. attached to the bed.I have attached a screen print of the CURA pause at height dialog for reference. I really do not understand the pause/resume process in enough detail.Most of the PETG I have printed had tolerable blobs. This 3Kg roll has many more and larger blobs even after reducing the extrusion flow. The nozzle picks up little imperfections in the previous layer(s) which eventually turns into a blob sticking to the print. I mostly print functional parts where appearance is not the primary focus but these blobs are just too big and plentiful.
Any more suggestions/questions?
John
my wipe macro
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed exit if move.axes[2].machinePosition < 35 G1 Z35 F500 G1 X-15 Y20 F6000 while iterations < 4 M280 P4 S130 G4 S0.3 M280 P4 S65 G4 S0.3 continue M280 P4 S0
-
In the processes gcode file what is the next command after your M98 call to the wipe macro?
In your wipe macro you could store the current XYZ position as a variable and then return to that position after. It should then resume the print file I would think.I note that you're still using the pause at layer height tool, which is still putting it into a pause state. What I am suggesting it post processing the gcode to add the M98 call directly. No pause.
You could even use a custom gcode of your choice that would call your macro.
Custom GCodes
In RepRapFirmware 2.03 and later, you can create custom GCodes, so long as the GCode is not already implemented. If you try to execute a G- or M-command that RRF does not implement, it will execute a system macro of that name if it exists. For example, if you send G40 then it will execute /sys/G40.g if it exists; and if you send M5000 then it will execute /sys/M5000.g if it exists.In RRF 3.4 and later this extends to G- and M-commands with fractional numbers, for example if you send M55.6 then RRF will look for file "0:/sys/M55.6.g".
So you could use M5000 for example, then have a macro called M5000.g in your sys folder and the contents would be your wipe macro. It's been a while since I've used cura, but does it still have insert gcode at height? Then insert the M5000 command to perform the wipe.
-
The next command in the process gcode is M104 S230
The custom code sounds like an interesting approach. I will read more in the documentation to see how I might use that technique.
Unfortunately, cura does not have a simple way to insert gcode at height. It has insert gcode at layer change but I can't wipe every layer in a 600 layer print! Filament change is an option (M600) but with my limited understanding that seems basically like M226. There is also a time lapse script that uses a user specified Mcode to trigger the camera with a configurable pause.
I think my basic problem is I don't understand how the system knows to return to the last print location and continue the print if I were to manually insert the wipe macro call into the gcode. That's why I'm stuck on the pause/resume approach. Can you point me to some detailed documentation to help me understand?
John
-
@wifibeagle said in M226 M24 Sequence not working:
I don't understand how the system knows to return to the last print location and continue the print if I were to manually insert the wipe macro call into the gcode.
The following gcode commands are print commands in absolute coordinates. It would just go on it's merry way. The only issue you may have is the Z height since you're raising it up some amount it seems. You'd want to store the current Z height at the start of the wipe macro and then restore it at the end.
-
As is often the case I make things more difficult than necessary. I made a copy of my wipe macro with G60 S3 at the beginning and G1 X0 Y0 Z0 F3000 at the end and it worked!
Thank you for your help and patience. Now I'll see how it works for the 600 layer print.
John
-
@wifibeagle said in M226 M24 Sequence not working:
Something is different with the M226, M24 sequence vs the DWC pause and resume.
M226 causes execution of the current file to pause at that point. So the M24 in that file doesn't get executed. When you manually resume, the file starts executing again, starting with the M24 command. I am guessing that the M24 command is causing the behaviour you described because it's out of context, although I would have expected it to be ignored if a file is already being executed.
-
FYI: I found a program called "Gcode Modifyer" that makes it relatively easy to add user gcode at any desired layer. It would be better if CURA had such a post processing feature but this beats manually editing the gcode file. I'm still trying to figure out all the possibilities.
https://www.youtube.com/watch?v=ikwa3nVHrO8 shows a demonstration plus links to the program.
In my case it inserted the following at each selected layer
;G-Code Modifier DATA Start M98 P"0:/macros/wipe" ;1st Command LAYER ;G-Code Modifier DATA End
-
On second thought don't bother with Gcode Modifyer. It only allows one change before saving and reloading the file. I think it is just as easy to modify the code in Notepad+. Oh well...
-
You could still use pause at height plugin and find and replace the M226 with notepad++
Curious if it has a custom gcode option under method dropdown?