-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN does not work #23003
Comments
The tool_change(tool_index
#if HAS_MULTI_EXTRUDER
, TERN(PARKING_EXTRUDER, false, tool_index == active_extruder) // For PARKING_EXTRUDER motion is decided in tool_change()
|| parser.boolval('S')
#endif
); Breaking this down, for The new option only affects calls to So then, what is the difference in To go further in the analysis, it would be helpful to know your |
Thank you @thinkyhead for your explanations. The head of my printer uses a single motor with a change between T0 and T1 by a pendulum driven by 2 motors ("I" and "J") : #define EVENT_GCODE_TOOLCHANGE_T0 "G28 J \ n" The use of 2 motors with G28, makes it possible to ensure a physical positioning of the head rather than 1 motor using G28 in one direction and a displacement length in the other. It is a prevention for a possible step loss. Examples: I tested the Extra G-code without G-code, and the problems disappeared. EVENT_GCODE_TOOLCHANGE_T0 and T1 are very useful (thanks to DerAndere1), but the fact that it is dependent on homing reduce the possibilities and may be the cause of this problem. In the future, the ideal for this function would perhaps be to approach what Repetier V2 offers. |
In that case, you can probably fix the issue by changing to valid G-codes:
Note, that the word to reference an axis corresponds to |
#define AXIS4_NAME 'A' and #define AXIS5_NAME 'B' are well identified. |
The malfunction comes from a loop created with G28. To confirm the origin, I tested this: Is it possible to put an index for not activat "EVENT_GCODE_TOOLCHANGE_T0" and "EVENT_GCODE_TOOLCHANGE_T1" during G28 homing? |
All this is potentially unsafe and untested. but you can try something like this: Marlin/Marlin/src/gcode/calibrate/G28.cpp Line 315 in de6dfc9
change that to: #if defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1)
// don't change tool during processing of EVENT_GCODE_TOOLCHANGE_T[0,1] to prevent busy loop
if (!processing_event_gcode_toolchange) tool_change(0, true);
#else
tool_change(0, true);
#endif Marlin/Marlin/src/gcode/calibrate/G28.cpp Line 493 in de6dfc9
Change that to: #if defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1)
if (!processing_event_gcode_toolchange)
tool_change(old_tool_index, TERN(PARKING_EXTRUDER, !pe_final_change_must_unpark, DISABLED(DUAL_X_CARRIAGE)));
#else
tool_change(old_tool_index, TERN(PARKING_EXTRUDER, !pe_final_change_must_unpark, DISABLED(DUAL_X_CARRIAGE))); // Do move if one of these
#endif In https://github.com/MarlinFirmware/Marlin/blob/bugfix-2.0.x/Marlin/src/module/tool_change.h#L55 #if (defined(EVENT_GCODE_TOOLCHANGE_T0) || defined(EVENT_GCODE_TOOLCHANGE_T1)) && HAS_MULTI_HOTEND
bool processing_event_gcode_toolchange = false;
#endif Marlin/Marlin/src/module/tool_change.cpp Lines 1311 to 1319 in de6dfc9
change that to: #ifdef EVENT_GCODE_TOOLCHANGE_T0
if (new_tool == 0) {
#if HAS_MULTI_HOTEND
processing_event_gcode_toolchange = true;
#endif
gcode.process_subcommands_now(F(EVENT_GCODE_TOOLCHANGE_T0));
#if HAS_MULTI_HOTEND
processing_event_gcode_toolchange = false;
#endif
}
#endif
#ifdef EVENT_GCODE_TOOLCHANGE_T1
if (new_tool == 1) {
#if HAS_MULTI_HOTEND
processing_event_gcode_toolchange = true;
#endif
gcode.process_subcommands_now(F(EVENT_GCODE_TOOLCHANGE_T1));
#if HAS_MULTI_HOTEND
processing_event_gcode_toolchange = false;
#endif
}
#endif |
Thanks for your proposition.
There is still an error that I cannot cancel: Tentatively, I made a change that seems to work. In G28.cpp Line 22 Change of state of the variable at the start of the block Change of state of the variable at the end of the block In tool_change.cpp Line 1309 addition of Line 1312 Line 1317 I have applied this index in other blocks of G28.cpp in order to possibly secure other configurations. |
oops. I edited my above suggestion to at least add some mising Marlin/Marlin/src/gcode/calibrate/G28.cpp Line 315 in 4dd1f09
as it tries to temporarily change to tool 0. but this call to tool_chage(0,true) will fail to move your toolchanger: That is because Extra_var is still 1, thus the required EVENT_GCODE_TOOLCHANGE_T0 is not executed during this attemted toolchange.
|
Did you test the latest
bugfix-2.0.x
code?Yes, and the problem still exists.
Bug Description
When the line "#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN" is activated, the T0 and T1 commands cause the printer to be reset or the printer freeze (printer busy).
When the line is deactivated, the extra G-code works as before (only after homing).
Bug Timeline
10/19/22
Expected behavior
Be able to use the additional G code to be executed with tool change commands T0 and T1 all time. Even if the homing is not done.
Actual behavior
No response
Steps to Reproduce
Enable #define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN
Version of Marlin Firmware
2000902
Printer model
No response
Electronics
No response
Add-ons
No response
Bed Leveling
No response
Your Slicer
No response
Host Software
No response
Additional information & file uploads
No response
The text was updated successfully, but these errors were encountered: