gcode to load filament

Post your prints with the GCode used to help other users achieve a similar result, or get help.
Post Reply
Penged
Printmaster!
Posts: 87
Joined: Sun Nov 29, 2015 5:30 am
Location: Alsip, Il

gcode to load filament

Post by Penged »

Howdy all,

I guess this is a 2 part question. The easy one is what G code would you use to have the filament feed itself down the bowden tube once the extruder motor engages with it. The second question is how do you learn how to write the macro for this sort of thing? Web sites, books, or other resources would be appreciated. The software side of life puzzles me to no end.
V2 max with the HE280 hotend
IMBoring25
Printmaster!
Posts: 616
Joined: Wed Mar 18, 2015 1:11 am

Re: gcode to load filament

Post by IMBoring25 »

It's pretty straightforward if you have the g-code reference, which is at http://reprap.org/wiki/G-code

The SeeMe machines use Repetier firmware, so that's the section of that reference you want to use.

For this, your primary command will be G1 with an E parameter of the length of your Bowden tube in mm and an optional F parameter of the desired extrusion speed in mm/min.

There are a few potential complications:

If the hot end is not up to temperature you may need to allow cold extrusion for the move (which is normally disallowed so you don't hit a cold hot-end and grind the filament in the extruder drive to dust). If you're running the latest firmware, that should be M302 S0 to allow cold extrusion and M302 S170 to disallow it again after the move.

If you are in absolute extrusion coordinates mode, you need to reset the extrusion axis before and after the move using G92 E0 or you may have unpredictable results.

Repetier has a maximum extrusion length parameter buried in the firmware to protect against wildly long extruder moves resulting from errors in absolute/relative mode selection. You may need to break the long move into several shorter ones to keep the firmware from ignoring the move.

You can get close automatically if you know the length of your Bowden tube. To be perfect, you really need to extrude a little extra and pull off the ooze. Without a purge canister like the commercial machines use that calls for some manual user intervention.
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5412
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: gcode to load filament

Post by mhackney »

My code for feeding filament:

10 M3000 Depress Extruder Lever
20 M3013 Push Filament By Hand Until It Reaches the Hot End
30 M3021 Push A Little Further To Purge Old Color
40 M3014 Stop Pushing To Equalize Pressure To Prevent Drool
50 M3001 Release Extruder Lever

Or something similar to that.

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
Penged
Printmaster!
Posts: 87
Joined: Sun Nov 29, 2015 5:30 am
Location: Alsip, Il

Re: gcode to load filament

Post by Penged »

So if my bowden tube was 600 mm long i'm guessing I would create a macro that is something like;

M302 S0 (cold extrusion min temp 0)
G1 E600 (linear move extrude 600 mm)
M302 S170 (cold extrusion min temp 170)

Ok so if I add M81 (turn off ATX power supply) to the end G code commands it should turn off the power supply when the print is finished correct? Or would M85( inactivity shut down timer) be a better option? This is in reference to a different question I asked in the build zone about turning off the light ring being powered by the HE280 board.
V2 max with the HE280 hotend
IMBoring25
Printmaster!
Posts: 616
Joined: Wed Mar 18, 2015 1:11 am

Re: gcode to load filament

Post by IMBoring25 »

I think I read http://forum.seemecnc.com/viewtopic.php?t=2713 as saying you have to wire your Rambo and PSU differently to get M81 to function. M85 is a different function. It sets the motors to power down after a specified period of inactivity. It doesn't touch the power supply.
Penged
Printmaster!
Posts: 87
Joined: Sun Nov 29, 2015 5:30 am
Location: Alsip, Il

Re: gcode to load filament

Post by Penged »

Mchackney, I'm guessing that you are insinuating I am making a mountain out of a molehill and your probably correct. :P
V2 max with the HE280 hotend
User avatar
mhackney
ULTIMATE 3D JEDI
Posts: 5412
Joined: Mon Mar 26, 2012 4:15 pm
Location: MA, USA
Contact:

Re: gcode to load filament

Post by mhackney »

yes :)

Sublime Layers - my blog on Musings and Experiments in 3D Printing Technology and Art

Start Here:
A Strategy for Successful (and Great) Prints

Strategies for Resolving Print Artifacts

The Eclectic Angler
W4YBO
Noob
Posts: 1
Joined: Sun Jun 18, 2017 9:32 am

Re: gcode to load filament

Post by W4YBO »

I built SeeMeCNC's Rostock Max v3 a few months ago, my first Bowden extruder printer. I had several filament changes in quick succession recently, and decided there had to be a better way. Pulling a meter of filament out of a Bowden tube isn't all that bad, but pushing the new filament is just a pain due to my printer's placement (Modern problems, huh? 10,000 years ago, I'd have been worried about being eaten.) Short story long, I wrote and tested filament load and filament unload gcode that seems to work well in MatterControl's macro buttons. Then I visited these forums, and saw IMBoring25's reply (beautiful explanation!)

I decided to heat the hotend in my script, instead of cold extruding, so the old filament will purge. Here's the filament load script...

M109 S220 ; extruder to 220 degrees
G1 Z:100.00 ; move hotend to 100 mm above bed (straighten out the tube, somewhat)
M82 ; set absolute mode (just in case)
G92 E0 ; set extruder to zero
G1 E850 F10000 ; feed 850 mm filament at 10,000 mm/min

If I feed the new color filament in far enough for it to appear in the Bowden tube, then run the script above, 100 mm of normal speed extrusion purges the hotend properly.

Well, loading is mostly automatic now, and I'm basically lazy, so why not unloading?

M109 S190 ; hotend to 190 (works okay with PLA. No thread pulling)
G1 Z:100.00 ; move hotend to 100 mm above the bed
M82 ; set absolute mode
G92 E0 ; set extruder to zero
G1 E-1000 F10000 ; extrude -1000 mm of filament

I can change filament colors in about thirty seconds now, since MatterControl's macros work during a pause in printing. Use Ctrl-C and Ctrl-V to copy and paste the scripts into MatterControl's macro editor, since it irritatingly disregards right-clicks.

W4YBO
Post Reply

Return to “GCode & Test Prints”