Welcome! Log In Create A New Profile

Advanced

Marlin Firmware help

Posted by 09zx-6r 
Marlin Firmware help
January 15, 2015 09:48PM
ok so im up and printing, everything works great... but i have questions for when the print is done,

1. the extruder turns off as it should, but the bed doesnt...is this normal ?
if not, how do i change marlin to turn it off after each print? <-- or is that something to do with the G-code in Slicer?

2. how do i get it to home itself after the print and in X, Z, Y order?

3. if i want to use a fan to cool the print when complete and bed (its the one in the back on the left of my mendel90), how do i get it to do so?

Edited 2 time(s). Last edit at 01/16/2015 12:36AM by 09zx-6r.
Re: Marlin Firmware help
January 16, 2015 03:18AM
All of these issues should be resolved in custom ending GCode. nophead provides them for Skeinforge but for other slicers you will need to provide something of your own.

You can use the Skeinforge example as a starting point or ask for a working solution. I have them for Slic3r and Cura if that helps.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Re: Marlin Firmware help
January 16, 2015 03:20AM
i need it for slic3r if u could help me, that would be great...
Re: Marlin Firmware help
January 16, 2015 05:18AM
Hi,

My Slic3r start and end GCode settings are actually the same as my Skeinforge ones.

Start G-Code:
M83 ; use relative distances for extrusion
G28 ; home
G1 X0 Y98 F9000 ; go to the middle of the front
G1 Z0.05 ; close to the bed
M104 S185 ; set extruder temp 
M190 S70 ; set bed temp & wait
M109 S185 ; wait for extruder temp
G92 E0
G1 X50 E5 F200 ; make a thick line to prime extruder
G1 E-0.5 F2400
G1 Z0.3 ; lift Z
I do not set initial temperatures within Slic3r because the start GCode prints a thick line which requires the extruder and bed temperatures to be already established. Edit the S185 and S70 to suit your requirements.

End G-Code:
M104 S0 ; turn off extruder
M140 S0 ; bed off
M106 S0 ; carriage fan off
G1 E-0.5 F2400 ; extra retract
G1 X-100 Y100 F9000 ; go to back
M42 P28 S255 ; bed fan on
G1 Z200 X-100 F9000 ; go to top
G4 P300000
M42 P28 S0 ; bed fan off
G1 Y-100 ; bed to front
M84 ; disable motors
This is the end GCode with cooling fan support. I use the, more or less, standard Output 28 but if your fan is controlled by another pin then change the P28 to suit whatever you use.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Re: Marlin Firmware help
January 16, 2015 05:32AM
Your the man...just what I needed.. thanks...
Re: Marlin Firmware help
January 16, 2015 11:17AM
You know you can use variables instead of absolute temperatures in your start Gcode?

This way you don't have to edit start Gcode every time you change filament, I just keep the same start Gcode, like this (for PLA):

M140 S[first_layer_bed_temperature] ; set bed temp and don't wait
G28 ; home all axes
G1 Z5 F5000 ; move z to 5mm
G1 X150 Y0 F4000 ; move 150mm along the front edge
G1 Z0 ; drop nozzle to prevent ooze
G4 P100 ; wait 0.1 seconds, heaters start after the pause
M109 S[first_layer_temperature] ; set extruder temp and wait
M190 S[first_layer_bed_temperature] ; set bed temp and wait
G1 Z[first_layer_height] ; move nozzle to print height
G1 X10 F12000 E7 ; Wipe (move toward origin as fast as firmware permits, extruding 7mm)


Tim

Printers:
Prusa i3 (plywood box frame)
RAMPS 1.4 and Arduino Mega

Mendel 90 (sturdy)
Smoothieware

My RepRap Blog
Re: Marlin Firmware help
January 16, 2015 11:30AM
@plankton I did not know that you can do variable substitution in Slic3r. I even looked through the online manual to see if it was possible but I guess that information is elsewhere.

My concern about doing variable substitutions is that they might introduce side-effects. Setting a temperature so that you can reference it in e.g. your start GCode might insert additional GCode to set the temperature for you which you might not want.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Re: Marlin Firmware help
January 16, 2015 11:50AM
nice plankton, but im wondering the same thing neil is...
Re: Marlin Firmware help
January 16, 2015 12:23PM
I've not had any problems with it, all Slic3r does is substitute the actual temperature required, for the variable name when it's slicing, so the resultant Gcode file looks identical to if you had specified a manual temperature (as in your example).

So for example, here's the Gcode header from a print I did a few days ago (using that start Gcode):

; generated by Slic3r 1.1.7 on 2015-01-12 at 12:02:06

; perimeters extrusion width = 0.36mm
; infill extrusion width = 0.70mm
; solid infill extrusion width = 0.70mm
; top infill extrusion width = 0.70mm

G21 ; set units to millimeters
M107 ; disable fan
M140 S81 ; set bed temp and don't wait
G28 ; home all axes
G1 Z5 F5000 ; move z to 5mm
G1 X150 Y0 F4000 ; move 150mm along the front edge
G1 Z0 ; drop nozzle to prevent ooze
G4 P100 ; wait 0.1 seconds, heaters start after the pause
M109 S190 ; set extruder temp and wait
M190 S81 ; set bed temp and wait
G1 Z0.35 ; move nozzle to print height
G1 X10 F12000 E7 ; Wipe (move toward origin as fast as firmware permits, extruding 7mm)

No, there's nothing about it in the manual, I think I must have seen it in someones sample Gcode online somewhere (but I can't remember where). You can do the same thing in Skeinforge, as I mentioned in a post a week or so ago (but the variable names are different).

It will be very simple to check if you're concerned, just slice a simple object using your normal code, then substitute your start Gcode line

M104 S185 ; set extruder temp

with the same command, using my variable:
M104 S[first_layer_temperature] ; set extruder temp

Then re-slice, and compare the resultant 2 Gcode files

Edited 1 time(s). Last edit at 01/16/2015 12:29PM by plankton.
Re: Marlin Firmware help
January 17, 2015 11:48AM
Hi Neil,

Quote
neildarlow
@plankton I did not know that you can do variable substitution in Slic3r. I even looked through the online manual to see if it was possible but I guess that information is elsewhere.

I found it in the online manual:

Quote

Start, End and Layer Chance G-codes.

Custom G-code commands can be run before a print starts and after a print finishes.

Placeholders can be inserted in the G-code commands2. For example [next_extruder] would return the index of the next extruder.

Look at the red 2 - it pointing to https://github.com/alexrj/Slic3r/wiki/FAQ#what-placeholders-can-i-use-in-custom-g-code


MfG / Regards

Stefan

Blog / Gallery / Wiki / Mendel90 kit since Sep 2013 from Nophead / Original Prusa I3 MK3 since Feb 2018 /
OpenScad Workshop: Kursdateien
Octoprint Patron since April 2016
Re: Marlin Firmware help
January 17, 2015 11:56AM
@bastard Thanks for that Stefan. The information was in a couple of places then (manual and FAQ). I'll remember that for future reference although I use Slic3r rarely.

I still use Skeinforge as my main slicer. The printrun suite (which includes Skeinforge) seems to be getting some attention recently so there might be some hope that will apply to Skeinforge also.


I try to write with consideration for all nationalities. Please let me know if something is unclear.
Printing with Mendel90 from fedora 25 using Cura, FreeCAD, MeshLab, OpenSCAD, Skeinforge and Slic3r tools.
Sorry, only registered users may post in this forum.

Click here to login