Engineering Fits and Tolerance

classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Engineering Fits and Tolerance

boxcarmib
Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.

For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.

Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.

        cylinder(d = 5, h = 2, $fit = “g6”);

I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.

I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.

I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:

        cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);

And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.

shaftFit = “h7”;

So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.

I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
Not sure I understand. h7 specifies a tolerance, i.e. a range of possible sizes that can be tested with a limit gauge or a micrometer. How can that be expressed in a model, which always has a definite size?

On Tue, 29 Oct 2019 at 22:00, Hugo Jackson <[hidden email]> wrote:
Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.

For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.

Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.

        cylinder(d = 5, h = 2, $fit = “g6”);

I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.

I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.

I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:

        cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);

And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.

shaftFit = “h7”;

So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.

I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

adrianv
Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion.
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.)  

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically.  


nophead wrote
> Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
> sizes that can be tested with a limit gauge or a micrometer. How can that
> be expressed in a model, which always has a definite size?
>
> On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;

> hugo@

> &gt; wrote:
>
>> Has any thought been given to incorporating engineering fits and
>> tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
>> conceived for the creation of STL files for a 3D printer and I’ve been
>> thinking that the base functionality might be improved by a little more
>> CAM
>> in the CAD.





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
Yes it is H7 for holes to accept h7 shafts as a slip fit. I know because that is what 3D printer pulleys should be for stepper motors and I got a batch from China that didn't fit so had to get expensive measuring equipment. 1 micron micrometer and an H7 limit plug gauge and H7 reamers.

On Tue, 29 Oct 2019 at 22:57, adrianv <[hidden email]> wrote:
Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion.
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.) 

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically. 


nophead wrote
> Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
> sizes that can be tested with a limit gauge or a micrometer. How can that
> be expressed in a model, which always has a definite size?
>
> On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;

> hugo@

> &gt; wrote:
>
>> Has any thought been given to incorporating engineering fits and
>> tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
>> conceived for the creation of STL files for a 3D printer and I’ve been
>> thinking that the base functionality might be improved by a little more
>> CAM
>> in the CAD.





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib
In reply to this post by adrianv
This is the wikipedia article on the matter:


It doesn’t apply to just threads, but to holes and shafts as well, and is easily expanded to include regularly shaped polygons as well (cause like in triangle world a rectangle is just a 4 sides circle :) ) and it’s used to specify the clearance between two mating objects.

The ISO specification uses capital letters to specify the tolerance range for holes, and lower case letters for shafts. Although the system could be used to fudge for over/under extrusion situations, that’s not it’s intended usage. It’s purpose is to remove the ambiguity of expressions like “loose fitting” and “tight fitting” and you often encounter both the ISO and ANSI tolerances in blue prints and machine drawings.

A pointed out in the article, for example, a paired specification like “H7/k6” on a nominal 50 mm diameter would identify a tolerance range of
+0.000 mm to +0.025 mm and a tolerance range of -0.018 mm to +0.002 mm for the shaft.

I find that I can generally hold my most often used FDM 3d printer to a +/- 0.03 range, so while “H8/f7” would be too exacting a specification for my machine, there are tolerance ranges that could be used for most FDM and certainly DLP printing.


On Oct 29, 2019, at 4:07 PM, adrianv <[hidden email]> wrote:

Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion.
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.)  

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically.  


nophead wrote
Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
sizes that can be tested with a limit gauge or a micrometer. How can that
be expressed in a model, which always has a definite size?

On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;

hugo@

&gt; wrote:

Has any thought been given to incorporating engineering fits and
tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
conceived for the creation of STL files for a 3D printer and I’ve been
thinking that the base functionality might be improved by a little more
CAM
in the CAD.





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

doug.moen
In reply to this post by boxcarmib
On Tue, Oct 29, 2019, at 6:00 PM, Hugo Jackson wrote:
> Has any thought been given to incorporating engineering fits and
> tolerances into OpenSCAD?

Yes, here's an old forum post with some code that implements a tolerance variable called $fe.
http://forum.openscad.org/fe-Tolerance-based-arc-approximation-td14212.html

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

alexgibson
In reply to this post by boxcarmib

I think what you are after is something I already use myself, and have built into my own libraries, but it does not need to be a vital part of the language itself – it’s just one of many ways you can use the programmatical nature of OpenSCAD.

 

In OpenSCAD we are creating ‘pure’ solid shapes (my own terminology only) – the theoretical perfect object. 

 

You could hard code all the dimensions, but it’s much better to define variables upfront – if we were drawing a nut and bolt, why not start with defining the ‘nominal’ diameter.  Then, each diameter could be either a modification of that, or a specific D or d value.  Now, because it’s coded, there’s nothing stopping you also adding another modifier to each dimension, for the nozzle spread of your 3D printer, or the kerf of a laser cutter or mill.  These things are independent of one another, and you can choose to turn these factors on or off depending on whether you are rendering a drawing to be annotated and sent to a machine shop, or making a model to 3D print yourself – effectively this is stepping out of CAD and into CAM, by compensating for limitations in slicers.

 

If you are struggling to tune tolerances one thing to note if not already obvious:  all circles/cylinders in OpenSCAD are polygon approximations, with points on the circumference, so the middle of the flats is a lower diameter than the tips – an OpenSCAD hole will always be narrower than it should be.  This can be worked around by using the global $fn= value to increase the number of facets for the final render before printing, but keep it lower during design to improve rendering speed.

 

So there are several different factors at play on all dimensions depending on what stage of the design process you are.  Rather than force these into the language, why not build a library where you define these tolerance values, and include it in your subsequent models? 

 

Cheers,

 

Alex Gibson

 

admg consulting

 

edumaker limited

 

·         Project management

·         Operations & Process improvement

·         3D Printing

 

From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
Sent: 29 October 2019 23:25
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance

 

This is the wikipedia article on the matter:

 

 

It doesn’t apply to just threads, but to holes and shafts as well, and is easily expanded to include regularly shaped polygons as well (cause like in triangle world a rectangle is just a 4 sides circle :) ) and it’s used to specify the clearance between two mating objects.

 

The ISO specification uses capital letters to specify the tolerance range for holes, and lower case letters for shafts. Although the system could be used to fudge for over/under extrusion situations, that’s not it’s intended usage. It’s purpose is to remove the ambiguity of expressions like “loose fitting” and “tight fitting” and you often encounter both the ISO and ANSI tolerances in blue prints and machine drawings.

 

A pointed out in the article, for example, a paired specification like “H7/k6” on a nominal 50 mm diameter would identify a tolerance range of

+0.000 mm to +0.025 mm and a tolerance range of -0.018 mm to +0.002 mm for the shaft.

 

I find that I can generally hold my most often used FDM 3d printer to a +/- 0.03 range, so while “H8/f7” would be too exacting a specification for my machine, there are tolerance ranges that could be used for most FDM and certainly DLP printing.

 

 

On Oct 29, 2019, at 4:07 PM, adrianv <[hidden email]> wrote:

 

Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion.
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.)  

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically.  


nophead wrote

Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
sizes that can be tested with a limit gauge or a micrometer. How can that
be expressed in a model, which always has a definite size?

On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;



hugo@



&gt; wrote:


Has any thought been given to incorporating engineering fits and
tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
conceived for the creation of STL files for a 3D printer and I’ve been
thinking that the base functionality might be improved by a little more
CAM
in the CAD.






--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

 


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib
Thanks for your input Alex.

As I mentioned in my original post my thought was to add more CAM to the CAD… I agree that OpenSCAD gives you theoretically perfect shapes, and that’s appropriate for a pure CAD application, but if it’s true that the majority of OpenSCAD users are using the program to create files for 3D printers then it misses the opportunity to extend the application of the OpenSCAD environment to actual machine ‘control’.
The addition of engineering fit capability would/could be entirely invisible to the user, as it would share a profile similar to that of $fn, $fa and $fe. If you never specify a tolerance you would continue to code and receive the theoretically perfect objects you specify.
As you say, we could “hard code” all the dimensions, but better to define variable upfront… likewise, you could hard code all the tolerances up front, or you could simple create your projects with the perfect shapes and with the inclusion of a tolerance factor in the core language ‘magically’ have your parts fits together the way you want them to.
I think there are other advantages as well… if we start to produce OpenSCAD programs with a facility for tolerances, then tuning parts for a specific manufacturing process becomes intrinsic to the basic design. It also provides a mechanism for successful shared project printing. With a standardized approach and system for tolerances then you simply require that parts be within the tolerances specified.
As I’ve mentioned previously, I already code all of my projects with tolerance in mind, so it’s not a “gotta have” feature I’m looking for, I just thought I’d bring the matter up because I was interested in the communities thoughts on the subject, and perhaps someone might provide some insight that had escaped me in my current implementation.

On Oct 29, 2019, at 4:47 PM, Alex Gibson <[hidden email]> wrote:

I think what you are after is something I already use myself, and have built into my own libraries, but it does not need to be a vital part of the language itself – it’s just one of many ways you can use the programmatical nature of OpenSCAD.
 
In OpenSCAD we are creating ‘pure’ solid shapes (my own terminology only) – the theoretical perfect object.  
 
You could hard code all the dimensions, but it’s much better to define variables upfront – if we were drawing a nut and bolt, why not start with defining the ‘nominal’ diameter.  Then, each diameter could be either a modification of that, or a specific D or d value.  Now, because it’s coded, there’s nothing stopping you also adding another modifier to each dimension, for the nozzle spread of your 3D printer, or the kerf of a laser cutter or mill.  These things are independent of one another, and you can choose to turn these factors on or off depending on whether you are rendering a drawing to be annotated and sent to a machine shop, or making a model to 3D print yourself – effectively this is stepping out of CAD and into CAM, by compensating for limitations in slicers.
 
If you are struggling to tune tolerances one thing to note if not already obvious:  all circles/cylinders in OpenSCAD are polygon approximations, with points on the circumference, so the middle of the flats is a lower diameter than the tips – an OpenSCAD hole will always be narrower than it should be.  This can be worked around by using the global $fn= value to increase the number of facets for the final render before printing, but keep it lower during design to improve rendering speed.
 
So there are several different factors at play on all dimensions depending on what stage of the design process you are.  Rather than force these into the language, why not build a library where you define these tolerance values, and include it in your subsequent models?  
 
Cheers,
 
Alex Gibson
 
admg consulting
 
edumaker limited
 
·         Project management
·         Operations & Process improvement 
·         3D Printing
 
From: Discuss [[hidden email]] On Behalf Of Hugo Jackson
Sent: 29 October 2019 23:25
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance
 
This is the wikipedia article on the matter:
 
 
It doesn’t apply to just threads, but to holes and shafts as well, and is easily expanded to include regularly shaped polygons as well (cause like in triangle world a rectangle is just a 4 sides circle :) ) and it’s used to specify the clearance between two mating objects.
 
The ISO specification uses capital letters to specify the tolerance range for holes, and lower case letters for shafts. Although the system could be used to fudge for over/under extrusion situations, that’s not it’s intended usage. It’s purpose is to remove the ambiguity of expressions like “loose fitting” and “tight fitting” and you often encounter both the ISO and ANSI tolerances in blue prints and machine drawings.
 
A pointed out in the article, for example, a paired specification like “H7/k6” on a nominal 50 mm diameter would identify a tolerance range of
+0.000 mm to +0.025 mm and a tolerance range of -0.018 mm to +0.002 mm for the shaft.
 
I find that I can generally hold my most often used FDM 3d printer to a +/- 0.03 range, so while “H8/f7” would be too exacting a specification for my machine, there are tolerance ranges that could be used for most FDM and certainly DLP printing.
 
 
On Oct 29, 2019, at 4:07 PM, adrianv <[hidden email]> wrote:
 
Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion. 
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.)  

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically.  


nophead wrote

Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
sizes that can be tested with a limit gauge or a micrometer. How can that
be expressed in a model, which always has a definite size?

On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;


hugo@


&gt; wrote:


Has any thought been given to incorporating engineering fits and
tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
conceived for the creation of STL files for a 3D printer and I’ve been
thinking that the base functionality might be improved by a little more
CAM
in the CAD.





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
 
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

alexgibson

So it’s quite likely we are independently doing very similar things, and I know others are, so there’s an opportunity to at least define a useful common approach.

 

If tolerance factors should be built into OpenSCAD, it would need to be in a way that is universally meaningful and constant.  For example ISO standards.

 

Even then, I think there are a few tensions.

 

Tolerances are to me a completely different concept than adjustments for specific CAM applications.  They are used to communicate to somebody else what is acceptable when making the item you have described perfectly in CAD.  So they must be a range.

 

Whereas if I know my kerf or spread factor from precise measurement, and apply this as an offset to my perfect model, I’m expecting the resulting rendered model to explicitly be a distorted rendering of my part, and that if I slice and print this using one very specific configuration, it will print/cut something closer to the perfect shape than if we’d used the ‘nominal’ part.

Especially in 3D printing, you get different tolerances in different axes- if I took a part I’d optimised for spread in x and Y, and rotated it about X, I could end up with an awfully distorted part.

 

I have some designs which have complex arrangements of laser cut parts, and the variations in thickness of the Perspex could make or break the fit.  So I have a test piece that is designed to be cut and measured, to feed into OpenSCAD the top level measurements of kerf, material thickness etc.  This is then picked up as a factor by all relevant parts of the design, which shuffles itself to fit. 

 

I would call this (from ignorance of the proper term) ‘tuning’ – and it’s set apart from tolerance – perhaps the flip side.

 

Finally there’s also things like spacings – allowance for material expansion, air gap between moving parts etc.  To me that’s handled separately from tolerance and tuning, but often all 3 might be present in a single radius…!

 

Not sure how this chimes with your thinking and practice? 

 

Alex Gibson

 

admg consulting

 

edumaker limited

 

·         Project management

·         Operations & Process improvement

·         3D Printing

 

From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
Sent: 30 October 2019 00:53
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance

 

Thanks for your input Alex.

 

As I mentioned in my original post my thought was to add more CAM to the CAD… I agree that OpenSCAD gives you theoretically perfect shapes, and that’s appropriate for a pure CAD application, but if it’s true that the majority of OpenSCAD users are using the program to create files for 3D printers then it misses the opportunity to extend the application of the OpenSCAD environment to actual machine ‘control’.

The addition of engineering fit capability would/could be entirely invisible to the user, as it would share a profile similar to that of $fn, $fa and $fe. If you never specify a tolerance you would continue to code and receive the theoretically perfect objects you specify.

As you say, we could “hard code” all the dimensions, but better to define variable upfront… likewise, you could hard code all the tolerances up front, or you could simple create your projects with the perfect shapes and with the inclusion of a tolerance factor in the core language ‘magically’ have your parts fits together the way you want them to.

I think there are other advantages as well… if we start to produce OpenSCAD programs with a facility for tolerances, then tuning parts for a specific manufacturing process becomes intrinsic to the basic design. It also provides a mechanism for successful shared project printing. With a standardized approach and system for tolerances then you simply require that parts be within the tolerances specified.

As I’ve mentioned previously, I already code all of my projects with tolerance in mind, so it’s not a “gotta have” feature I’m looking for, I just thought I’d bring the matter up because I was interested in the communities thoughts on the subject, and perhaps someone might provide some insight that had escaped me in my current implementation.



On Oct 29, 2019, at 4:47 PM, Alex Gibson <[hidden email]> wrote:

 

I think what you are after is something I already use myself, and have built into my own libraries, but it does not need to be a vital part of the language itself – it’s just one of many ways you can use the programmatical nature of OpenSCAD.

 

In OpenSCAD we are creating ‘pure’ solid shapes (my own terminology only) – the theoretical perfect object.  

 

You could hard code all the dimensions, but it’s much better to define variables upfront – if we were drawing a nut and bolt, why not start with defining the ‘nominal’ diameter.  Then, each diameter could be either a modification of that, or a specific D or d value.  Now, because it’s coded, there’s nothing stopping you also adding another modifier to each dimension, for the nozzle spread of your 3D printer, or the kerf of a laser cutter or mill.  These things are independent of one another, and you can choose to turn these factors on or off depending on whether you are rendering a drawing to be annotated and sent to a machine shop, or making a model to 3D print yourself – effectively this is stepping out of CAD and into CAM, by compensating for limitations in slicers.

 

If you are struggling to tune tolerances one thing to note if not already obvious:  all circles/cylinders in OpenSCAD are polygon approximations, with points on the circumference, so the middle of the flats is a lower diameter than the tips – an OpenSCAD hole will always be narrower than it should be.  This can be worked around by using the global $fn= value to increase the number of facets for the final render before printing, but keep it lower during design to improve rendering speed.

 

So there are several different factors at play on all dimensions depending on what stage of the design process you are.  Rather than force these into the language, why not build a library where you define these tolerance values, and include it in your subsequent models?  

 

Cheers,

 

Alex Gibson

 

admg consulting

 

edumaker limited

 

·         Project management

·         Operations & Process improvement 

·         3D Printing

 

From: Discuss [[hidden email]] On Behalf Of Hugo Jackson
Sent: 29 October 2019 23:25
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance

 

This is the wikipedia article on the matter:

 

 

It doesn’t apply to just threads, but to holes and shafts as well, and is easily expanded to include regularly shaped polygons as well (cause like in triangle world a rectangle is just a 4 sides circle :) ) and it’s used to specify the clearance between two mating objects.

 

The ISO specification uses capital letters to specify the tolerance range for holes, and lower case letters for shafts. Although the system could be used to fudge for over/under extrusion situations, that’s not it’s intended usage. It’s purpose is to remove the ambiguity of expressions like “loose fitting” and “tight fitting” and you often encounter both the ISO and ANSI tolerances in blue prints and machine drawings.

 

A pointed out in the article, for example, a paired specification like “H7/k6” on a nominal 50 mm diameter would identify a tolerance range of

+0.000 mm to +0.025 mm and a tolerance range of -0.018 mm to +0.002 mm for the shaft.

 

I find that I can generally hold my most often used FDM 3d printer to a +/- 0.03 range, so while “H8/f7” would be too exacting a specification for my machine, there are tolerance ranges that could be used for most FDM and certainly DLP printing.

 

 

On Oct 29, 2019, at 4:07 PM, adrianv <[hidden email]> wrote:

 

Well, if it's supposed to be like a screw thread tolerance then the letter
specifies a "tolerance position", which gives a maximum diameter for the
bolt shaft.  The number gives the tolerance range below this maximum.  One
could imagine using this to shrink models to compensate for overextrusion. 
But this is a specific standard for machine screw threads and the value of
the tolerance even depends on the screw shaft diameter.   It doesn't apply
broadly to arbitrary objects.  (It doesn't even apply to nuts, which use
capital letters.)  

Even if you could figure out how to define it for arbitrary objects, how
would OpenSCAD know whether a component needed to be enlarged or shrunk?  I
don't see that there's any way to do this automatically.  


nophead wrote


Not sure I understand. h7 specifies a tolerance, i.e. a range of possible
sizes that can be tested with a limit gauge or a micrometer. How can that
be expressed in a model, which always has a definite size?

On Tue, 29 Oct 2019 at 22:00, Hugo Jackson &lt;




hugo@




&gt; wrote:



Has any thought been given to incorporating engineering fits and
tolerances into OpenSCAD? As I understand it, OpenSCAD was originally
conceived for the creation of STL files for a 3D printer and I’ve been
thinking that the base functionality might be improved by a little more
CAM
in the CAD.






--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

 

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

 


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

shadowwynd
In reply to this post by boxcarmib
If you are printing a bulbasaur, slop in the printer doesn't make much
difference.

If you are building parts that have to work with other parts - there is a
dizzying array of variables.  Filament type / brand / color, humidity, flow
rate, print/bed temperature, layer height, Z-Offset, edge curl/elephant
foot, slicing algorithm, and even the infill percentage and support
structure can subtly alter the print.  There are days when I marvel that any
of this FDM stuff works *at all*.

I can easily get 1mm+ difference between prints if I start changing
variables.  To make it even more fun - the outside dimensions might match
the "ideal" specified in CAD, but the inner diameter of a screw hole might
be 0.4mm too narrow.  These sorts of "tolerances" mean all the difference
between parts fitting together and moving as they should.... and not.    Or
I print two batches with the exact same machine and slicer settings but in
different filament and the parts don't line up again.  If dimensions matter,
I have a whole "tuning" ritual I have to go through every time I change
filament (level bed, print test, measure test, adjust Z-Offset and flow
rate, rinse and repeat until within 0.05 mm).  Assuming I can just print the
STLs on another 3D printer and have everything work OK is naive at best (if
there are multiple interlocking parts) unless I make the tolerances pretty
loose.  This is specifically one of the reasons I like OpenSCAD - I can
easily tweak a hole diameter by 0.2mm and it can apply to every hole in my
model at the same time.

What I often do is put all the fudge factors in one area.  This can be
commented out / copied+changed  if I am going between different models /
filaments.

diam = 10; // Ideal Diameter
thickness = 1;  //Height

// Fudge Factors - Printing on MakerGear M2, 0.2mm layer height, brown
UltiMachine PLA
diam_e = 0.1;
thickness_e = 0.04;

/*  // Fudge Factors - Printing on Makerbot, 0.3mm layer height, Hatchbox
white PLA
diam_e = 0.0;
thickness_e = 0.2;
*/

//Create Model
cylinder (d=diam+diam_e, h=thickness+thickness_e);




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib
In reply to this post by alexgibson


Begin forwarded message:

From: "Alex Gibson" <[hidden email]>
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance
Date: October 29, 2019 at 6:45:19 PM PDT
To: "'OpenSCAD general discussion'" <[hidden email]>
Reply-To: OpenSCAD general discussion <[hidden email]>

 
Tolerances are to me a completely different concept than adjustments for specific CAM applications.  They are used to communicate to somebody else what is acceptable when making the item you have described perfectly in CAD.  So they must be a range. 

Agreed. And that’s what the ISO and ANSII specifications are… they specify a range of clearance for a part.

 
Whereas if I know my kerf or spread factor from precise measurement, and apply this as an offset to my perfect model, I’m expecting the resulting rendered model to explicitly be a distorted rendering of my part, and that if I slice and print this using one very specific configuration, it will print/cut something closer to the perfect shape than if we’d used the ‘nominal’ part. 
Especially in 3D printing, you get different tolerances in different axes- if I took a part I’d optimised for spread in x and Y, and rotated it about X, I could end up with an awfully distorted part.
 

Printer tuning is a subject unto itself, but I’ve found that if I spend enough time and effort I can tune my printers to provide consistent and repeatable dimensionality for the objects it prints regardless of orientation. This is not an easy task, and typically requires a unique setup for just about any parameter that can be applied to 3d printing, filament type, temperature, z layer height, hell…. Even relative humidity. For that reason I tend to buy a lot of rolls of the same brand filament and color and stick with it until a project is complete. If the final print is going to be in another color or filament brand or type, then I’ll spend the time tuning it so that combination of elements yields a print within the base tolerance of the machine.


I have some designs which have complex arrangements of laser cut parts, and the variations in thickness of the Perspex could make or break the fit.  So I have a test piece that is designed to be cut and measured, to feed into OpenSCAD the top level measurements of kerf, material thickness etc.  This is then picked up as a factor by all relevant parts of the design, which shuffles itself to fit.  
 
I would call this (from ignorance of the proper term) ‘tuning’ – and it’s set apart from tolerance – perhaps the flip side.
 
Finally there’s also things like spacings – allowance for material expansion, air gap between moving parts etc.  To me that’s handled separately from tolerance and tuning, but often all 3 might be present in a single radius…!

I think there’s always some tension between where to adjust for a model to print as close to hypothetical perfection as possible, “do I do this in the cad” or “do I tune the printer so that it prints what the cad gives it”. A PLA filament is far easier to work with as it’s relatively dimensionally stable, whereas ABS is not, but as a general rule I see it as the machine’s responsibility to print to the dimensions its been given, rather than tweaking the design to accommodate the manufacturing process… which we both see as separate from tolerance and tuning.

Regardless, a perfectly printed shaft with a 30 mm diameter will not fit in a perfectly printed 30mm hole without a lot of effort, and that’s what engineering fit is all about… sometimes we want a tight fit, sometimes we want a loose fit, it depends on the application. My point is that if we know that at the time we are in the design phase, it would be worthwhile if that were integrated into the files we produce. I may not care WHAT type of filament a part is printed in, but I do care that there’s a .5 mm clearance +/- .05 between the printed parts.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib
In reply to this post by shadowwynd


> On Oct 29, 2019, at 8:40 PM, shadowwynd <[hidden email]> wrote:
>
> If you are printing a bulbasaur, slop in the printer doesn't make much
> difference.

I know what you mean, and let’s face it, the world can always use another bulbassaur if it’s cute! :)

>
> If you are building parts that have to work with other parts - there is a
> dizzying array of variables.  Filament type / brand / color, humidity, flow
> rate, print/bed temperature, layer height, Z-Offset, edge curl/elephant
> foot, slicing algorithm, and even the infill percentage and support
> structure can subtly alter the print.  There are days when I marvel that any
> of this FDM stuff works *at all*.

Indeed… but the machines ARE getting better… more reliable, more repeatability and as I mentioned
With the advent of affordable DLP machines, we’re starting to move to some impressive precision.
But as mentioned in this thread I think there’s a clear division of responsibility of the machine to print
objects to the specifications it is given. All the factors you mention are relevant to getting a machine to
print a part, but the goal is ultimately to get as close to the design specifications as possible, is it not?

If I specify I want a part that’s 30 mm wide +/- .05mm then that IS what I want… if my machine isn’t capable of
accomplishing that then I need to either find a machine that can produce those kind of tolerances or rethink my
design.

>
> I can easily get 1mm+ difference between prints if I start changing
> …
> easily tweak a hole diameter by 0.2mm and it can apply to every hole in my
> model at the same time.

> diam = 10; // Ideal Diameter
> thickness = 1;  //Height
>
> // Fudge Factors - Printing on MakerGear M2, 0.2mm layer height, brown
> UltiMachine PLA
> diam_e = 0.1;
> thickness_e = 0.04;
>
> /*  // Fudge Factors - Printing on Makerbot, 0.3mm layer height, Hatchbox
> white PLA
> diam_e = 0.0;
> thickness_e = 0.2;
> */
>
> //Create Model
> cylinder (d=diam+diam_e, h=thickness+thickness_e);
>

Personal experience shows me that I can get dimensioning of +/- .03 on a MakerGear M2, Prusa i3 Mk3 and a Monoprice mini-select and an XYZ DaVinci 1.0 Pro, for my
larger formbot I can get around +/- .07 tolerance. But that involves a lot of time intensive measurement and tuning, but as I’ve identified, I’m not
talking about Engineering Fits to address untuned printers, I’m just talking about incorporating tolerance dimensioning at a low level in OpenSCAD objects.

I confess that when I’m doing development I actually use a second dimensioning assist that is all about compensating for an untuned printer, I call it $slop. But when a project is finished $slop gets set to 0 (or [0,0,0] actually… one for each vertex) and I work with the printer to get it to printer objects of the dimensions I’ve specified rather than
having created a model that will only print accurately on the untuned printer I have sitting in front of me.

As I say, engineering fit is NOT about adjusting an untuned printer, it’s just about the clearances we want our interconnecting parts to have.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
My experience is totally different. The only setting I change is I measure the filament diameter when I start a new spool. I always model in actually dimensions. I use polyholes for round holes. If I want an interference fit I make the dimensions the same and they always press in, with varying degrees of force.. If I want a loose fit I leave 0.2mm gap. Since most of my holes are clearance holes using the standards for screws they always work because the standard is quite generous. For example 3.4mm for an M3 clearance hole.

If I want a super accurate hole, for example a pulley bore that is supposed to be H7 I print it slightly undersized and ream it with an H7 reamer. That actually makes the finished hole too small because of spring back in the plastic. But because the plastic has some spring it make a very nice snug fit on a motor shaft. It is is very had to even measure holes in plastic because of this.

On Wed, 30 Oct 2019 at 04:57, Hugo Jackson <[hidden email]> wrote:


> On Oct 29, 2019, at 8:40 PM, shadowwynd <[hidden email]> wrote:
>
> If you are printing a bulbasaur, slop in the printer doesn't make much
> difference.

I know what you mean, and let’s face it, the world can always use another bulbassaur if it’s cute! :)

>
> If you are building parts that have to work with other parts - there is a
> dizzying array of variables.  Filament type / brand / color, humidity, flow
> rate, print/bed temperature, layer height, Z-Offset, edge curl/elephant
> foot, slicing algorithm, and even the infill percentage and support
> structure can subtly alter the print.  There are days when I marvel that any
> of this FDM stuff works *at all*.

Indeed… but the machines ARE getting better… more reliable, more repeatability and as I mentioned
With the advent of affordable DLP machines, we’re starting to move to some impressive precision.
But as mentioned in this thread I think there’s a clear division of responsibility of the machine to print
objects to the specifications it is given. All the factors you mention are relevant to getting a machine to
print a part, but the goal is ultimately to get as close to the design specifications as possible, is it not?

If I specify I want a part that’s 30 mm wide +/- .05mm then that IS what I want… if my machine isn’t capable of
accomplishing that then I need to either find a machine that can produce those kind of tolerances or rethink my
design.

>
> I can easily get 1mm+ difference between prints if I start changing
> …
> easily tweak a hole diameter by 0.2mm and it can apply to every hole in my
> model at the same time.

> diam = 10; // Ideal Diameter
> thickness = 1;  //Height
>
> // Fudge Factors - Printing on MakerGear M2, 0.2mm layer height, brown
> UltiMachine PLA
> diam_e = 0.1;
> thickness_e = 0.04;
>
> /*  // Fudge Factors - Printing on Makerbot, 0.3mm layer height, Hatchbox
> white PLA
> diam_e = 0.0;
> thickness_e = 0.2;
> */
>
> //Create Model
> cylinder (d=diam+diam_e, h=thickness+thickness_e);
>

Personal experience shows me that I can get dimensioning of +/- .03 on a MakerGear M2, Prusa i3 Mk3 and a Monoprice mini-select and an XYZ DaVinci 1.0 Pro, for my
larger formbot I can get around +/- .07 tolerance. But that involves a lot of time intensive measurement and tuning, but as I’ve identified, I’m not
talking about Engineering Fits to address untuned printers, I’m just talking about incorporating tolerance dimensioning at a low level in OpenSCAD objects.

I confess that when I’m doing development I actually use a second dimensioning assist that is all about compensating for an untuned printer, I call it $slop. But when a project is finished $slop gets set to 0 (or [0,0,0] actually… one for each vertex) and I work with the printer to get it to printer objects of the dimensions I’ve specified rather than
having created a model that will only print accurately on the untuned printer I have sitting in front of me.

As I say, engineering fit is NOT about adjusting an untuned printer, it’s just about the clearances we want our interconnecting parts to have.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

JordanBrown
In reply to this post by boxcarmib
On 10/29/2019 3:00 PM, Hugo Jackson wrote:
	cylinder(d = 5, h = 2, $fit = “g6”);

So what exactly does this do to the cylinder?


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
Yes this is what I don't get. Does it aim for the middle of the tolerance band?

For plastic I don't think these tolerances make sense because of the springiness. 

Even with metal I don't think anybody makes these fits directly with CNC machinery, even professionally. I think they would use a reamer, perhaps on a turret tool changer, but not directly with a boring bar under control of an axis. And I doubt any 3D printers are this accurate.

And what size does an H7 reamer make? I suspect it would aim for the high side of the tolerance so it could wear down and still have some life.

I don't see the point of adding it to OpenSCAD because it is more of a specification passed on to the machinist and checked by a QA department than it is something that goes into the model. Please correct me if I am wrong.



On Wed, 30 Oct 2019 at 15:33, Jordan Brown <[hidden email]> wrote:
On 10/29/2019 3:00 PM, Hugo Jackson wrote:
	cylinder(d = 5, h = 2, $fit = “g6”);

So what exactly does this do to the cylinder?

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

alexgibson
In reply to this post by boxcarmib
Going back to your original question Hugh, and your example:
        cylinder(d = 5, h = 2, $fit = “g6”);

The way I've seen a lot of machine parts (usually 3D printer) programmed in OpenSCAD is this:

        cylinder(d = g6, h = 2);

...and above this at the top of the file...
        fit_tolerance = 0.5;
        machine_tolerance = 0.2;
        g6 = 5+fit_tolerance+machine_tolerance;

Rather than being 'piecemeal' I think building up layers of tolerance like this can be very helpful and reduce confusion and repetitive typing within the body of your design code.  Every time you want that size hole in your project, you just use d= g6 by name.  You can tune the tolerances after the initial design without re-coding.

The idea of a global $fit variable seems nice, but you would have to have it associated with a big table which defines what g6 and many other tolerances are, which you'd need to remember as you are designing the part.  Also it could not take into account multiple fudge factors, and to me that's the real beauty of OpenSCAD for this sort of thing.  

Have you tried a similar method, defining named dimensions?

One think I've started to do in my recent bigger projects is to break out dimensions and specific geometry modules into their own separate files:

0_dimensions.scad <named dimensions - for example m3_bolt_hole = 3.2; < this is where I do all tolerances etc.
1_geometry.scad <for example Nema 17 mount pattern holes, as a 2D pattern
2_component <say a 3D printed mount for the motor
3_subassembly <say the mount with motor, screws, pulley etc
4_majorassembly <say the whole axis
5_render <the whole project for rendering.


This has really helped me to improve version control and ease of navigation around complex projects - and made it easier to recycle code and incorporate scanned or downloaded parts.

Cheers
 
Alex Gibson

admg consulting

edumaker limited

• Project management
• Operations & Process improvement
• 3D Printing

-----Original Message-----
From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
Sent: 29 October 2019 22:00
To: OpenSCAD general discussion
Subject: [OpenSCAD] Engineering Fits and Tolerance

Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.

For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.

Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.

        cylinder(d = 5, h = 2, $fit = “g6”);

I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.

I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.

I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:

        cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);

And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.

shaftFit = “h7”;

So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.

I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
There is no final size for h7, etc. It is a tolerance range and depends on the diameter, so it would need to be a function. But as I said before I can't see how you can apply it to the model to be made. STL files do not convey tolerances. The best you could do is aim for the mid value but I don't know any machines that can make parts that accurate from an STL file.

On Thu, 31 Oct 2019 at 11:32, Alex Gibson <[hidden email]> wrote:
Going back to your original question Hugh, and your example:
        cylinder(d = 5, h = 2, $fit = “g6”);

The way I've seen a lot of machine parts (usually 3D printer) programmed in OpenSCAD is this:

        cylinder(d = g6, h = 2);

...and above this at the top of the file...
        fit_tolerance = 0.5;
        machine_tolerance = 0.2;
        g6 = 5+fit_tolerance+machine_tolerance;

Rather than being 'piecemeal' I think building up layers of tolerance like this can be very helpful and reduce confusion and repetitive typing within the body of your design code.  Every time you want that size hole in your project, you just use d= g6 by name.  You can tune the tolerances after the initial design without re-coding.

The idea of a global $fit variable seems nice, but you would have to have it associated with a big table which defines what g6 and many other tolerances are, which you'd need to remember as you are designing the part.  Also it could not take into account multiple fudge factors, and to me that's the real beauty of OpenSCAD for this sort of thing. 

Have you tried a similar method, defining named dimensions?

One think I've started to do in my recent bigger projects is to break out dimensions and specific geometry modules into their own separate files:

0_dimensions.scad               <named dimensions - for example m3_bolt_hole = 3.2;                     < this is where I do all tolerances etc.
1_geometry.scad         <for example Nema 17 mount pattern holes, as a 2D pattern
2_component                     <say a 3D printed mount for the motor
3_subassembly                   <say the mount with motor, screws, pulley etc
4_majorassembly         <say the whole axis
5_render                        <the whole project for rendering.


This has really helped me to improve version control and ease of navigation around complex projects - and made it easier to recycle code and incorporate scanned or downloaded parts.

Cheers

Alex Gibson

admg consulting

edumaker limited

• Project management
• Operations & Process improvement
• 3D Printing

-----Original Message-----
From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
Sent: 29 October 2019 22:00
To: OpenSCAD general discussion
Subject: [OpenSCAD] Engineering Fits and Tolerance

Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.

For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.

Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.

        cylinder(d = 5, h = 2, $fit = “g6”);

I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.

I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.

I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:

        cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);

And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.

shaftFit = “h7”;

So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.

I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib
In reply to this post by alexgibson

> On Oct 31, 2019, at 4:28 AM, Alex Gibson <[hidden email]> wrote:
>
> Going back to your original question Hugh, and your example:
> cylinder(d = 5, h = 2, $fit = “g6”);
>
> The way I've seen a lot of machine parts (usually 3D printer) programmed in OpenSCAD is this:
>
> cylinder(d = g6, h = 2);
>
> ...and above this at the top of the file...
> fit_tolerance = 0.5;
> machine_tolerance = 0.2;
> g6 = 5+fit_tolerance+machine_tolerance;
>
> Rather than being 'piecemeal' I think building up layers of tolerance like this can be very helpful and reduce confusion and repetitive typing within the body of your design code.  Every time you want that size hole in your project, you just use d= g6 by name.  You can tune the tolerances after the initial design without re-coding.
>
> The idea of a global $fit variable seems nice, but you would have to have it associated with a big table which defines what g6 and many other tolerances are, which you'd need to remember as you are designing the part.  Also it could not take into account multiple fudge factors, and to me that's the real beauty of OpenSCAD for this sort of thing.  

A very big table is exactly what I have,,, and it’s the table lookup and syntax parsing that would be nice to have handled faster and more efficiently by the core.

I guess it just comes down to personal style and one’s personal understanding of the OpenSCAD zeit. I think much is made of OpenSCAD’s parametric ability for resizing and substitution of dimensions and as different printing methodologies start being added, I think that the OpenSCAD core would benefit with a nod to ‘parametric’ tolerance.

In the example you sight, you identify g6 as a calculation involving the nominal dimensions, the fit tolerance and the machine tolerance… and to my way of thinking what’s going on would be clearer and more easily amended with the scheme I use… rather than:

>> fit_tolerance = 0.5;
>> machine_tolerance = 0.2;
>> g6 = 5+fit_tolerance+machine_tolerance;

> cylinder(d = g6, h = 2);

I think:

        cylinder(d = 5, h = 2, $fit = “g6”);

Is more straightforward, particularly if one declares the fit itself as a value, such as:

        runFit = “g6”;

And so:

        cylinder(d = 5, h = 2, $fit = runFit);

Provides the same opportunity to quickly amend all geometric constructions that use the runFit tolerance. This is particularly relevant to resizing as the ISO and ANSI standards reflect the reality that a 5mm hole requires a different tolerance than a 10mm hole to effect the same fit.
       



>
> Have you tried a similar method, defining named dimensions?
>
> One think I've started to do in my recent bigger projects is to break out dimensions and specific geometry modules into their own separate files:
>
> 0_dimensions.scad <named dimensions - for example m3_bolt_hole = 3.2; < this is where I do all tolerances etc.
> 1_geometry.scad <for example Nema 17 mount pattern holes, as a 2D pattern
> 2_component <say a 3D printed mount for the motor
> 3_subassembly <say the mount with motor, screws, pulley etc
> 4_majorassembly <say the whole axis
> 5_render <the whole project for rendering.

Yes, good idea. I think as our projects get more complex we all start creating a fistful of files… and I’m also hoping some day that OpenSCAD will allow for use, include and import to use non literal string values… but that’s another topic. :)

>
>
> This has really helped me to improve version control and ease of navigation around complex projects - and made it easier to recycle code and incorporate scanned or downloaded parts.
>
> Cheers
>
> Alex Gibson
>
> admg consulting
>
> edumaker limited
>
> • Project management
> • Operations & Process improvement
> • 3D Printing
>
> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
> Sent: 29 October 2019 22:00
> To: OpenSCAD general discussion
> Subject: [OpenSCAD] Engineering Fits and Tolerance
>
> Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.
>
> For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.
>
> Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.
>
> cylinder(d = 5, h = 2, $fit = “g6”);
>
> I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.
>
> I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.
>
> I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:
>
> cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);
>
> And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.
>
> shaftFit = “h7”;
>
> So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.
>
> I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

nophead
I think you completely misunderstand what g6 tolerance means. It is isn't a clearance that you add to the nominal size and it certainly isn't 0.5mm.

A g6 5mm shaft has to be between 4.9960 and 4.9880mm. Good luck with that on a 3D printer with 0.2mm accuracy.

On Thu, 31 Oct 2019 at 18:05, Hugo Jackson <[hidden email]> wrote:

> On Oct 31, 2019, at 4:28 AM, Alex Gibson <[hidden email]> wrote:
>
> Going back to your original question Hugh, and your example:
>       cylinder(d = 5, h = 2, $fit = “g6”);
>
> The way I've seen a lot of machine parts (usually 3D printer) programmed in OpenSCAD is this:
>
>       cylinder(d = g6, h = 2);
>
> ...and above this at the top of the file...
>       fit_tolerance = 0.5;
>       machine_tolerance = 0.2;
>       g6 = 5+fit_tolerance+machine_tolerance;
>
> Rather than being 'piecemeal' I think building up layers of tolerance like this can be very helpful and reduce confusion and repetitive typing within the body of your design code.  Every time you want that size hole in your project, you just use d= g6 by name.  You can tune the tolerances after the initial design without re-coding.
>
> The idea of a global $fit variable seems nice, but you would have to have it associated with a big table which defines what g6 and many other tolerances are, which you'd need to remember as you are designing the part.  Also it could not take into account multiple fudge factors, and to me that's the real beauty of OpenSCAD for this sort of thing. 

A very big table is exactly what I have,,, and it’s the table lookup and syntax parsing that would be nice to have handled faster and more efficiently by the core.

I guess it just comes down to personal style and one’s personal understanding of the OpenSCAD zeit. I think much is made of OpenSCAD’s parametric ability for resizing and substitution of dimensions and as different printing methodologies start being added, I think that the OpenSCAD core would benefit with a nod to ‘parametric’ tolerance.

In the example you sight, you identify g6 as a calculation involving the nominal dimensions, the fit tolerance and the machine tolerance… and to my way of thinking what’s going on would be clearer and more easily amended with the scheme I use… rather than:

>>      fit_tolerance = 0.5;
>>      machine_tolerance = 0.2;
>>      g6 = 5+fit_tolerance+machine_tolerance;

>       cylinder(d = g6, h = 2);

I think:

        cylinder(d = 5, h = 2, $fit = “g6”);

Is more straightforward, particularly if one declares the fit itself as a value, such as:

        runFit = “g6”;

And so:

        cylinder(d = 5, h = 2, $fit = runFit);

Provides the same opportunity to quickly amend all geometric constructions that use the runFit tolerance. This is particularly relevant to resizing as the ISO and ANSI standards reflect the reality that a 5mm hole requires a different tolerance than a 10mm hole to effect the same fit.




>
> Have you tried a similar method, defining named dimensions?
>
> One think I've started to do in my recent bigger projects is to break out dimensions and specific geometry modules into their own separate files:
>
> 0_dimensions.scad             <named dimensions - for example m3_bolt_hole = 3.2;                     < this is where I do all tolerances etc.
> 1_geometry.scad               <for example Nema 17 mount pattern holes, as a 2D pattern
> 2_component                   <say a 3D printed mount for the motor
> 3_subassembly                 <say the mount with motor, screws, pulley etc
> 4_majorassembly               <say the whole axis
> 5_render                      <the whole project for rendering.

Yes, good idea. I think as our projects get more complex we all start creating a fistful of files… and I’m also hoping some day that OpenSCAD will allow for use, include and import to use non literal string values… but that’s another topic. :)

>
>
> This has really helped me to improve version control and ease of navigation around complex projects - and made it easier to recycle code and incorporate scanned or downloaded parts.
>
> Cheers
>
> Alex Gibson
>
> admg consulting
>
> edumaker limited
>
> • Project management
> • Operations & Process improvement
> • 3D Printing
>
> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
> Sent: 29 October 2019 22:00
> To: OpenSCAD general discussion
> Subject: [OpenSCAD] Engineering Fits and Tolerance
>
> Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.
>
> For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.
>
> Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.
>
>       cylinder(d = 5, h = 2, $fit = “g6”);
>
> I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.
>
> I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.
>
> I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:
>
>       cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);
>
> And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.
>
> shaftFit = “h7”;
>
> So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.
>
> I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Engineering Fits and Tolerance

boxcarmib

On Oct 31, 2019, at 11:19 AM, nop head <[hidden email]> wrote:

I think you completely misunderstand what g6 tolerance means. It is isn't a clearance that you add to the nominal size and it certainly isn't 0.5mm.

A g6 5mm shaft has to be between 4.9960 and 4.9880mm. Good luck with that on a 3D printer with 0.2mm accuracy.


I beg to differ. :)

As I apologized in an earlier post, g6 was a poor choice to provide as an example for the 3D printing environment, and then I provided a more practical choice of g12 which for a 5mm shaft has a 4.876mm min and 4.996mm max providing a .12mm spread… which is a tolerance range I can achieve with most of my 3d printers.

And of course, g6, g12… they’re not the only fits available… ISO standards cover the precision of a wide range of manufacturing environments.

No engineer specifies greater precision than is required for the application at hand, simply for the reason that the rule of thumb is that the more precise a part needs to be, the more expensive it’s going to be, but by the same token, you can’t reasonably expect interlocking pieces to fit properly if no attention is paid to what the actual printed dimension of a part is going to be. I’m not saying it has to be accurate, I’m just suggesting that the precision should be predictable.

I’m not saying that specifying tolerances a 3D printer is totally incapable of producing is going to somehow make a 3D printer a more precise machine, what I am saying is that by adopting a system of standardized tolerances would be a positive and useful endeavour. So okay, a printer owner can’t hold a g6 or a g12 tolerance… but the question is, what kind of tolerance CAN they achieve and as a consequence, what classification of fits are appropriate for 3D modellers who are designing parts for production on an FDM machine.


On Thu, 31 Oct 2019 at 18:05, Hugo Jackson <[hidden email]> wrote:

> On Oct 31, 2019, at 4:28 AM, Alex Gibson <[hidden email]> wrote:
>
> Going back to your original question Hugh, and your example:
>       cylinder(d = 5, h = 2, $fit = “g6”);
>
> The way I've seen a lot of machine parts (usually 3D printer) programmed in OpenSCAD is this:
>
>       cylinder(d = g6, h = 2);
>
> ...and above this at the top of the file...
>       fit_tolerance = 0.5;
>       machine_tolerance = 0.2;
>       g6 = 5+fit_tolerance+machine_tolerance;
>
> Rather than being 'piecemeal' I think building up layers of tolerance like this can be very helpful and reduce confusion and repetitive typing within the body of your design code.  Every time you want that size hole in your project, you just use d= g6 by name.  You can tune the tolerances after the initial design without re-coding.
>
> The idea of a global $fit variable seems nice, but you would have to have it associated with a big table which defines what g6 and many other tolerances are, which you'd need to remember as you are designing the part.  Also it could not take into account multiple fudge factors, and to me that's the real beauty of OpenSCAD for this sort of thing. 

A very big table is exactly what I have,,, and it’s the table lookup and syntax parsing that would be nice to have handled faster and more efficiently by the core.

I guess it just comes down to personal style and one’s personal understanding of the OpenSCAD zeit. I think much is made of OpenSCAD’s parametric ability for resizing and substitution of dimensions and as different printing methodologies start being added, I think that the OpenSCAD core would benefit with a nod to ‘parametric’ tolerance.

In the example you sight, you identify g6 as a calculation involving the nominal dimensions, the fit tolerance and the machine tolerance… and to my way of thinking what’s going on would be clearer and more easily amended with the scheme I use… rather than:

>>      fit_tolerance = 0.5;
>>      machine_tolerance = 0.2;
>>      g6 = 5+fit_tolerance+machine_tolerance;

>       cylinder(d = g6, h = 2);

I think:

        cylinder(d = 5, h = 2, $fit = “g6”);

Is more straightforward, particularly if one declares the fit itself as a value, such as:

        runFit = “g6”;

And so:

        cylinder(d = 5, h = 2, $fit = runFit);

Provides the same opportunity to quickly amend all geometric constructions that use the runFit tolerance. This is particularly relevant to resizing as the ISO and ANSI standards reflect the reality that a 5mm hole requires a different tolerance than a 10mm hole to effect the same fit.




>
> Have you tried a similar method, defining named dimensions?
>
> One think I've started to do in my recent bigger projects is to break out dimensions and specific geometry modules into their own separate files:
>
> 0_dimensions.scad             <named dimensions - for example m3_bolt_hole = 3.2;                     < this is where I do all tolerances etc.
> 1_geometry.scad               <for example Nema 17 mount pattern holes, as a 2D pattern
> 2_component                   <say a 3D printed mount for the motor
> 3_subassembly                 <say the mount with motor, screws, pulley etc
> 4_majorassembly               <say the whole axis
> 5_render                      <the whole project for rendering.

Yes, good idea. I think as our projects get more complex we all start creating a fistful of files… and I’m also hoping some day that OpenSCAD will allow for use, include and import to use non literal string values… but that’s another topic. :)

>
>
> This has really helped me to improve version control and ease of navigation around complex projects - and made it easier to recycle code and incorporate scanned or downloaded parts.
>
> Cheers
>
> Alex Gibson
>
> admg consulting
>
> edumaker limited
>
> • Project management
> • Operations & Process improvement
> • 3D Printing
>
> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of Hugo Jackson
> Sent: 29 October 2019 22:00
> To: OpenSCAD general discussion
> Subject: [OpenSCAD] Engineering Fits and Tolerance
>
> Has any thought been given to incorporating engineering fits and tolerances into OpenSCAD? As I understand it, OpenSCAD was originally conceived for the creation of STL files for a 3D printer and I’ve been thinking that the base functionality might be improved by a little more CAM in the CAD.
>
> For some time I’ve been using wrappers around most of the OpenSCAD modules in order to introduce engineering fits into the parts I create as 3d printers on the whole offer increasing precision and repeatability.
>
> Using a special variable $fit I can arbitrarily call up a module and it will adjust the the final size of the geometry according to the engineering fit I specify. e.g.
>
>       cylinder(d = 5, h = 2, $fit = “g6”);
>
> I think anyone who has created interconnecting parts is familiar with the requirement to adjust for tolerance, but the core language as it stands requires this to be accomplished on a piecemeal basis, but to my way of thinking fit and tolerance are integral to the original purpose of OpenSCAD.
>
> I think this is particularly relevant as more and more users are acquiring machines that use different processes and that I might well wish to print a part on an FDM printer one day and a DLP the next, which I think would naturally call for a different fit specification.
>
> I also created some constants: kLeft, kRight, kFront, kBack, kTop & kBottom and use 6 element arrays to selectively apply tolerance, and use a special variable $faces to pass on that information as required:
>
>       cube([7,3,8], $fit = “H11”, $faces = kLeft + kRight);
>
> And of course if I’m creating a project with lots of references to fit then I simply create an identifier for the fit, e.g.
>
> shaftFit = “h7”;
>
> So that if I move to a different type of machine where more or less tolerance is indicated, I only need to change the definition of shaftFit.
>
> I did some poking around in the mailing list archives and couldn’t see any reference to a discussion on this, but I’m sure it’s occurred to others before me, I just thought I’d ask where the community stands on incorporating this kind of functionality into the core language.
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
12