prusa3d / PrusaSlicer

G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
https://www.prusa3d.com/prusaslicer/
GNU Affero General Public License v3.0
7.8k stars 1.94k forks source link

[Feature Request] Ultimaker 3 support #1672

Open Salamandar opened 5 years ago

Salamandar commented 5 years ago

I have an Ultimaker 3 & Ultimaker 3 Extended at work, and we're currently using Cura to slice + send the file. I'm trying to use Slic3r, but it's kinda difficult, and some modifications are needed for a perfect compatibility.

What's needed : (probably not exhaustive for now)

I don't really know the source code of Slic3r, but I'm ready to get my hands dirty if i'm not alone on this ;)

Salamandar commented 5 years ago

Here is the full Cura/Ultimaker header (with wipe tower and useless things). It's fully documented here : https://community.ultimaker.com/topic/15555-inside-the-ultimaker-3-day-1-gcode/ I tried to put this in the "custom gcode/Start G-Code", but it seems the printer is waiting for it at the very beginning of the file… A simple manual post-edit of the file corrects this.

;START_OF_HEADER
;HEADER_VERSION:0.1
;FLAVOR:Griffin
;GENERATOR.NAME:Cura_SteamEngine
;GENERATOR.VERSION:3.6.0
;GENERATOR.BUILD_DATE:2018-11-12
;TARGET_MACHINE.NAME:Ultimaker 3 Extended
;EXTRUDER_TRAIN.0.INITIAL_TEMPERATURE:205
;EXTRUDER_TRAIN.0.MATERIAL.VOLUME_USED:11130
;EXTRUDER_TRAIN.0.MATERIAL.GUID:506c9f0d-e3aa-4bd4-b2d2-23e2425b1aa9
;EXTRUDER_TRAIN.0.NOZZLE.DIAMETER:0.4
;EXTRUDER_TRAIN.0.NOZZLE.NAME:AA 0.4
;BUILD_PLATE.TYPE:glass
;BUILD_PLATE.INITIAL_TEMPERATURE:60
;PRINT.TIME:7983
;PRINT.SIZE.MIN.X:9
;PRINT.SIZE.MIN.Y:6
;PRINT.SIZE.MIN.Z:0.27
;PRINT.SIZE.MAX.X:146.314
;PRINT.SIZE.MAX.Y:126.056
;PRINT.SIZE.MAX.Z:47.97
;END_OF_HEADER
;Generated with Cura_SteamEngine 3.6.0
T0
M82 ;absolute extrusion mode

G92 E0
M109 S205
G0 F15000 X9 Y6 Z2
G280
G1 F1500 E-6.5
;LAYER_COUNT:320
;LAYER:0
M107
M204 S625
M205 X6 Y6
;MESH:3DBenchy.stl
G0 F3750 X125.327 Y111.545 Z0.27
M204 S500
M205 X5 Y5
;TYPE:WALL-INNER
bubnikv commented 5 years ago

As far as I understand it, to get your Ultimaker printer to print, you likely just need to create the print/filament/printer profiles and set the correct start/end G-code, right?

Ability to put in the header relevant infos such as dimensions, duration, volume needed.

Is this necessary for the Ultimaker to print?

We may do some very minimal changes initially to make Slic3r work with Ultimaker, but if extensive changes are needed, we would leave it to the community.

Salamandar commented 5 years ago

As far as I understand it, to get your Ultimaker printer to print, you likely just need to create the print/filament/printer profiles and set the correct start/end G-code, right?

Not only. The start GCode puts the header after the Slic3r header, but Ultimaker needs it before. And there is the network file sending.

The other issues are likely to be fixed with custom settings/gcodes, yes.

Ability to put in the header relevant infos such as dimensions, duration, volume needed.

Is this necessary for the Ultimaker to print?

No, it's completely optional. But without it, the time estimation displayed on the screen is completely false.

We may do some very minimal changes initially to make Slic3r work with Ultimaker, but if extensive changes are needed, we would leave it to the community.

Would the header issue be fixed by a new GCode flavour ?

bubnikv commented 5 years ago

Would the header issue be fixed by a new GCode flavour ?

That is an implementation option. I know the "Gremlin" G-code flavor was derived from Marlin, so adding a "Gremlin" G-code flavor may make sense.

On Wed, Jan 16, 2019 at 2:17 PM Salamandar notifications@github.com wrote:

As far as I understand it, to get your Ultimaker printer to print, you likely just need to create the print/filament/printer profiles and set the correct start/end G-code, right?

Not only. The start GCode puts the header after the Slic3r header, but Ultimaker needs it before.

Ability to put in the header relevant infos such as dimensions, duration, volume needed.

Is this necessary for the Ultimaker to print?

No, it's completely optional. But without it, the time estimation displayed on the screen is completely false.

We may do some very minimal changes initially to make Slic3r work with Ultimaker, but if extensive changes are needed, we would leave it to the community.

Would the header issue be fixed by a new GCode flavour ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/prusa3d/Slic3r/issues/1672#issuecomment-454775264, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj5I13MPfu9zPPfuUWXFrF-AHrh0sLvks5vDyZfgaJpZM4aC97U .

capi92 commented 4 years ago

As far as I understand it, to get your Ultimaker printer to print, you likely just need to create the print/filament/printer profiles and set the correct start/end G-code, right?

Not only. The start GCode puts the header after the Slic3r header, but Ultimaker needs it before.

This could be achieved via post processing script.

Salamandar commented 4 years ago

That's actually what I did, but that's not an amazing solution ;)

ansonl commented 7 months ago

I added the Ultimaker S3 compatible profile at https://github.com/prusa3d/PrusaSlicer-settings/pull/245. There are some limitations that I discussed here: https://ansonliu.com/2024/04/ultimaker-s3-s5-s7-prusaslicer-profile/

Does this solve pat of the issue?

Salamandar commented 7 months ago

Unfortunately I don't have access to an Ultimaker anymore, so I can't really test that :( I guess that until someone else have an issue, you can close it.

wrencrt commented 7 months ago

Works for me with a slightly modified start gcode and dimensions, however on both my UM3E and my S5 remaining time does not work with @ansonl's profile. Additionally, the gcode needs to be postprocessed, and purge towers do not work (as the ultimaker line does not support relative extrusion.

Prints do look good, although perhaps some special handling of color changes needs to be done, as with the default settings there is a lot of stringing on the first couple layers. Maybe a 'print this object first' command in the slicing step would be ideal as a band-aid, so we can make custom purge towers.

ansonl commented 6 months ago

@wrennnnnn Ultimaker S-line seems to use the estimated print time in the Griffin gcode header and Prusaslicer does not have access to the estimated print time when adding the start gcode so that is why the remaining time might not work.

wrencrt commented 6 months ago

@ansonl ahh, in that case i will simply add it to my postprocess gcode, thank you!

Attached is the postprocessing gcode i've made. All it requires is the default filename, and it converts (messily) the days (if present), hours, and minutes in the SLIC3R_PP_OUTPUT_NAME environment variable to a delta time format, then to an integer, then to a string (to remove trailing zeros.), and also removes the first line (as it will not print with it) It also only searches for a remaining time of 0, for futureproofing. ultimakerpython.zip

import os
import sys
import re
import datetime as dt
from shutil import move
from tempfile import NamedTemporaryFile
path = sys.argv[1] # get the path to temp file passed by prusaslicer
remtime = re.sub(r'^(.*ULTIMAKERSline_)(.*).gcode', r'\g<2>',os.environ.get('SLIC3R_PP_OUTPUT_NAME', 'none'))
# parse the default filename format for the total time in [days]d[hours]h[minutes]minutes format
modremtime = re.split(r'[dhm]', remtime)
# set modremtime to a list with 3 items, in order d m s
modremtime[:] = [x for x in modremtime if x] # remove empty list items
if len(modremtime == 1:
  remtime = dt.datetime.strptime(remtime, "%Mm") - dt.datetime(1900,1,1)
# does the list have one item (only minutes in filename)? if so, parse and subtract to get a deltatime object

elif len(modremtime) == 2:
  remtime = dt.datetime.strptime(remtime, "%Hh%Mm") - dt.datetime(1900,1,1)
# does the list have two items(hours and minutes)? if so, parse and subtract to get a deltatime object

elif len(modremtime) == 3:
  remtime = dt.datetime.strptime(remtime, "%dd%Hh%Mm") - dt.datetime(1900,1,1)
# does the list have three items(days, hours, minutes)? if so, parse and subtract to get a deltatime object

remtime = int(remtime.total_seconds())
# convert to integer to drop trailing zeros
file_path = path
temp_path = None
with open(file_path, 'r') as f_in:

    with NamedTemporaryFile(mode='w', delete=False) as f_out:
        temp_path = f_out.name
        next(f_in)  # skip first line, it contains stuff we don't want
        for line in f_in:
            line = re.sub(r';PRINT.TIME:0', ';PRINT.TIME:' + str(remtime), line) 
        # check for the print time remaining part in the header. there's probably a cleaner way of doing this
            f_out.write(line)
os.remove(file_path)
move(temp_path, file_path)
robinkruyt commented 6 months ago

I’ve tried using this profile with an original Ultimaker 3. The printer accepts the sliced model fine (after changing the bed size) but when printing almost no filament seems to be extruded. What should be tweaked to correct that?

ansonl commented 6 months ago

Is the printer the S3? I'm not sure if the 3 and S3 are on different firmwares. You should check if the generate gcode is in absolute or relative E position mode. Ultimaker firmware only supports absolute extrusion.

robinkruyt commented 6 months ago

No it is the Ultimaker 3, without S. I’ve checked and can confirm it was sliced with absolute E positions.

wrencrt commented 6 months ago

@robinkruyt works fine on my um3 extended, are you sure it's not a hardware issue? the extruders on the UM line are not very well-regarded.

robinkruyt commented 6 months ago

Hmm. While I agree with you, it does print fine when sliced with Cura instead.