mirror of
https://github.com/workinghard/mmuGcodeParser.git
synced 2025-12-14 06:32:08 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 682790922d | |||
| bfc0b7a800 | |||
|
|
45140c1ed3 | ||
|
|
ced093a634 | ||
|
|
0e5377f857 | ||
|
|
007b20e0dc |
@@ -4,6 +4,10 @@ Improves Slic3r gcode for better MMU handling and allows true Multi Material pri
|
||||
If you're using Prusa MMU1/MMU2 and Slic3r 1.41 you will encounter an issue if the temperature differ between the used materials.
|
||||
Slic3r sets the new temperature between toolchanges only once after cooling and before unloading. This causing an issue in the transition from high temp filament to cold because it is being purged with cold temperature.
|
||||
|
||||
# Changelog
|
||||
* v0.2 Set ram_temp_diff_wait_for_stabilize = True to drop the temperature even for same type of filament. Thanks @membrein
|
||||
* v0.1 Initial upload
|
||||
|
||||
## Table of contents
|
||||
* [Installation](#installation)
|
||||
* [Linux/Mac](#linux/Mac)
|
||||
@@ -76,4 +80,4 @@ This is a first release and a proof of concept. I've printed the test object wit
|
||||
I'm currently using it for any multi material prints as it helps as soon as you use filament with different temperature requirements.
|
||||
Once the process is refined, it will be implemented in Slic3r so no additional post processing is required.
|
||||
|
||||
For further discussions please use this official [Prusa forum thread](https://sourceforge.net/projects/linuxconsole/)
|
||||
For further discussions please use this official [Prusa forum thread](https://forum.prusaprinters.org/forum/original-prusa-i3-mmu2s-mmu2-general-discussion-announcements-and-releases/mmu2-real-multi-material/)
|
||||
|
||||
@@ -32,9 +32,10 @@ from io import open
|
||||
""" ---------------------------------------------------------------------
|
||||
### Constants
|
||||
"""
|
||||
VERSION = "v0.1"
|
||||
VERSION = "v0.2"
|
||||
MYGCODEMARK = " ; MMUGCODEPARSER " + VERSION
|
||||
UNLOAD_START_LINE = "unloadStartLine"
|
||||
LOAD_START_LINE = "loadStartLine"
|
||||
DEST_TEMP_LINE = "destTempLine"
|
||||
DEST_TEMP = "destTemp"
|
||||
UNLOAD_LINE = "unloadLine"
|
||||
@@ -52,6 +53,8 @@ debug_set = False
|
||||
|
||||
# Drop the temperature by 10C during the ramming process. Checking if it might help
|
||||
ram_temp_diff = 10
|
||||
# Set this to True if you want to drop the temperature even for the same filament
|
||||
ram_temp_diff_wait_for_stabilize = False
|
||||
|
||||
# get the input file specified, and turn it into a path variable for the current OS
|
||||
inpath = sys.argv[1]
|
||||
@@ -72,8 +75,9 @@ unloading = r"^T[0-9]?"
|
||||
purge = r"^; CP TOOLCHANGE WIPE"
|
||||
# 3. Print
|
||||
printLine = r"^; CP TOOLCHANGE END"
|
||||
# 4. Before unload
|
||||
# 4. Before unload/load
|
||||
beforeUnload = r"^; CP TOOLCHANGE UNLOAD"
|
||||
beforeLoad = r"^; CP TOOLCHANGE LOAD"
|
||||
# 5. Target temperature
|
||||
targetTemp = r"^M104 S([0-9]*)"
|
||||
|
||||
@@ -86,6 +90,7 @@ purge_detect = re.compile(purge)
|
||||
print_detect = re.compile(printLine)
|
||||
unloading_detect = re.compile(unloading)
|
||||
before_unload_detect = re.compile(beforeUnload)
|
||||
before_load_detect = re.compile(beforeLoad)
|
||||
target_temp_detect = re.compile(targetTemp)
|
||||
|
||||
|
||||
@@ -208,9 +213,22 @@ def none_handler(p_tool_change, p_line_number):
|
||||
if ram_temp_diff > 0: # Only if set
|
||||
# Add temp drop for better tip
|
||||
lv_lower_temp = int(p_tool_change[CURR_TEMP]) - ram_temp_diff
|
||||
lv_output = "M104 S" + str(lv_lower_temp)
|
||||
if ram_temp_diff_wait_for_stabilize:
|
||||
# wait for stable nozzle temp
|
||||
lv_output = "M109 S" + str(lv_lower_temp)
|
||||
else:
|
||||
# set nozzle temp without wait
|
||||
lv_output = "M104 S" + str(lv_lower_temp)
|
||||
lv_insert = 1 # after the line
|
||||
|
||||
if p_tool_change[p_line_number] == LOAD_START_LINE:
|
||||
if ram_temp_diff > 0: # Only if set
|
||||
lv_restore_temp = int(p_tool_change[CURR_TEMP])
|
||||
# don't wait for stable nozzle temperature
|
||||
# (enough time for nozzle to reach correct temp)
|
||||
lv_output = "M104 S" + str(lv_restore_temp)
|
||||
lv_insert = 1
|
||||
|
||||
if p_tool_change[p_line_number] == DEST_TEMP_LINE:
|
||||
# nothing to do
|
||||
pass
|
||||
@@ -261,14 +279,21 @@ for line in infile:
|
||||
# create dictionary entry
|
||||
myToolChanges[toolChangeID] = myToolChange
|
||||
|
||||
# Search for the 'before loading' position
|
||||
# Search for the 'before unloading' position
|
||||
before_unload_match = before_unload_detect.search(line)
|
||||
if before_unload_match is not None:
|
||||
if len(myToolChanges) > 0: # we found at least the start tool change
|
||||
# remember the line number
|
||||
myToolChanges[toolChangeID][line_number] = UNLOAD_START_LINE
|
||||
|
||||
# Search for the target temperature
|
||||
# Search for the 'before loading' position
|
||||
before_load_match = before_load_detect.search(line)
|
||||
if before_load_match is not None:
|
||||
if len(myToolChanges) > 0: # we found at least the start tool change
|
||||
# remember the line number
|
||||
myToolChanges[toolChangeID][line_number] = LOAD_START_LINE
|
||||
|
||||
# Search for the target temperature
|
||||
targetTemp_match = target_temp_detect.search(line)
|
||||
if targetTemp_match is not None:
|
||||
if len(myToolChanges) > 0: # we found at least the start tool change
|
||||
@@ -322,7 +347,7 @@ for toolChange in myToolChanges:
|
||||
else:
|
||||
print("Key is missing")
|
||||
print(myToolChanges[toolChange])
|
||||
"""
|
||||
"""
|
||||
|
||||
""" -------------------------
|
||||
### Determine the transitions
|
||||
|
||||
BIN
mmuGcodeParser_windows_20190405_with_dropTemp.zip
Normal file
BIN
mmuGcodeParser_windows_20190405_with_dropTemp.zip
Normal file
Binary file not shown.
Reference in New Issue
Block a user