macros wishlist
-
Hi,
- There is already stop.g, however it is executed only if your GCode files has an M0 command at the end.
2a. There are already tool change macro files, see https://duet3d.dozuki.com/Wiki/ConfiguringRepRapFirmwareCartesianPrinter#Section_Tool_change_files.
2b. The easiest way to get a macro called at layer change is to configure your slicer layer change script to execute e.g. M98 P"layer_change.g".
-
M0: Stop or Unconditional stop
Parameters
This command can be used without any additional parameters. Hnnn Keep heaters on
Example
M0
The firmware finishes any moves left in its buffer, then it executes the macro file cancel.g if present, if the axes are homed and if a print is being cancelled. Otherwise stop.g is run before all motors are put into idle mode. If no H1 parameter is present, the heaters are turned off too. See also M1, M112.*****
What if I don’t want to call cancel.g?
And do not want to turn off stepper motors?2a, 2b - tfree1.g, tpre1.g and tpost1.g are called only 1 time at the time of the change.
The idea is to call a macro after a specified time after the event. -
@anidal said in macros wishlist:
What if I don’t want to call cancel.g?
And do not want to turn off stepper motors?File cancel.g is only called (instead of stop.g) if M0 is issued while the print is paused.
M0 does not turn off the stepper motors. The stepper motors will go into idle hold automatically (i.e. still powered but at reduced current) after 30 seconds of inactivity.
-
- Ок, I try to test M0 function.
2a,2b - Is there any hope?
- Ок, I try to test M0 function.
-
@anidal said in macros wishlist:
2a, 2b - tfree1.g, tpre1.g and tpost1.g are called only 1 time at the time of the change.
The idea is to call a macro after a specified time after the event.Do you mean that a certain time after a tool change occurred, the print would be interrupted and a macro executed?
-
Yes, the current print (after the completion of the next movement) is interrupted, the macro is executed and the print continues.
As if in the existing print code manually would insert a few more lines. -
There is a nuance with the movement of the filament, if the macro will execute extrusion / retract commands. I do not have enough knowledge to offer the best solution to this problem.
-
If I understand correctly, you want to call macro a certain time after a tool change event.
Have you looked at the G4 pause command? It does of course mean that the machine would sit idle during the pause but you could use that in tool change macro.
Or do you want to be able to have a macro called automatically some time after an event while continuing other tasks in the mean time? Effectively acting as a timed interrupt? This of course would be very problematic because there could be serious consequences depending on what processes were running at the time of the interrupt.
Edit. It would probably be better if you explain exactly what it is that you want to achieve.
-
@deckingman said in macros wishlist:
Or do you want to be able to have a macro called automatically some time after an event while continuing other tasks in the mean time? Effectively acting as a timed interrupt? This of course would be very problematic because there could be serious consequences depending on what processes were running at the time of the interrupt.
Edit. It would probably be better if you explain exactly what it is that you want to achieve.Automatically, of course. You can manually insert the code in any editor, but the whole essence of 3d printing is in automation.
I do not see a problem in the macro call. If a macro call is simply inserted into a ready-made g-code, is it called without problems?
The motion queue is important, and it is clear that the macro will not be called at exactly 10,000 seconds.A typical macro that I would like to call is 3-4 movement commands in absolute coordinates, to the nozzle cleaning device of excess plastic, and, possibly, the retract command for the active nozzle, to avoid plastic loss at the time of cleaning.
-
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
-
@anidal said in macros wishlist:
Automatically, of course. You can manually insert the code in any editor, but the whole essence of 3d printing is in automation.......................
Sorry but I didn't expect to get into an argument when I simply asked a question. Best of luck............
-
@dc42 said in macros wishlist:
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
Layer change and tool change can be separated by minutes. And the macro call will be late.
-
@deckingman said in macros wishlist:
Sorry but I didn't expect to get into an argument when I simply asked a question.
What a dispute, a detailed answer to the question - does not mean a dispute.
-
@anidal said in macros wishlist:
@dc42 said in macros wishlist:
That would be possible to do. But wouldn't if be better to synchronise it to e.g. a layer change? If the print is interrupted in the middle of printing a curved outer perimeter, then it's likely that a small blemish would result.
Layer change and tool change can be separated by minutes. And the macro call will be late.
Why is it particularly after a tool change (but not immediately after) that you want to do the nozzle cleaning? If you need to prime and clean the nozzle, that can be done in the tpost file. If you want to clean the nozzle at intervals, that can be done in the layer change script - unless you want to do it more often than that.
-
@anidal said in macros wishlist:
Ок, I try to test M0 function.
@dc42 said in macros wishlist:
File cancel.g is only called (instead of stop.g) if M0 is issued while the print is paused.
Good day!
I checked the behavior of the M0 function and the macro stop.g
At a regular print end, stop.g is called if it exists. The behavior is correct.
But now when you stop printing, the same stop.g is also called! this behavior is completely wrong.
Event completion of printing and manual stop are 2 different events.
If you manually stop the printer, you do not need to turn off the printer, and upon completion of printing it may be required.Please add a macro end.g to finish printing.
-
To stop a print manually, use Pause then Cancel.
-
@dc42 said in macros wishlist:
To stop a print manually, use Pause then Cancel.
yes,i do it and stop.g engaged! Not a cancel.g! it is mistake, i think.
-
Can you confirm that cancel.g exists?
-
-
@phaedrux said in macros wishlist:
Can you confirm that cancel.g exists?
if cancel.g exist - run cancel.g
if cancel.g not exsist - run stop.gIs it any docymentation about this hidden behavior?