-
-
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
Unpark when using Z_SAFE_HOMING with Dual X #5175
Unpark when using Z_SAFE_HOMING with Dual X #5175
Conversation
abf87b3
to
236d87a
Compare
hy, @thinkyhead I can test this PR for you frequently for you,if that is of any use for you. |
@dp90pusika That would be of great help. Let's coordinate. I'm not sure of the full status of the related issues linked in the OP. |
Yes, sorry. But I hooked up a test bench to test the original 8 bit firmware. I have a dual X carriage machine and I'm also using dual Z steppers and dual Z endstops. The problem is with the DXC_AUTO_PARK_MODE and the DXC_DUPLICATION_MODE. The tool heads are behaving insanely, trying to park in the wrong direction, and traveling with speeds faster than the max feedrate. I have a somewhat more detailed description, and a video of the behavior in this issue: https://github.com/esenapaj/Marlin/issues/156 I'm not much use as a coder, but I really want to help out if I can. Right now I'm using this firmware: https://github.com/Wurstnase/Marlin4Due It seems to get the dual x carriage tool-changes and movements perfect, the only issue with it is, in duplication mode, the second extruder motor is disabled. A lot of definitions are really different from the current firmware, but maybe it can shine light on the problem. |
No kidding…
Wurstnase's branch diverged from Marlin around version 1.0.1. New issues have been introduced as we changed a lot of stuff in Marlin without enough testers checking every configuration. Dual X setups are rare enough that these things were missed. We could compare current Marlin to older Marlin, as well, where these issues also did not exist. But in some sense it is easier to go forward. One thing that can help is to comment the code in detail and make sure we understand why every line is there and what is should accomplish. |
A good start, I think, would be to compare all Dual X options using Thank you for taking action on this! @AndrewDiehl should join in on this effort as well. |
On it, I will do a detailed report in a day or so. |
(the jerking moves I mention is probably due to the 400step/revolution I use, the mega has its limitations I guess) RC6
RC7
RCBugFix
Marlin-rc_dualx_homing
|
As for the jerking… What are you using for your micro-steps? You probably are hitting limits if using 0.9° steppers with 16x or 32x micro-stepping. I've seen this also. The number of steps-per-second just goes too high for the 16MHz CPU to keep up. You will have to set your max speeds to something below where jerking begins to occur. If you want to use faster movement, you will have to reduce the number of micro-steps by moving the micro-stepping jumpers on your board. The steppers will resonate more, but you will be able to reach your desired speed. |
So, it sounds like everything works with this PR, except on tool-change (in auto-park mode) you see weird Z movements. I can work with that. |
planner.buffer_line( | ||
i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS], | ||
i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS], | ||
i == 2 ? current_position[Y_AXIS] : raised_parked_position[Z_AXIS], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dp90pusika Hmm… I wonder if this could be the problem. 😜 I seem to have a typo here!
i == 2 ? current_position[Y_AXIS] : raised_parked_position[Z_AXIS],
…should be…
i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS],
161a435
to
864639a
Compare
@dp90pusika OK! I patched the bug that was probably causing the Z axes to go nuts. Give my branch another test and (fingers crossed) it should be better than before. I'm especially glad to hear that duplication mode is fixed by this PR. |
864639a
to
05b4e2f
Compare
With the latest RCBugFix Auto Park Kind of Works!
Full Control Works!
|
@AndrewDiehl How about the branch https://github.com/thinkyhead/Marlin/tree/rc_dualx_homing ? (I haven't merged this PR into |
@thinkyhead for the rc_dualx_homing: Full control seems to be 100% working as desired. Autopark correctly respects Z max settings now, but otherwise has issues.
Copy mode appears to work perfectly. |
Under what circumstances? |
So, for example, if T0 is sitting near the left side before it parks, when T1 tries to move to where T0 used to be, it runs into the T0 carriage? |
Or… It tries to move in the wrong direction, to the right, and past the right endstop? |
@thinkyhead Whenever any move is issued.
If my X2_min is 50, and I issue a T0, G1 X3 (or any command less than 50) The T0 head will move to 50. Once at 50, issuing any G1 X command less than 50 has no effect.
|
Do you mean, if you issue a |
Or… It tries to move in the wrong direction, to the right, and past the right endstop?
It tries to move in the wrong direction past the right endstop.
|
@dp90pusika indicated that the tool change in AUTO_PARK mode was working properly for the most part in both |
Correct, just using T0 commands.
|
Merged because it's better than it was! If further changes are needed let me know and I will get them in as fast as I can. |
Everything is fine with S1 and S0, the coordinates match up. When using S0, after a toolchange the x positions are lining up. So if a tool change is issued the old tool head parks, and the new tool head only moves when it gets it's G1 X Y cordinates and moves to that position and starts printing. this is the correct way and this is what S1 is dooing, so it's perfectly fine okey. For S0 ther is probably some practical use, it is good to have an option in there.
None of these issues are deal breakers, the 2-3 test prints I made in autopark and duplication mode went through normally. These scenarios doesn't really come up in a normal g-code |
We'll have to continue to refine. There are a lot of "states" that Dual X depends on, and they are hard to keep track of. Your detailed notes are very helpful. |
Thank you but I feel like I could do better. You wont be happy about this, but As I understand, after the X2 went to the right position, it needs to invert X2_DIR_WRITE and it should be good. But this is a bit complex for me, I run into compiling problems with every try. |
mirroring mode... It might be useful. Oh, I've wanted a dual carriage machine very much for the first time. |
A startup contacted me asking if I could make them a machine, they want to print custom orthopedic shoe insoles. So with a mirroring mode they could print a pair in one go. So the idea comes from this. |
I see, mirror mode is indeed practical. |
With the developers fighting to save memory and performance in Marlin firmware, wouldn't mirror mode be a better feature for a slicer? I know Simplify3D has a mirror mode. |
You can't do a mirror mode in a slicer, as slicers have no way to
simultaneously control 2 separate heads. Must be done in firmware.
Also I second its usefulness.
|
I use simplify3d and know about the mirror function, but that is quite different from what we are talking about. |
Thank you for explaining the difference. |
That approach will work, once the X2 is positioned appropriately. But I think it would also make sense to do this at a higher level, like duplication mode. That way it's easier to keep track of the carriage positions.
NEVERMIND — WRONG CODE I presume it's a sub-option of
|
I will try it out, thanks. The only problem is that The finals are here and I really should study, but this is more interesting than my exams. :D |
Stay away from them. If they want to make orthopaedic soles and don't know about right and left foot are different - they will probably not have much success. |
They can't go all the way to the center or they'll collide. So I think we should add a new define — the minimum distance that must be maintained between the two tool-heads — then we can limit just how close to one another, and to the middle, they can go without colliding. Something like… #define DUAL_X_MIN_SAFE_DISTANCE 20 |
@Blue-Marlin |
I managed to squeeze out a mirroring run of my machine, but clearly I have no idea what I'm doing: It started fine but went wrong somewhere halfway, not sure if an unexpected g-code line or a communication error, or a power drop. (Those things happen here :/ )
and I set the #define DEFAULT_DUPLICATION_X_OFFSET to X2_MAX_POS I started the print in duplication mode and you can see on the video how it worked. In the stepper.cpp I can't get a choosing script implemented, to switch between duplication and mirror mode. Everything I try makes a compiler error, clearly I'm a noob. Can one of you guys help me please? |
@esenapaj almost okay I think
|
Like this? And about your code, #elif ENABLED(DUAL_NOZZLE_MIRROR_MODE)
#define X_APPLY_DIR(v,ALWAYS) \
if (extruder_mirror_enabled || ALWAYS) { \ // <--------- "extruder_mirror_enabled" doesn't exists, maybe it means "extruder_mirror_mode"?
X_DIR_WRITE(v); \
X2_DIR_WRITE(!v); \
} \ // <--------- At end of macro, "\" needs to be removed
#elif ENABLED(DUAL_X_CARRIAGE) |
This looks promising, successfully compiled this way.
you are right, that was a mistake from me. (had a warning in SanityCheck.h: |
Well, mirroring mode has compatibility with |
basically when I forced the printer to do the mirroring, I used DUAL_X_CARRIAGE in DXC_DUPLICATION_MODE DUAL_NOZZLE_DUPLICATION_MODE disabled <-- this is for conventional dual extruder machines, not used on a dualx carriage machine. |
Ah... maybe... If so, |
I've rewritten. But I've begun to care, is #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); } }
#if ENABLED(DXC_MIRROR_MODE)
#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
#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); } }
#endif
#else needed? |
@esenapaj Good point, |
I've rewritten and cleanup again. |
Sorry, meant to apply it to X2 direction, obviously. It was very late. |
Sorry about that, It wasn't related to part of the official Marlin. #define true 0x1
#define false 0x0 And, ENABLED() and DISABLED of Marlin are defined as follows in macros.h. // Macros to support option testing
#define _CAT(a, ...) a ## __VA_ARGS__
#define SWITCH_ENABLED_false 0
#define SWITCH_ENABLED_true 1
#define SWITCH_ENABLED_0 0
#define SWITCH_ENABLED_1 1
#define SWITCH_ENABLED_ 1
#define ENABLED(b) _CAT(SWITCH_ENABLED_, b)
#define DISABLED(b) (!_CAT(SWITCH_ENABLED_, b)) Then , List: Z_MIN_PROBE_ENDSTOP_INVERTING
DISABLE_X
DISABLE_Y
DISABLE_Z
DISABLE_E
DISABLE_INACTIVE_EXTRUDER
DISABLE_INACTIVE_X
DISABLE_INACTIVE_Y
DISABLE_INACTIVE_Z
DISABLE_INACTIVE_E But now it has been fixed. |
Addressing #5162
Since the first carriage moves with
Z_SAFE_HOMING
it shouldn't be considered parked afterward, otherwise the next move will try to "unpark" the nozzle and produce a very slow movement back to home position.Addressing #4694
Addressing #4695
tool_change