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

Feature Request: Replacing Extruder G-Code Commands with Pump On/Off #848

Open
jtemple3 opened this issue Dec 6, 2012 · 15 comments
Open
Assignees
Labels
Feature request This is an idea for a new feature in Slic3r Fixed with PR available to merge There is an update to address this issue in an open pull request. Needs testing
Milestone

Comments

@jtemple3
Copy link

jtemple3 commented Dec 6, 2012

I am building a 3D printer that uses a pressurized pump instead of a stepper extruder to print material. Consequently I have no need of the fourth-axis A G-Code commands as there is no filament nor stepper-based extruder. Instead I need a switch-like on/off command when the printhead is either printing or moving to a new location. Basically I just need to turn the pump on and off. I would like to use the M7 and M8 commands (traditionally for the coolant pump) within the G-Code to control this, but I'm not sure where or how to begin modifying Slic3r (or any other useful slicing program) to output M7/M8 instead of the stepper commands on the A axis. Basically this is what the final G-Code code should look like:

M7 (turns pump on)
(X and Y movements for perimeter and infill until 1st layer is finished)
M8 (turns pump off)
(Printhead moves to new location for the start for 2nd layer)
M7 (pump on)
(2nd layer)

etc.

Any ideas?

@thecrazy
Copy link

thecrazy commented Dec 6, 2012

What about disabling retraction and hooking up a mosfet (or a relay type of
thing) on the signal comming in for the extruder stepper?
Wouldnt this give you the on and off signal you need?

On Thu, Dec 6, 2012 at 11:37 AM, jtemple3 notifications@github.com wrote:

I am building a 3D printer that uses a pressurized pump instead of a
stepper extruder to print material. Consequently I have no need of the
fourth-axis A G-Code commands as there is no filament nor stepper-based
extruder. Instead I need a switch-like on/off command when the printhead is
either printing or moving to a new location. Basically I just need to turn
the pump on and off. I would like to use the M7 and M8 commands
(traditionally for the coolant pump) within the G-Code to control this, but
I'm not sure where or how to begin modifying Slic3r (or any other useful
slicing program) to output M7/M8 instead of the stepper commands on the A
axis. Basically this is what the final G-Code code should look like:

M7 (turns pump on)
(X and Y movements for perimeter and infill until 1st layer is finished)
M8 (turns pump off)
(Printhead moves to new location for the start for 2nd layer)
M7 (pump on)
(2nd layer)

etc.

Any ideas?


Reply to this email directly or view it on GitHubhttps://github.com//issues/848.

@jtemple3
Copy link
Author

jtemple3 commented Dec 6, 2012

I forgot to mention this is a hybrid CNC mill/3D printer. The mill is being used for XYZ translation while the pump controls an attached printhead. So all of the G-Code is being run through Mach3 and to the mill, consequently there is no extruder stepper. The reason I want to use the coolant commands is that there is a relay on the mill breakout board that normally controls a coolant pump. I would like to wire the pump to this relay so it switches on and off when it receives M7/M8 from Mach3.

@nophead
Copy link

nophead commented Dec 6, 2012

Probably not good saying it here, but Skeinforge can do what you want. It
uses M101 and M103 but it also has a replace facility so I think you could
replace those with M7/M8.

I use M101 and M103 rather than E values.

On 6 December 2012 18:24, jtemple3 notifications@github.com wrote:

I forgot to mention this is a hybrid CNC mill/3D printer. The mill is
being used for XYZ translation while the pump controls an attached
printhead. So all of the G-Code is being run through Mach3 and to the mill,
consequently there is no extruder stepper. The reason I want to use the
coolant commands is that there is a relay on the mill breakout board that
normally controls a coolant pump. I would like to wire the pump to this
relay so it switches on and off when it receives M7/M8 from Mach3.


Reply to this email directly or view it on GitHubhttps://github.com//issues/848#issuecomment-11097366.

@mesheldrake
Copy link
Collaborator

I use a fourth axis stepper signal on my router for a pen attachment, for pen up / pen down commands, where I have the relay switched off the direction signal of the stepper driver. Pen down is something like G1 A 1.0 and pen up is G1 A-1.0. Doesn't matter if I keep running A in either direction, since I'm only counting on the direction signal.

Maybe Slic3r's fourth axis extrude/retract codes will map well enough to your pump situation if you only use the direction signal, and ignore the step signals (assuming your breakout board has a fourth axis). You might even be able to map the direction signal to the pump signal pin in Mach, if that works better with your board and wiring setup.

You might also look at the post processing scripts here for ways to convert G codes that start or retract the extruder to the M codes you want.

@jtemple3
Copy link
Author

jtemple3 commented Dec 7, 2012

In this case I don't think post processing will work because there's an extrusion command on every single line. I just need on/off before and after the z retract. We use our 4th axis for other things so I would rather not mess with it.

I'll take a look at skeinforge, but let me know if anyone else has ideas. I need to be able to do 0-perimeter prints with 90 deg rectilinear infills which I only know how to do in Slic3r... so I would prefer to do this in Slic3r.

Thanks!

@mesheldrake
Copy link
Collaborator

In a post processing script I was thinking you would just watch the state of the E commands line by line - when they switch from positive to negative (retraction) or negative to positive insert your M7/M8 commands, and otherwise just strip the E commands values off of every line.

@jtemple3
Copy link
Author

jtemple3 commented Dec 8, 2012

Okay that makes sense. Sound difficult to code though, any ideas?

@mesheldrake
Copy link
Collaborator

I agree with @nophead that Skeinforge is a good option here, because your on/off pump situation is pretty much like controlling a constant rate DC motor extruder - which Skeinforge supports - and the simple on/off commands are already there to be converted to M7/M8 with a simple config file.

Slic3r is built around variable controlled flow, not just on/off, so downgrading to on/off behavior maybe isn't a feature to be added - but as I've suggested, it's probably not too hard to make it work with a post-processing script.

Either way, it sounds like you're going to have to put some time in to figure out how to adapt either application's output to your specific hardware.

@alranel
Copy link
Member

alranel commented Dec 31, 2012

This is quite easy to code with a post-processing script. I might write one in the near future.

By the way, wouldn't you use M9 for turning pump off?

@jtemple3
Copy link
Author

Yes my mistake, you would use M9 to turn off the pump. It would be great if we could figure out how to write a script for Slic3r, as Skeinforge refuses to let me print with no perimeter. I'm not very familiar with the post processing scripts but I can look into it.

@jtemple3
Copy link
Author

Has any progress been made on this?

On Mon, Dec 31, 2012 at 11:46 AM, Alessandro Ranellucci <
notifications@github.com> wrote:

This is quite easy to code with a post-processing script. I might write
one in the near future.

By the way, wouldn't you use M9 for turning pump off?


Reply to this email directly or view it on GitHubhttps://github.com//issues/848#issuecomment-11780141.

@lordofhyphens
Copy link
Member

Change GCodeWriter.cpp (particularly extrude_to_xy) and GCode.cpp's _extrude function to do what you want (actually, probably better to write it based on a switch for the Gcode flavor).

@lordofhyphens lordofhyphens self-assigned this Mar 3, 2017
@lordofhyphens lordofhyphens added Feature request This is an idea for a new feature in Slic3r Fixed with PR available to merge There is an update to address this issue in an open pull request. Needs testing labels Mar 3, 2017
@lordofhyphens lordofhyphens added this to the 1.3.1 milestone Mar 3, 2017
@lordofhyphens
Copy link
Member

https://bintray.com/lordofhyphens/Slic3r/Slic3r_Branches should have a test implementation for this when it gets off of the build server, branch name custom-constant-extrusion

I've added a switch in the Extruders options, along with a couple gcode entry text boxes to use whatever command you want.

Currently, the user is assumed to be able to match the flow rate from their weird extruder to the print speed.

A possible refinement would be to override print speed with advanced knowledge of the flow rate instead.

@lordofhyphens
Copy link
Member

Alternative solution that issues the start/stop gcode for an entire move block (instead each arc): constant-extruder-fewer-pumps

It will also be on the bintray link above when the build completes.

@lordofhyphens
Copy link
Member

Hey @jtemple3 I know it's been a long while, but would you be able to take a look at these two possible implementations to your feature request?

Is it better to turn the extrusion on/off at the beginning of each line/arc, or before/after a loop (a collection of print moves)?

https://bintray.com/lordofhyphens/Slic3r/Slic3r_Branches/1.3.0-constant-extruder-fewer-pumps-385
https://bintray.com/lordofhyphens/Slic3r/Slic3r_Branches/1.3.0-custom-constant-extrusion-384

@lordofhyphens lordofhyphens modified the milestones: 1.3.1, 1.3.2 Jan 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request This is an idea for a new feature in Slic3r Fixed with PR available to merge There is an update to address this issue in an open pull request. Needs testing
Projects
None yet
Development

No branches or pull requests

6 participants