Re: Got rid of ringing/ghosting almost completely
Hi,
I tried to use your sript, but can not make it running. Can you help with the guideline?
I did install perl, added to system path and even associated the extension with (working in Windows).
If I run it directly from Windows, it works (just error about non initialized variable with filename apears).
If I add it to Slic3r, nothing happes. No change in g-code (just the filename of the script).
Thank you.
Milos.
Re: Got rid of ringing/ghosting almost completely
I tried to use your sript, but can not make it running. Can you help with the guideline?
I did install perl, added to system path and even associated the extension with (working in Windows).
If I run it directly from Windows, it works (just error about non initialized variable with filename apears).
If I add it to Slic3r, nothing happes. No change in g-code (just the filename of the script).
Hi Milos,
I am sorry for the late answer. I have been abroad for work for the last few days and it is hard to get a stable internet connection out here.
As to why it does not work in Windows... I am not sure because I have been using Linux exclusively for the last 15 years.
You should be able to start the script from a command line however and have it work on a gcode file you created with Slic3r. It should look something like this:
perl.exe deghost.pl Name_of_the_gcode_file.gcode
Then the script will create a new file called: Name_of_the_gcode_file.PMOD.gcode
I hope this helps.
Re: Got rid of ringing/ghosting almost completely
Hi,
thank you for answer.
I still did not make it running. The command prompt window shows and disapears in a second.
Tried also the script itself from windows command prompt providing just gcode file name as parametr, but it did not work well. I stopped after an hour. File was 3 GB. Only contained:
; generated by Slic3r Prusa Edition 1.41.0+win64 on 2018-09-30 at 21:18:55
18-09-30 at 21:18:55
018-09-30 at 21:18:55
The last line repated undefinitelly.
It seems, it does not like Windows.
I will try to debug, but no will now. Having another issue with extruder, which is now a bit more urgent 🙂
Milos.
Re: Got rid of ringing/ghosting almost completely
Ah, wait. I see it now. You must click enable "Verbose G-Code". My script uses the comments in the g-code to check if a move is a perimeter move. Without verbose g-code it does not work.
Re: Got rid of ringing/ghosting almost completely
That's reasonable, I have it on and mine's worked great.
I maintain an informal list of San Diego, CA 3D printing enthusiasts. PM me for details. If you include a contact email and I can add you to the informal mailing list.
Re: Got rid of ringing/ghosting almost completely
It's possible to run your perl script against G-Code generated by Cura or by Simplify3d ?
tks
Re: Got rid of ringing/ghosting almost completely
I did not make it running on Slic3r Prusa Edition 1.41.2+win64. "Verbose G-Code" is enabled
The File Only contained:
generated by Slic3r Prusa Edition 1.41.2+win64 on 2019-02-08 at 09:57:57
4 on 2019-02-08 at 09:57:57
n64 on 2019-02-08 at 09:57:57
The last line repated undefinitelly.
whats wrong ? 🙄
Re: Got rid of ringing/ghosting almost completely
I'm testing it out for myself and am having issues as well.
Prusa Slic3r apparently runs the post processing script, but there are no m205 or m400 instructions in the file.
Much less a renamed file.
Have i missed any dependencies for this?
Also, this is something that if functional, would be awesome to have integrated into Prusa Slic3r.
Re: Got rid of ringing/ghosting almost completely
Not sure if this relates to any of this but i changed a print and to a higher layer height to see what difference to print time was and see if it effected the print quality. What i noticed was no ghosting. all i did was change the layer height on a 0.2mm height setting to 0.3mm
Anyone know why the ghosting marks disappeared?
Re: Got rid of ringing/ghosting almost completely
Not sure if this relates to any of this but i changed a print and to a higher layer height to see what difference to print time was and see if it effected the print quality. What i noticed was no ghosting. all i did was change the layer height on a 0.2mm height setting to 0.3mm
Anyone know why the ghosting marks disappeared?
Since there are volumetric limits for the filament, moving from a 0.2mm layer to a 0.3mm layer is going to mean around 2x the amount of filament per unit area. For a completely round extrusion, it would be 2.25x. The means that to keep the flow of filament through the hot end at the same level, the printer moves the print head ~2x slower. Slowing down the print speed reduces ringing.
Re: Got rid of ringing/ghosting almost completely
Not sure if this relates to any of this but i changed a print and to a higher layer height to see what difference to print time was and see if it effected the print quality. What i noticed was no ghosting. all i did was change the layer height on a 0.2mm height setting to 0.3mm
Anyone know why the ghosting marks disappeared?
Since there are volumetric limits for the filament, moving from a 0.2mm layer to a 0.3mm layer is going to mean around 2x the amount of filament per unit area. For a completely round extrusion, it would be 2.25x. The means that to keep the flow of filament through the hot end at the same level, the printer moves the print head ~2x slower. Slowing down the print speed reduces ringing.
always with the maths…. 😀
I have a Prusa,therefore I research.
Re: Got rid of ringing/ghosting almost completely
Off the cuff, but not actually doing the experiment; simply changing the layer height from 0.2 to 0.3 should do nothing to the print speed - and the slicer will simply ask the extruder for more material.
Only when the preset volumetric flow limit is reached will the slicer actually slow the print speed; but that's 15 cubic mm per second on my Slic3r PE install. Printing at the default 45 mm/s at 0.15mm, perimeters are using 2.6 mm^3/s. At 0.3mm, perimeters are only using 4.8 mm^3/s. No where near the slow down point.
Re: Got rid of ringing/ghosting almost completely
Off the cuff, but not actually doing the experiment; simply changing the layer height from 0.2 to 0.3 should do nothing to the print speed - and the slicer will simply ask the extruder for more material.
Only when the preset volumetric flow limit is reached will the slicer actually slow the print speed; but that's 15 cubic mm per second on my Slic3r PE install. Printing at the default 45 mm/s at 0.15mm, perimeters are using 2.6 mm^3/s. At 0.3mm, perimeters are only using 4.8 mm^3/s. No where near the slow down point.
Hmmm. Correct your are. The stock speed settings are such that volumetric limits shouldn't come into play, at least for perimeters. Might come into play for infill, but that shouldn't really impact visible print quality. Beats me, need more caffeine...
--SS
Re: Got rid of ringing/ghosting almost completely
William, yeah - the two available Volumetric Flow max settings SHOULD come into play for infill, but they don't. Slic3r PE seems to - in some ways - ignore the max extrusion rate - or miscalculate. You need to do some extra tweaking to really limit extrusion rates. The only successful method I have found is to limit infill to well under 100 mm/s move speeds. Even 75 mm/s infill has left under-extruded gaps in material (good PLA - calculated vf under 8 mm^3/s).
By my tests, the Mk3 can barely print at a maximum 7.5 mm^3/s. With anything short of a 60W Volcano type nozzle, not sure the Mk3 can print at 100 mm/s in any situation; and the ability to print at 200 mm/s is certainly wasted under most circumstances. I haven't tried the copper heat exchanger yet - but perhaps that can improve print speeds a little; but the copper nozzle had little effect over brass.
But this has little to do with the issue of jerks making the belts ring with fast moves. What seems odd to me is that I get the same ringing on small micro-moves (sub millimeter) as I do on larger steps. At some level this seems counter intuitive ... but maybe it is expected.
Re: Got rid of ringing/ghosting almost completely
This looks like a really interesting idea, but not having much luck running it. Doesn't run against Python 2 or 3 although it appears to just not be Python 3 compatible (Python 2 is end of life so I really wouldn't recommend writing anything else in it).
Python 2 runs but bails out with:
python2 ./ghostRemove.pl ../3MF-Models/3DBenchy_0.15mm_PET_MK3-Python.gcode
../3MF-Models/3DBenchy_0.15mm_PET_MK3-Python.gcode
Traceback (most recent call last):
File "./ghostRemove.pl", line 39, in <module>
y2=float(command[2].lstrip("Y"))
ValueError: could not convert string to float: E9.0
Re: Got rid of ringing/ghosting almost completely
I actually tried this script today (Mk3) on some square lack enclosure parts with 90 degree bends. Funnily enough, I got an exact duplicate ghost exactly midway down the part that mirrored the profile of the edge before it. It's on both sides of the print, so not just a seam.
RE: Got rid of ringing/ghosting almost completely
I have written a simple python script that gets rid of ringing in prints. It works by parsing the gcode file and looking for perimeter movements that change direction of more than 60 degrees with respect to a previous movement. If that is the case, it will reduce the x and y jerk values of the printer to a low value by inserting a "M205 X2 Y2" command into the gcode file just before where the move starts, and restoring to a higher jerk value just before the first point where a smaller angle move has to be done.
Why does this work better than just having a low jerk value for the whole print: Because printing with very low jerk values messes up curvatures. It generates a wavy pattern all around curvatures.
It would be great to have such a feature built into Slic3r. I have tried to run the script as a post processing script in Slic3r prusa edition (1.38), but it refuses to run python scripts for some reason. Even when I run the script from a bash file and then use the bash file as a post processing script from Slic3r, the script does not run. A bash file that does not call a python script runs fine from Slic3r though.
If you want to try the script your self, it is simple:
- In print settings->output options, select Verbose G-Code. (The script needs this in order to detect perimeter moves)
- Now just call the script with the filename of your gcode file as the first and only argument. The script will then output a file with a .MOD.gcode extension that you can then load into your printer software. Your printer will now print with nearly all ghosting gone.Below is a copy of the script. Sorry for bad coding standards. I am not a professional programmer and python is not my first programming language.
#!/usr/bin/python
from math import *
import sysprint sys.argv[1]
x0=0
y0=0
x1=0
y1=0
x2=0
y2=0
modFlag=0
angle=0
dvr=0
prevLine=""
prev2Line=""
lenfV=0
lentV=0
lastMod="NOANGLE"filePath=sys.argv[1]
outputPath=filePath.rstrip("gcode")+"MOD.gcode"
fw=open(outputPath,"w")
with open(filePath) as fp:
line=fp.readline()
while line:
splitLine=line.split(";")
if len(splitLine)>1:
comment = splitLine[1].strip()
command=splitLine[0].strip()
command=command.split(" ")
if ("perimeter" in comment) or ("move to first" in comment) or ("move inwards" in comment):
modFlag=1
if command[0]=="G1":
if "X" in command[1] and len(command)>2:
x2=float(command[1].lstrip("X"))
y2=float(command[2].lstrip("Y"))
if (x0!=0):
fVx=x1-x0
fVy=y1-y0
tVx=x2-x1
tVy=y2-y1
lenfV=sqrt(fVx*fVx+fVy*fVy)
lentV=sqrt(tVx*tVx+tVy*tVy)
if lenfV!=0 and lentV!=0:
dvr=(fVx*tVx+fVy*tVy)/(sqrt(fVx*fVx+fVy*fVy)*sqrt(tVx*tVx+tVy*tVy))
if abs(1-dvr)<0.00000001: dvr=1 #This is to prevent a python roundoff error where the dvr value becomes greater than 1
#print command, comment, dvr
angle=degrees(acos(dvr))
x0=x1
y0=y1
x1=x2
y1=y2
if modFlag==1 and angle>45:
if lastMod!="ANGLE": fw.write("M205 X2 Y2\n")
lastMod="ANGLE"
print angle
elif lastMod=="ANGLE":
lastMod="NOANGLE"
fw.write("M205 X20 Y20\n")
fw.write(line)
#print comment, command, angle
prev2Line=prevLine
prevLine=line
modFlag=0
line=fp.readline()
angle=0
print outputPath
I know what you are doing here but Python demands formatting (unlike other languages) and I would like to see this work. Care to upload the code so we can download it or put up a formatted version via the code block?
Thanks.
RE: Got rid of ringing/ghosting almost completely
Nevermind I rewrote it in C++ as I despise Python and Perl is just slow.
RE: Got rid of ringing/ghosting almost completely
Could you share yours please?
RE: Got rid of ringing/ghosting almost completely
With formatting, I think I've got it right but I haven't tested it (as in printed the output). Its a python2 script.
from math import *
import sys
print sys.argv[1]
x0 = 0
y0 = 0
x1 = 0
y1 = 0
x2 = 0
y2 = 0
modFlag = 0
angle = 0
dvr = 0
prevLine = ""
prev2Line = ""
lenfV = 0
lentV = 0
lastMod = "NOANGLE"
filePath = sys.argv[1]
outputPath = filePath.rstrip("gcode") + "MOD.gcode"
fw = open(outputPath,"w")
with open(filePath) as fp:
line=fp.readline()
while line:
splitLine=line.split(";")
if len(splitLine) > 1:
comment = splitLine[1].strip()
command = splitLine[0].strip()
command = command.split(" ")
if ("perimeter" in comment) or ("move to first" in comment) or ("move inwards" in comment):
modFlag=1
if command[0] == "G1":
if "X" in command[1] and len(command)>2:
x2 = float(command[1].lstrip("X"))
y2 = float(command[2].lstrip("Y"))
if (x0 != 0):
fVx = x1 - x0
fVy = y1 - y0
tVx = x2 - x1
tVy = y2 - y1
lenfV = sqrt(fVx * fVx + fVy * fVy)
lentV = sqrt(tVx * tVx + tVy * tVy)
if lenfV != 0 and lentV != 0:
dvr = (fVx * tVx + fVy * tVy) / (sqrt(fVx * fVx + fVy * fVy) * sqrt(tVx * tVx + tVy * tVy))
if abs(1 - abs(dvr)) < 0.00000001:
dvr = 1 #This is to prevent a python roundoff error where the dvr value becomes greater than 1
#print command, comment, dvr
angle = degrees(acos(dvr))
x0 = x1
y0 = y1
x1 = x2
y1 = y2
if modFlag == 1 and angle > 45:
if lastMod != "ANGLE":
fw.write("M400\n")
fw.write("M205 X2 Y2\n")
lastMod="ANGLE"
print angle
elif lastMod == "ANGLE":
lastMod = "NOANGLE"
fw.write("M400\n")
fw.write("M205 X20 Y20\n")
fw.write(line)
prev2Line = prevLine
prevLine = line
modFlag = 0
line = fp.readline()
angle = 0
print outputPath