barebone version
Dual X Carriage custom Sigma-style printer. Movement - in every mode - ok (T1 start scenario in duplication mode aside). But when it comes to duplicate Extruder(E0)-motor movements in M605 S2 mode it fails to do that. // _means: T0 extrude, T1 not_
latest bugfix-1.1.x (8)
DUAL EXTRUDER / EXTRUDERS = 2
DUAL_X_CARRIAGE
LIN_ADVANCE
_Maybe good to mention:_
DISTINCT_E_FACTORS
No LCD defined (using "independent" one; MKS TFT)
Motors (Extr.) on... "Set extruder_duplication_enabled / Clear active_extruder_parked" as the print starts... There seems to be a problem where the signals _should be_ split off. I dont pretend i know whats exactly going on regarding #_APPLY_STEP / #_WRITE_STEP / #_STEP_WRITE (stepper.h/.cpp) but over time there have been numerous recoding on this. Broken there?
As I initiated the procedure with T1 active (T1 -> M605 S2 -> G28 -> ...) it was the other way around (besides obviously no movements x-wise ) T1 extruded, T0 not. Something's fishy down there.
On the other side and noobish as I am, I question myself why the duplication of the extruders is not coded like the X/X2 in stepper.cpp (if I understand the code correctly)?
why the duplication of the extruders is not coded like the X/X2 in
stepper.cpp?
Duplication is handled as part of stepper_indirection.h.
. . .
#elif EXTRUDERS > 1
#if ENABLED(DUAL_X_CARRIAGE) || ENABLED(DUAL_NOZZLE_DUPLICATION_MODE)
#define E_STEP_WRITE(v) { if (extruder_duplication_enabled) { E0_STEP_WRITE(v); E1_STEP_WRITE(v); } else if (current_block->active_extruder == 0) { E0_STEP_WRITE(v); } else { E1_STEP_WRITE(v); } }
#define NORM_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(!INVERT_E0_DIR); E1_DIR_WRITE(!INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(!INVERT_E0_DIR); } else { E1_DIR_WRITE(!INVERT_E1_DIR); } }
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
#else
. . .
Thats what I linked above the question ;)
Oh yeah! So, you can see, the logic is as basic as it gets.
So, it appears that you have to do M605 S2 before you un-park the extruder. Otherwise extruder_duplication_enabled is never set to true.
Sequence:
T0
G21
G90
G92 E0
M605 S2
G28
M140 S{temperature_heatbed}
M104 T0 S{temperature_extruder1}
M109 T0 S{temperature_extruder1}
M190 S{temperature_heatbed}
<------- here the unparking(=extruder_duplication_enabled=true) of T1 occurs / moving to offset
M82
M107
G1 F{travel_xy_speed}
M117 Printing..
it's not these particular (basic) logic that's presumably flawed, I question how it's handled in stepper.h/.cpp given
As I initiated the procedure with T1 active (T1 -> M605 S2 -> G28 -> ...) it was the other way around (besides obviously no movements x-wise ) T1 extruded, T0 not. Something's fishy down there.
Hmm, I'm not very familiar with Dual X Carriage, so thanks for pointing out how it behaves w/r/t parking and un-parking the extruder. I see from the code that G28 parks the active extruder, and it gets un-parked when the next G-move command is received.
It also appears that G28 resets the active extruder to 0.
It also appears that G28 resets the active extruder to 0.
i can't agree on that. Just tested it - again
Right. I see now, afterward there's a call to tool_change(old_tool_index, ...).
Try adding logging wherever you find these (where relevant to dual-x):
dual_x_carriage_unpark
extruder_duplication_enabled = ...
active_extruder = ...
active_extruder_parked = ...
In other words, the regex:
(dual_x_carriage_unpark|extruder_duplication_enabled = |active_extruder(_parked)? = )
I'm not sure the existing logging provided by DEBUG_LEVELING_FEATURE + M111 S247 will give enough detail, but you should try that first too.
The issue sounds like extruder_duplication_enabled is getting cleared someplace.
Just for kicks, also set MINIMUM_STEPPER_PULSE to 1 or 2 and re-flash.
Just for kicks, also set MINIMUM_STEPPER_PULSE to 1 or 2 and re-flash.
ok, i'll try that first. The logging method may take a while
Also, you might as well ZIP up your Configuration.h and Configuration_adv.h files and drop them into your next reply. We'll check them over (in the morning - yawn!) and see if anything is amiss.
Some weird compiling error occured as I set MINIMUM_STEPPER_PULSE to 1
with exit status 1
'i' was not declared in this scope
if EXTRA_CYCLES_E > 20
if (i) while (EXTRA_CYCLES_E > (uint32_t)(TCNT0 - pulse_start) * (INT0_PRESCALER)) { /* nada */ } #elif EXTRA_CYCLES_E > 0 if (i) DELAY_NOPS(EXTRA_CYCLES_E); #endif
Re-download bugfix-1.1.x or just change remove if (i) to .if (e_steps)
Not kicked. Changing MINIMUM_STEPPER_PULSE to 1 doesn't do the trick
Well, it was good to eliminate the possibility of too short stepper pulses. So, next step is to get detailed logging and see what's really going on.
In the meantime i've flashed a fresh bufix version, so that we are on the same page. I did a couple of extended logging runs, but ultimately no big surprises here.
Extended M111 Serial Communication (Pastebin) Just duplication flag logging (Pastebin)
_first: logging relevant funtions/loops // second: logging in process_next_command()_
But (out of my perspective) with those two logs its safe to say that the duplication flag is set properly for further processing
_EDIT: Looking at the code, without the duplication flag set true there would be no x duplication in the first place_
And the Config files you asked for Conifgs.zip
Would some M503 help?
Although i see nothing too special, the host serial communication at startup (pastebin)
The only thing that tickles me is the combination of VOLUMETRIC:1, Filament settings: Disabled, M200 D0 and being somewhat triggered by #1378 / #2490 (very dusty)
I know i'm grasping straws on this:
I'm with a fairly uncommon (i think) component setup. MKS Base (Drivers onboard), but X and Y is driven by stepsticks (TMC2130) hooked over a extension board (Stepper Expander) to EXP1 (like AUX-2 Ramps) and using the MISO/MOSI/SCK on EXP 2 (l. AUX-3). (fairly "common" wiring)
X2 using the standard X onboard driver socket. The Y onboard driver socket is therefor uncrowded. E0/E1 plugged in as usual.
Though i've tested this with the second Extruder wired to the Y-socket while tweaking pins_RAMPS.h in that regard with no positive outcome, it may somewhat meaningful to mention.
(I've kept something in mind like "The next extruder is using the next open socket" -which would be the Y in my case - or something like that)
Maybe some folks who read this and are using Dual_X + Duplication mode and got it working can comment if they using this "out of the box" or what they've done to accomplish this. (wiring experiments, as i said, are no viable option to me)
After trying freaking everything i got it running.
It appears to not working with LIN_ADVANCE (1.5) defined. (if i recall it correct it wasn't running either with prior LIN_ADVANCE _off_). <----- Thats why i ruled out this potential. So i set this issue to
_M605 S2 - DXC_DUPLICATION_MODE - Second extruder not extruding in LIN_ADVANCE mode_
Most likely because LIN_ADVANCE uses at least partialy own macros. This Macro-wrapped-in-marcro style for doing all the step things is like enigma for me, maybe @thinkyhead is faster, else I will see what I can do in the next days.
I'll take a look at LIN_ADVANCE now and make any needed changes so it's ok with duplication.
Ok, I've patched up LIN_ADVANCE so it handles duplication mode. Will merge the changes shortly.
@thinkyhead Had some compiling error after replacing stepper.cpp stepper.h with the new ones and enabling LIN_ADVANCE
In file included from C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.h:48:0,
from C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:48:
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp: In static member function 'static void Stepper::advance_isr()':
stepper_indirection.h:480: error: expected primary-expression before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper_indirection.h:480: error: expected ':' before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper_indirection.h:480: error: expected primary-expression before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected primary-expression before ':' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
In file included from C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.h:48:0,
from C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:48:
stepper_indirection.h:480: error: expected primary-expression before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper_indirection.h:480: error: expected ':' before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper_indirection.h:480: error: expected primary-expression before '{' token
#define REV_E_DIR() { if (extruder_duplication_enabled) { E0_DIR_WRITE(INVERT_E0_DIR); E1_DIR_WRITE(INVERT_E1_DIR); } else if (current_block->active_extruder == 0) { E0_DIR_WRITE(INVERT_E0_DIR); } else { E1_DIR_WRITE(INVERT_E1_DIR); } }
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:790:70: note: in expansion of macro 'REV_E_DIR'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected primary-expression before ':' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { e_steps < 0 ? REV_E_DIR() : NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_498070\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
Bibliothek TMC2130Stepper in Version 2.1.5 im Ordner: C:\Users\Swen.WorkGameLaptop\Documents\Arduino\libraries\TMC2130Stepper wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\Swen.WorkGameLaptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI wird verwendet
exit status 1
expected primary-expression before '{' token
Patched… hopefully! Please test the latest code.
hate to write it but compiling problems remain
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp: In static member function 'static void Stepper::advance_isr()':
stepper.cpp:790: error: expected '}' before 'else'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected 'while' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected '(' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected primary-expression before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected ')' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:790: error: expected ';' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:824:15: note: in expansion of macro 'SET_E_STEP_DIR'
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:824: error: break statement not within loop or switch
case 0: SET_E_STEP_DIR(0); break;
^
stepper.cpp:826: error: case label '1' not within a switch statement
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected '}' before 'else'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected 'while' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected '(' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected primary-expression before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected ')' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:790: error: expected ';' before '}' token
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp: At global scope:
stepper.cpp:790: error: expected unqualified-id before 'while'
#define SET_E_STEP_DIR(INDEX) do{ if (e_steps) { if (e_steps < 0) REV_E_DIR(); else NORM_E_DIR(); } }while(0)
^
C:\Users\SWEN~1.WOR\AppData\Local\Temp\arduino_build_769710\sketch\stepper.cpp:826:17: note: in expansion of macro 'SET_E_STEP_DIR'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:826: error: expected unqualified-id before 'break'
case 1: SET_E_STEP_DIR(1); break;
^
stepper.cpp:837: error: expected declaration before '}' token
}
^
Bibliothek TMC2130Stepper in Version 2.1.5 im Ordner: C:\Users\Swen.WorkGameLaptop\Documents\Arduino\libraries\TMC2130Stepper wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\Swen.WorkGameLaptop\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\libraries\SPI wird verwendet
exit status 1
expected '}' before 'else'
Ah, thanks for the follow-up. This is now patched in the bugfix branches. Some of the stepper_indirection macros — such as REV_E_DIR— needed to be wrapped in do{ ... }while(0) so they can be used in if statements.
Most helpful comment
Most likely because LIN_ADVANCE uses at least partialy own macros. This Macro-wrapped-in-marcro style for doing all the step things is like enigma for me, maybe @thinkyhead is faster, else I will see what I can do in the next days.