Skip to content
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

Dual Nozzles, Dual Steppers, Servo actuated T1 #5921

Closed
Tahutipai opened this issue Feb 27, 2017 · 12 comments
Closed

Dual Nozzles, Dual Steppers, Servo actuated T1 #5921

Tahutipai opened this issue Feb 27, 2017 · 12 comments

Comments

@Tahutipai
Copy link

Tahutipai commented Feb 27, 2017

(have searched thoroughly but can not yet find how to do this)

This printer is custom, One printhead/carriage, Dual Extruders/Hotends, Dual Bowden Stepper Motors (one for each filament). E1 (second) extruder is servo-actuated, to raise/lower it above/below the height of E0, so a Z-Offset will also be required.

I am seeking guidance on how to implement Dual Hotends/Dual Drivers/E1 Servo Actuated in Marlin - is this configuration already supported?

I note this configuration is almost, but not quite, the same as SWITCHING_EXTRUDER - in that a servo must be actuated to switch the hotend in both, but SWITCHING_EXTRUDER assumes a single direct-drive stepper motor - not two independent Bowden stepper motors. So it appears SWITCHING_EXTRUDER is very close to what I need, but not quite?

I also see that #definine EXTRUDERS 2 allows only for X & Y offsets only. AFAICT I need to enable SWITCHING_EXTRUDER to enable HOTEND_OFFSET_Z, but then I lose my second extruder stepper by doing so? Seems a catch 22?

Question: How to implement a dual extruder/dual bowden with servo-actuation?
The following is a best guess at my options. Any pointers/confirmation of direction appreciated...
a) It is already supported in Marlin, to implement it, I need to...
OR
b) Use SWITCHING_EXTRUDER, as it already supports servo control & Z-Offset, and I will need to change to make it support dual stepper bowden drivers
OR
c) just #define EXTRUDERS 2, and alter in Marlin_main.cpp to add servo activation and Z-offset support.
OR
d) Something else entirely.

Appreciate any pointers/guidance.

@christianh17
Copy link
Contributor

christianh17 commented Feb 28, 2017

Hi!

Intersting, I have almost the same problem. My extruder does not move up and down but the extruder is tilted by 18° via a servo so there is only one of them in contact to the printed material. I am still not totally happy with my configuration so I am interested in your solution. Can I find your extruder on thingiverse? For now my printer works with manual turning the servo and using both extruders. I wanted to have a look at the configuration next weekend and always assumed it would be no problem to do a configuration to support this setting. But you are right it does not seem to be as easy as I thoguht.

To answer your question:
I would try at the first step to change in stepper_indirection.h

/**
 * Extruder indirection for the single E axis
 */
#if ENABLED(SWITCHING_EXTRUDER)
  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
  #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ?  INVERT_E0_DIR : !INVERT_E0_DIR)
  #define  REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR :  INVERT_E0_DIR)

the #if ENABLED... statement to e.g.

/**
 * Extruder indirection for the single E axis
 */
#if ENABLED(SWITCHING_EXTRUDER_IGNOREME)
  #define E_STEP_WRITE(v) E0_STEP_WRITE(v)
  #define NORM_E_DIR() E0_DIR_WRITE(current_block->active_extruder ?  INVERT_E0_DIR : !INVERT_E0_DIR)
  #define  REV_E_DIR() E0_DIR_WRITE(current_block->active_extruder ? !INVERT_E0_DIR :  INVERT_E0_DIR)

define SWITCHING_EXTRUDER in config.h.

This should bring back both extruder steppers. Unfortunately I will not be at home till Friday so I cannot test it. If it works I would try to do a PR, it is always nicer to be close to the original. But of course this is a lot more work...
Kind regards
Christian

PS: Edit - In my first version I suggested to comment the lines out but this woul not work.

@Tahutipai
Copy link
Author

Great, thanks for the tip! I'll test & experiment and let you know...

Unfortunately I do not have this print head on thingiverse. I can offer you a brief description though if that helps? Along the power and control cable channel housing to the print head, also have a bike brake cable in bike cable housing, so a servo (mounted on the housing) can pull the cable and lower/raise the secondary extruder as required. (The secondary extruder is spring-mounted). Feel free to pm me with any questions. Cheers.

@Tahutipai Tahutipai changed the title Dual Extruder, Secondary Extruder: Servo Actuated, Dual Bowden Steppers Dual Nozzles, Dual Steppers, Servo actuated (aka 'switching_extruder' but steppers=nozzles) Feb 28, 2017
@thinkyhead
Copy link
Member

thinkyhead commented Mar 1, 2017

Reposting from the other topic… This would be in every way just like the standard EXTRUDERS 2 except there will be a servo actuation on tool-change. Everything else that EXTRUDERS 2 alone does will also apply here.

To get the HOTEND_OFFSET_Z working we can just add a standard condition to include it (so it can be enabled for special cases), then have it enabled by those features that require it.

The same goes for extruders with servos. As that is becoming more common, we should add a standard option to include a servo move on tool-change, and, again, automatically set it for those models that we know have one.

@Tahutipai
Copy link
Author

Thanks Scott, understand more now, greatly appreciate the pointers.

Agreed, going forward having the ability to set a servo (and thus also a Z Offset) for each extruder sounds great, and extensible. As my printer is currently of this configuration, but looking to extend to 4 extruders in the next few months, I will see what I can do here as my understanding of the code improves. (Marlin appears "not small", is taking me a little time to grok). I note (on many occasions) and appreciate the way you invite people to contribute.

--

Additionally, as I see it at present, SWITCHING_EXTRUDER is for all purposes identical to "dual hotends, secondary hotend servo actuated. Identical in that both benefit from:

  • Automatic servo actuation-on-tool-change
  • Hotend Z Offset.

The only difference being: SWITCHING_EXTRUDER has the new code (#3994) to use a single stepper, and to reverse stepper direction on-tool-change.

So, as I am currently viewing it, there are two cases of SWITCHING_EXTRUDER:

  1. SWITCHING_EXTRUDER (with one stepper per each hotend)
  2. SWITCHING_EXTRUDER_WITH_SINGLE_STEPPER

If my understanding above is correct, does that mean I should be able to, for now, given time constraints, simply use SWITCHING_EXTRUDER and add an additional #define within e.g #define SWITCHING_EXTRUDER_WITH_SINGLE_STEPPER`, and simply use that #define to enable/disable the new "single reversing stepper" code?

Does that seem like a reasonable immediate solution?

@Tahutipai
Copy link
Author

Tahutipai commented Mar 2, 2017

Thanks very much for the help gents. With you pointers, I got it up and running today pretty fast. @christianh17 I'll provide what I did for refererence, it isn't pretty or ideal, but it works for now. (no manual servo turning, z_offset etc)

Summary: SWITCHING_EXTRUDER (S_E) does exactly what we require, except we also require one-stepper-per-extruder, as per normal. e. I.e simplified can just treat this extruder as a "subclass of SWITCHING_EXTRUDER

Configuration.h:

#define EXTRUDERS 2
#define SWITCHING_EXTRUDER
#if ENABLED(SWITCHING_EXTRUDER)  
  ...
  #define SWITCHING_EXTRUDER_WITH_MULTIPLE_STEPPERS
#endif
# NUM_SERVOS 1

At the bottom of ConditionalsLCD.h (strange place for this code? why not conditionalspost.h?)

    #if ENABLED(SWITCHING_EXTRUDER_WITH_MULTIPLE_STEPPERS)
    #undef HOTENDS
    #undef E_STEPPERS
    #undef E_MANUAL
    #undef TOOL_E_INDEX
    #define HOTENDS      EXTRUDERS
    #define E_STEPPERS   EXTRUDERS
    #define E_MANUAL     EXTRUDERS
    #define TOOL_E_INDEX current_block->active_extruder
  #endif
#endif //CONDITIONALS_LCD_H

Note: I realise the above is not efficient, but it provided an effective quick and fast way for me to "just add code to the end" for testing, rather than interspersing my testing code within Marlin code - I would save that work for a PR)

indirection.h (changed just the one line you suggested, thanks!)

#if ENABLED(SWITCHING_EXTRUDER) && (!ENABLED(SWITCHING_EXTRUDER_WITH_MULTIPLE_STEPPERS))
  #define E_STEP_WRITE(v)..........

Thats it! Works like a charm. Obv. I wouldn't do it this way for a PR, I'm not a great coder, but it works for now.

For anyone else looking at this: You can tune the X/Y/Z offsets on the fly with: M218. E.g for E1: "M218 T1 X50 Z-2
To "tool change", i.e to test if the extruder servo is activating and the head is moving to the new offset, simply enter "T1" or "T0"

@Tahutipai
Copy link
Author

Tahutipai commented Mar 2, 2017

One caveat: (noting that, when in use, E1 is of course lower than E0)

When switching from E0 to E1, the sequence currently is:

  1. Raise by Z_Offset
  2. Lower Nozzle E1
  3. Move by XY_Offset

Likewise the opposite (E1/T1 to E0/T0) is:

  1. Raise Nozzle E1
  2. Lower Z
  3. Move XY

This would seem to be a non-ideal ordering? That is to say, because the X/Y move is done last, this increases the chances of a print head collision into the material.

It would seem to make more sense to: raise the Z axis (lower the build plate), then move into the correct XY position, and then, as a final step, move the Z axis back into position?

@Tahutipai Tahutipai changed the title Dual Nozzles, Dual Steppers, Servo actuated (aka 'switching_extruder' but steppers=nozzles) Dual Nozzles, Dual Steppers, Servo actuated T1 Mar 2, 2017
@christianh17
Copy link
Contributor

Today I had time to do the changes MrJulz suggested: It works in my setting, too! Perfect!
I am glad you were some days before me so as soon as I needed a solution it was there.

Only problem: I have some problems getting the height correct. I tested so much but in the meantime I think the printer has its own ideas, sometimes it works and sometimes not. The z-probe is highly reliable, I tested it with M48. I am still trying to investigate the problem.

@Tahutipai
Copy link
Author

The printing height of either/both nozzles is giving your problems, or just the printing height of the second nozzle E1?

@christianh17
Copy link
Contributor

Hi! I just spent severl hours with this issue and I think I know the problem now. As it has not much to do with SWITCHING_EXTRUDER_WITH_MULTIPLE_STEPPERS I will open a new issue (just now). BTW: I am still interested in knowing more about your extruder but unfortunately there is no pm at github.

@thinkyhead
Copy link
Member

When switching from E0 to E1, the sequence…

@MrJulz I've submitted a fix that fixes the ordering so the Z lowering is last, and it happens to also solve the wrong-z-after-toolchange issue at the same time. 421468a

@Tahutipai
Copy link
Author

That is great news, gratitude to you.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants