slic3r / Slic3r

Open Source toolpath generator for 3D printers
https://slic3r.org/
GNU Affero General Public License v3.0
3.33k stars 1.29k forks source link

Missing 0.065mm in GCODE? #1238

Closed diepchess closed 11 years ago

diepchess commented 11 years ago

See http://www.thingiverse.com/thing:100850 I included a graph i drew with dimensions. Apologies for amateuristic explanation.

The GCODE slic3r 0.9.9 generates (also older) says object in Y direction is 135.012 mm. If i add extrusion width to that, then 135.012 + 0.35 = 135.362 whereas height of object should be 135.4256.

So i'm missing roughly 0.065 mm in object size in Y direction from slic3r here.

I made small C program to see how many times it reaches the utmost corners of the object. That indeed also shows 135.012mm so pronterface didn't lie.

Bit waste of effort mine as pronterface gives that number as well when i set skirt loops to 0.

The nozzle is 0.35 here and in print settings extrusion width: default extrusion width: 0.35 first layer: 0.8 perimeters 0.35 infill 0.8 solid infill 0.35 top solid infill 0.35 support material 0

About the object. I designed it in OpenSCAD to be compatible with other plastic for mendelmax.

The height of object is 135.4256 mm if i do math.

a3 = 4 + 70 + 4 = 78 mm a2 = sin(30) * 4 = 0.5 * 4 = 2 mm a1 = cos(30) * 64 = 55.4256 mm So total height is a1+a2+a3 = 135.4256

I checked in FreeCAD the STL, yet complicated program for me to get exact dimensions of an object.

alranel commented 11 years ago

I confirm the STL file is 135.4256mm long in Y, but its uppermost point is a corner. So I don't really think you can add the plain extrusion width value to the G-code coordinates. What does the G-code look like in the corner? Can you attach a screenshot?

alranel commented 11 years ago

Extrusion width acts like a drillbit diameter in a mill. Suppose you have a very thick drillbit and you try to mill a corner: you'll not be able to do it fully because at some point there will be no room for it. The same happens for extrusion width: at some point we'll need to "cut" the corner because the angle gets too narrow for it. Such approximation causes the error you're measuring.

If you try to measure an object with flat sides, your math will work.

diepchess commented 11 years ago

Wow thanks for your quick answer.

You are stating that the size of the object will be 0.063 mm longer
than the 0.175 left/right space in the topcorner?

Let me modify my C code here to get the correct line numbers where it
goes through that top corner when drawing the outer perimeter line.

On Jun 12, 2013, at 5:08 PM, Alessandro Ranellucci wrote:

Extrusion width acts like a drillbit diameter in a mill. Suppose
you have a very thick drillbit and you try to mill a corner: you'll
not be able to do it fully because at some point there will be no
room for it. The same happens for extrusion width: at some point
we'll need to "cut" the corner because the angle gets too narrow
for it. Such approximation causes the error you're measuring.

If you try to measure an object with flat sides, your math will work.

— Reply to this email directly or view it on GitHub.

alranel commented 11 years ago

Uhm no, I think the corner just gets rounded in physical reality as you can't get that sharpness with a round extrusion! The corner is cut...

diepchess commented 11 years ago

hi i have taken screenshot. where can i email it to? Github doesn't allow attach files it seems.

diepchess commented 11 years ago

have put it temporarily on thingiverse next to object for now. http://www.thingiverse.com/thing:100850

diepchess commented 11 years ago

Hello, what i see is the movement of the perimeterline getting drawn from what i will define as point X(118.153 , 153.649) --> Y(94.208 , 167.474) With Y being the top of our object. Now we know this is roughly 0.0636 millimeters short.

Let's assume now the X coordinates of both points to be correct. Sure dangerous assumption yet we can do this lineair math to show a problem already.

Suppose we would draw a perimeter line from a point X' to Y', having the 0.0636 correction, at a perfect 30 degree angle, which y coordinate does our point X' then have?

So we draw from X'( 118.153 , y ) --> Y'(94.208 , 167.474 + 0.0636)

We know delta x = 118.153 - 94.208 = 23.945 ==> delta y = 23.945 * tan(30) = 13.8246522

So y = 167.474 + 0.0636 - 13.8246522 = 153.7129 In reality however X(y) = 153.649 which is in fact 0.0639 millimeter too low. So if i forget about the great rounded corners, the actual object is missing a few millimeter over a length of 28 millimeter.

The object is missing 0.0639 mm * 28 mm * 10 mm = 17.892 cubic millimeter.

diepchess commented 11 years ago

Actually what it is missing is more complicated to calculate. The whole problem is that the object in reality has dimension in Y direction of 135.4256 millimeter and after slicing it has shrunk to 135.012 + width of track 0.35 = 135.362 millimeters.

If we look at the bottom of the object, we see that it goes perfectly around the corners there, leaving exactly 0.35 space left and right for the track width.

mesheldrake commented 11 years ago

@diepchess - notice that these github comment boxes allow you to drag-and-drop images. @diepchess' height calculation diagram: @diepchess' height calculation diagram

diepchess commented 11 years ago

Thanks for mentionning Mike. Not working here. For internetting i use insecure os/x 10.4.11 laptop with latest firefox that can work at 10.4. Apple has habit every few months require you update to newer os/x and pay for that. Don't have the cash for that. Might soon install linux at this laptop as well though :)

diepchess commented 11 years ago

Mike, can you cut'n paste that other jpg picture from that same thingiverse here as well, it shows the GCODEs of one of the many slices i made out of the above 2a object. Thanks in advance!

mesheldrake commented 11 years ago

I hear you about the OSX Firefox upgrade limits - that's a real shame. But you can also include images by URL. (Check out the "Git Flavored Markdown" link.) The format is like this:

!(text description)[http://example.com/image.png]

So try this if you want to post that other image:

![gcode screenshot](http://thingiverse-production.s3.amazonaws.com/renders/41/83/b0/69/5f/topcorner_display_large.jpg)

But the other image isn't especially helpful.

You can't just move straight down from that highest point in the model to calculate the highest offset point. Here's your top corner with a circle of extrusion width diameter. You're going to have to do a little more trig to find that circle center location.

corner

Also, is 0.35 really the extrusion width? Or is that your nozzle diameter. The effective extrusion width is calculated and reported at the top of the gcode, and it's typically wider than nozzle diameter.

diepchess commented 11 years ago

Very good explanation Mike!

Can you also explain the total travel distance Mike? When travellling from X to Y it travels in total: sqrt(x^2 + y^2) = 27.63. If we add track width to that it's 27.98249 mm it travels instead of 28 mm.

It travels 27.63 mm giving atotal of 27.98249

diepchess commented 11 years ago

As r = 0.175 giving it a difference of delta y: cos( 15 ) = y / sqrt( 2 r^2 ) ==> delta y = 0.064054446 mm.

That 0.064 which is like 36.6% of the radius, that's a far bigger difference than i had ever blindfolded guessed, even if i draw it on a paper here.

So that answers the 0.636 difference i noticed :) Assuming the X was correct was a bad assumption in short as well :)

mesheldrake commented 11 years ago

Regarding travel distance, where is 28mm coming from? That edge into the corner is 64mm, right? But the layer you happen to be looking at probably makes that straight line in two segments, derived from the underlying model facets highlighted below. diag Chances are that the the split in that straight line does not actually result in the second segment being exactly 28. And it's going to come out different for each layer.

diepchess commented 11 years ago

It's the top edge which is 28 mm.

This side edge is indeed 64 mm, yet it's the edge that is 90 degrees on this one that i took X and Y from. it happened to move against the clock building this object, in the GCODE that is.

mesheldrake commented 11 years ago

Rounding error I think. I just worked it out on the calculator without rounding intermediate values and came out with 27.999. You can even paste this into the google search box to get the same thing:

0.35 + sqrt((118.153 - 94.208)^2 + (153.649 - 167.474)^2)
diepchess commented 11 years ago

I must apologize! On my paper i was so stupid to make a write error. I see i later on correct it again for other calculations, yet not the initial ones! So Sorry! I had written down on noteblock 167.44 instead of 167.474. Apologies for that.

I did do a new run now for a new test object i created and i have it printed exactly to 10.00 x 10.00 CM GREAT!

Let me post the test onto my thingiverse as well before i forget it.

As it's past midnight now here - time to start printing the tank parts now... ..time to get them rolling...

Without slic3r this wouldn't be possible that easily with a 0.35 nozzle!

Many thanks and keep doing the good work!

mesheldrake commented 11 years ago

Glad it all adds up now.

alranel commented 11 years ago

@mesheldrake, thank you for helping here and providing the drawing which was indeed more effective than my words. :)

diepchess commented 11 years ago

He did do it magnificent!

On Jun 13, 2013, at 12:47 AM, Alessandro Ranellucci wrote:

@mesheldrake, thank you for helping here and providing the drawing
which was indeed more effective than my words. :)

— Reply to this email directly or view it on GitHub.