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

Mixing and Switching Extruders #4163

Merged
merged 3 commits into from
Jul 17, 2016

Conversation

thinkyhead
Copy link
Member

@thinkyhead thinkyhead commented Jun 28, 2016

Combined #3655 Mixing Extruder and #3994 Switching Extruder. [concise diff].

Mixing Extruder

Most of the email I receive about Marlin concerns this feature. So here is the implementation built on top of the current RCBugFix for those interested parties.

  • New feature option MIXING_EXTRUDER_FEATURE
  • Support for M163, M164 as in Repetier Host
  • Additional command M165 to set the mix in one line
  • Optional support for ABCDHI mixing parameters in G1 commands (reference implementation)

Concise diff: https://github.com/MarlinFirmware/Marlin/pull/3655/files?w=1

Switching Extruder

As requested by Peter Stoneham.

This PR adds support for an extruder with:

  • A single stepper motor
  • Two nozzles
  • Two pinch-wheels, either side of the drive-gear
  • A servo to switch the pinch-wheel
  • Reversed stepper direction for T1

As with other funky extruders, this maintains a single E axis at the stepper level. The E stepper direction is reversed automagically —transparently at the stepper level— whenever the tool changes.

@thinkyhead thinkyhead added Needs: Testing Testing is needed for this change PR: New Feature labels Jun 28, 2016
@emartinez167
Copy link
Contributor

emartinez167 commented Jun 28, 2016

Brilliant! This would also apply to the E3D-MAX that is collecting dust in my lab!

@thinkyhead thinkyhead force-pushed the rc_new_extruders_diff branch 3 times, most recently from f40c00b to 17a21ac Compare June 28, 2016 23:19
@thinkyhead
Copy link
Member Author

thinkyhead commented Jun 29, 2016

@emartinez167 And this sure could use the testing to gain some confidence. It would be nice to have this included, if only as experimental code, in the new release, because there's an increasing demand.

@thinkyhead thinkyhead force-pushed the rc_new_extruders_diff branch 6 times, most recently from 6c8c981 to 033f750 Compare July 2, 2016 03:52
@thinkyhead thinkyhead force-pushed the rc_new_extruders_diff branch 4 times, most recently from ed44b8c to c47ebc7 Compare July 7, 2016 01:26
@thinkyhead thinkyhead force-pushed the rc_new_extruders_diff branch 2 times, most recently from 4445cd9 to 399c0c7 Compare July 13, 2016 03:12
@thinkyhead thinkyhead force-pushed the rc_new_extruders_diff branch 2 times, most recently from 5a8e669 to c8e6152 Compare July 17, 2016 17:22
@thinkyhead
Copy link
Member Author

I'm merging this PR with the features disabled, as this includes some helpful improvements, beginning with separation of the E_STEPPERS from EXTRUDERS (similar to how SINGLENOZZLE separated HOTENDS from EXTRUDERS). This PR makes sense to include now (before renaming many feedrate variables). The code that these features augments have been stable for a while. Specifically, the stepper-indirection macros, Stepper class, and the ADVANCE and LIN_ADVANCE handling.

I'm not sure if the ADVANCE handling is exactly right for the mixing extruder. It "feels right" but needs more testing. At the stepper level, the switching extruder is a lot simpler.

@thinkyhead thinkyhead merged commit f8973a7 into MarlinFirmware:RCBugFix Jul 17, 2016
@thinkyhead thinkyhead deleted the rc_new_extruders_diff branch July 17, 2016 18:05
thinkyhead added a commit that referenced this pull request Jul 18, 2016
Follow-up the PR #4163 (Mixing and Switching Extruders)
@thinkyhead thinkyhead mentioned this pull request Jul 25, 2016
CONSULitAS pushed a commit to CONSULitAS/Marlin-K8200 that referenced this pull request Aug 18, 2016
@lavato
Copy link

lavato commented Sep 1, 2016

Can somebody help me out on following:

  • where can I connect the servo on RAMPS?
  • what is SWITCHING_EXTRUDER_SERVO_NR 0 used for?

Also, can more angles be added to SWITCHING_EXTRUDER_SERVO_ANGLES for e.g. T2...?

@thinkyhead
Copy link
Member Author

thinkyhead commented Sep 2, 2016

where can I connect the servo on RAMPS?

Try one of the plugs labeled "Servos." Google for the RAMPS schematic if you're not sure where they are.

what is SWITCHING_EXTRUDER_SERVO_NR 0 used for?

SWITCHING_EXTRUDER_SERVO_NR is the index of the servo that you're using to switch the idler orientation on your fancy new switching extruder.

can more angles be added to SWITCHING_EXTRUDER_SERVO_ANGLES

Your switching extruder sure is fancy! But seriously, no. These extruders only have two states, either driving the left filament, or driving the right filament. The E stepper also switches direction based on which side of the drive gear is being used to push the filament.

@lavato
Copy link

lavato commented Sep 2, 2016

@thinkyhead Thank you!

Huh, let's wait and see if the "fancy" new extruder will work - as it is still just in my head,
I just started the project and will probably have to modify Marlin to support the feature, which I will share once I see it working.

If it is reasonable, I will raise a PR for it to be reviewed aldough I am still far from this, possibly a month or so, and my CPP is rusty.

@thinkyhead
Copy link
Member Author

No better way to polish up your cpp than picking a project and going for it!

@rjbalsi
Copy link

rjbalsi commented Feb 18, 2017

Hi - I'm having issues with mixing extruder enabled (M163,M164 commands don't seem to work) - raised issue #5853 to document.

G1 A1 E10 works but other commands do not....

@rjbalsi
Copy link

rjbalsi commented Mar 6, 2017

T0, T1, T2 don't work either...

@guysoft
Copy link

guysoft commented Mar 25, 2017

Is there a way to make it so T1 and T2 are interpreted as:

M163 S0 P1
M163 S1 P0
M164 S0

And

M163 S0 P0
M163 S1 P1
M164 S0

That would be super helpful, otherwise its needed to search and replace each gcode uploaded to the printer.
I can modify the CPP, but pointing me in the right direction would help a lot!

@thinkyhead
Copy link
Member Author

@guysoft MIXING_VIRTUAL_TOOLS

/**
 * "Mixing Extruder"
 *   - Adds a new code, M165, to set the current mix factors.
 *   - Extends the stepping routines to move multiple steppers in proportion to the mix.
 *   - Optional support for Repetier Host M163, M164, and virtual extruder.
 *   - This implementation supports only a single extruder.
 *   - Enable DIRECT_MIXING_IN_G1 for Pia Taubert's reference implementation
 */
//#define MIXING_EXTRUDER
#if ENABLED(MIXING_EXTRUDER)
  #define MIXING_STEPPERS 2        // Number of steppers in your mixing extruder
  #define MIXING_VIRTUAL_TOOLS 16  // Use the Virtual Tool method with M163 and M164
  //#define DIRECT_MIXING_IN_G1    // Allow ABCDHI mix factors in G1 movement commands
#endif

You use M163 to set the channel values, then you use M164 to store the channel values as a virtual tool. For example, M164 S0 sets the color mix to use when you issue T0 and M164 S1 sets the mix that will be used when you issue T1.

@guysoft
Copy link

guysoft commented Apr 24, 2017

@thinkyhead I think you just solved another mystery with this, I just got now

Recv: Error:MAXTEMP triggered, system stopped! Heater_ID: 0
Changing monitoring state from 'Printing' to 'Error: MAXTEMP triggered, system stopped! Heater_ID: 0\x0a'
Recv: Error:Printer halted. kill() called!```

I was wondering  how ``Heater_ID: 0\x0a'`` got there, its 16!

@thinkyhead
Copy link
Member Author

thinkyhead commented Apr 26, 2017

@guysoft The "Changing monitoring state" message comes from your host software. The string "0\x0a" represents the single character 0 —which is correct— followed by a hexadecimal representation of the newline character (10 decimal, \x0A hex). The host software should ignore that character instead of including it in its "monitoring state." But it probably does no harm.

So that may be a valid MAXTEMP error. Do you get that error consistently?

drewmoseley pushed a commit to drewmoseley/Marlin that referenced this pull request Nov 8, 2023
Fix issue where Tx gcode doesnt reset custom_message_type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants