discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Engineering Fits and Tolerance

AG
Alex Gibson
Thu, Oct 31, 2019 7:36 PM

@nophead -  sorry to perpetuate any confusion through my use of ‘g6’ – I am an untrained engineer and do not know ISO 286 backwards, the term had not intrinsic meaning to me - although this has given me a chance to read up and it all makes sense.

So I just copy-pasted g6 as any other variable, as in “you just use d= g6 by name “ - whoops.  My real aim was to show how multiple different modifiers can be placed on a single dimension, and that the code /within the part design/ could be cleaner for it.

Hugo - I think there are 2 issues still being conflated, unless I’ve misunderstood.

  1.  Use of OpenSCAD as a CAD tool, to create designs, within which it is possible to communicate tolerances, even though you can only render one at a time.
    
  2.  Use of OpenSCAD as a CAM pre-processor, to generate a ‘corrected’ output mesh, which when one prints it on a specific, well known 3D printer or other machine, whose vagaries and tolerances are well tested, you can achieve a final, measured part that is closer to the ‘nominal’ design than you could achieve using the CAM tools that come with the machine.
    

In context of 1) I think your idea of being able to label a dimension with a tolerance value is a very good one.  It is a ‘hidden dimension’ unless there is a way to surface it – for example in CAD drawings – there have been a few libraries written to help label dimensions in OpenSCAD.

However – I think it’s best to separate out these two concerns.  Engineering fit is – to my limited layman’s understanding – mainly about how two parts interact with one another.

ISO 286 specifies a series of standard fits, and their universally agreed tolerances: https://www.engineersedge.com/calculators/mechanical-tolerances/table_hole_tolerances.htm

As nophead said, good luck getting a 3D printer to conform to these, and as you mentioned, actually it’s possible for larger diameters.

But neither of these helps get a more accurate part from a 3D printer which, after you have exhausted all options to calibrate it AND used the settings in a good slicer, still produces ‘inaccurate’ parts by modern engineering standards.

Well built 3D printers are usually at least predictably inaccurate – and as I tried to demonstrate, it is often possible to apply a corrective ‘filter’ to dimensions, and achieve a print that is closer to perfect.  This is something I do quite a bit and can work very well, but I consider this to be CAM pre-processing for that machine, there’s nothing universal about it.    It’s a correction which gets the 3D printed parts a bit closer to being able to achieve the coarsest of the standardised engineer’s fit tolerances.  Ideally this would be something more strongly handled within the slicer, and there would be no need to fudge things in OpenSCAD.

FDM 3D printing many prototypes for engineers who will then go on to make the parts via other CAM processes, I think that having a set of standard print tolerances, that fits into the scale of ISO286 tolerances would be a good thing, and help prevent any surprises going from 3D printed prototype to precision milled parts, which could negate the value of prototyping in plastic in extreme cases…

The ‘hidden’ tolerance value could potentially be used in metrology – to drive a measuring device to check the dimensions and confirm they’re within the ranges specified in the OpenSCAD script?

Cheers,

Alex Gibson

admg consulting

edumaker limited

·        Project management

·        Operations & Process improvement

·        3D Printing

From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of nop head
Sent: 31 October 2019 18:20
To: OpenSCAD general discussion
Subject: Re: [OpenSCAD] Engineering Fits and Tolerance

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 hugo@apres.net wrote:

On Oct 31, 2019, at 4:28 AM, Alex Gibson alex@alexgibson.net 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:discuss-bounces@lists.openscad.org] 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
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

@nophead - sorry to perpetuate any confusion through my use of ‘g6’ – I am an untrained engineer and do not know ISO 286 backwards, the term had not intrinsic meaning to me - although this has given me a chance to read up and it all makes sense. So I just copy-pasted g6 as any other variable, as in “you just use d= g6 by name “ - whoops. My real aim was to show how multiple different modifiers can be placed on a single dimension, and that the code /within the part design/ could be cleaner for it. Hugo - I think there are 2 issues still being conflated, unless I’ve misunderstood. 1) Use of OpenSCAD as a CAD tool, to create designs, within which it is possible to communicate tolerances, even though you can only render one at a time. 2) Use of OpenSCAD as a CAM pre-processor, to generate a ‘corrected’ output mesh, which when one prints it on a specific, well known 3D printer or other machine, whose vagaries and tolerances are well tested, you can achieve a final, measured part that is closer to the ‘nominal’ design than you could achieve using the CAM tools that come with the machine. In context of 1) I think your idea of being able to label a dimension with a tolerance value is a very good one. It is a ‘hidden dimension’ unless there is a way to surface it – for example in CAD drawings – there have been a few libraries written to help label dimensions in OpenSCAD. However – I think it’s best to separate out these two concerns. Engineering fit is – to my limited layman’s understanding – mainly about how two parts interact with one another. ISO 286 specifies a series of standard fits, and their universally agreed tolerances: https://www.engineersedge.com/calculators/mechanical-tolerances/table_hole_tolerances.htm As nophead said, good luck getting a 3D printer to conform to these, and as you mentioned, actually it’s possible for larger diameters. But neither of these helps get a more accurate part from a 3D printer which, after you have exhausted all options to calibrate it AND used the settings in a good slicer, still produces ‘inaccurate’ parts by modern engineering standards. Well built 3D printers are usually at least predictably inaccurate – and as I tried to demonstrate, it is often possible to apply a corrective ‘filter’ to dimensions, and achieve a print that is closer to perfect. This is something I do quite a bit and can work very well, but I consider this to be CAM pre-processing for that machine, there’s nothing universal about it. It’s a correction which gets the 3D printed parts a bit closer to being able to achieve the coarsest of the standardised engineer’s fit tolerances. Ideally this would be something more strongly handled within the slicer, and there would be no need to fudge things in OpenSCAD. FDM 3D printing many prototypes for engineers who will then go on to make the parts via other CAM processes, I think that having a set of standard print tolerances, that fits into the scale of ISO286 tolerances would be a good thing, and help prevent any surprises going from 3D printed prototype to precision milled parts, which could negate the value of prototyping in plastic in extreme cases… The ‘hidden’ tolerance value could potentially be used in metrology – to drive a measuring device to check the dimensions and confirm they’re within the ranges specified in the OpenSCAD script? Cheers, Alex Gibson admg consulting edumaker limited · Project management · Operations & Process improvement · 3D Printing From: Discuss [mailto:discuss-bounces@lists.openscad.org] On Behalf Of nop head Sent: 31 October 2019 18:20 To: OpenSCAD general discussion Subject: Re: [OpenSCAD] Engineering Fits and Tolerance 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 <hugo@apres.net> wrote: > On Oct 31, 2019, at 4:28 AM, Alex Gibson <alex@alexgibson.net> 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:discuss-bounces@lists.openscad.org] 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 > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org _______________________________________________ OpenSCAD mailing list Discuss@lists.openscad.org http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
NH
nop head
Thu, Oct 31, 2019 7:44 PM

But again I think you mix up tolerance and clearance. When a part has an
ISO tolerance like g12 it is a specification that says the size will be in
a range. How can you create an STL that represents a range? It can only
represent a target size.

What would the target be?

On Thu, 31 Oct 2019 at 18:42, Hugo Jackson hugo@apres.net wrote:

On Oct 31, 2019, at 11:19 AM, nop head nop.head@gmail.com 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 hugo@apres.net wrote:

On Oct 31, 2019, at 4:28 AM, Alex Gibson alex@alexgibson.net 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:discuss-bounces@lists.openscad.org] 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.

But again I think you mix up tolerance and clearance. When a part has an ISO tolerance like g12 it is a specification that says the size will be in a range. How can you create an STL that represents a range? It can only represent a target size. What would the target be? On Thu, 31 Oct 2019 at 18:42, Hugo Jackson <hugo@apres.net> wrote: > > On Oct 31, 2019, at 11:19 AM, nop head <nop.head@gmail.com> 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 <hugo@apres.net> wrote: > >> >> > On Oct 31, 2019, at 4:28 AM, Alex Gibson <alex@alexgibson.net> 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:discuss-bounces@lists.openscad.org] 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 >> > Discuss@lists.openscad.org >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > >> > >> > _______________________________________________ >> > OpenSCAD mailing list >> > Discuss@lists.openscad.org >> > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
HJ
Hugo Jackson
Thu, Oct 31, 2019 8:45 PM

On Oct 31, 2019, at 12:44 PM, nop head nop.head@gmail.com wrote:

But again I think you mix up tolerance and clearance. When a part has an ISO tolerance like g12 it is a specification that says the size will be in a range. How can you create an STL that represents a range? It can only represent a target size.

What would the target be?

After I’ve done all the bed levelling and z-level adjustment and extrusion width compensation and god knows what other tweaking is required I print off a cube. I then use a micrometer to measure the width, depth and height of the cube in 9 different places for a total of 27 different readings.
I enter this information in a spreadsheet and calculate the min and max values to determine the amount of compensation needed for each axis. I then use the M92 gcode to provide axis compensation aiming to have a centre point with equal tolerance on each side… e.g. 15mm +/- .3mm… after having done that I reprint the cube to ensure that everything worked as expected and then I’m finally ready to start printing.

So the short answer is, the dimensioning of the geometry in the STL file is the mid-point of the tolerance range for the specified engineering fit. If the tolerance range for a given fit is greater than the tolerance range that a printer can produce then I find that more often than not I am producing 3D printed parts within the tolerance range of the ISO standard I have specified for geometries within the part, and I’m able to produce those parts reliably and consistently across a number of different machines.

Of course, no printer bats a thousand, it just takes a little blob to throw the tolerance for that face in one print totally out of whack, but that in and of itself is not uncommon in regular machining… and if one really wants to get picking you can implement go/no-go quality control etc.

I’ve never used or even investigated firms like Shapeways or any of these other places that will do your 3d printing for you, but my assumption would be that they would be offering clearer guidance for submission than simply, “you’ll want to oversize your holes slightly if you intend for a shaft to be inserted”.

> On Oct 31, 2019, at 12:44 PM, nop head <nop.head@gmail.com> wrote: > > But again I think you mix up tolerance and clearance. When a part has an ISO tolerance like g12 it is a specification that says the size will be in a range. How can you create an STL that represents a range? It can only represent a target size. > > What would the target be? After I’ve done all the bed levelling and z-level adjustment and extrusion width compensation and god knows what other tweaking is required I print off a cube. I then use a micrometer to measure the width, depth and height of the cube in 9 different places for a total of 27 different readings. I enter this information in a spreadsheet and calculate the min and max values to determine the amount of compensation needed for each axis. I then use the M92 gcode to provide axis compensation aiming to have a centre point with equal tolerance on each side… e.g. 15mm +/- .3mm… after having done that I reprint the cube to ensure that everything worked as expected and then I’m finally ready to start printing. So the short answer is, the dimensioning of the geometry in the STL file is the mid-point of the tolerance range for the specified engineering fit. If the tolerance range for a given fit is greater than the tolerance range that a printer can produce then I find that more often than not I am producing 3D printed parts within the tolerance range of the ISO standard I have specified for geometries within the part, and I’m able to produce those parts reliably and consistently across a number of different machines. Of course, no printer bats a thousand, it just takes a little blob to throw the tolerance for that face in one print totally out of whack, but that in and of itself is not uncommon in regular machining… and if one really wants to get picking you can implement go/no-go quality control etc. I’ve never used or even investigated firms like Shapeways or any of these other places that will do your 3d printing for you, but my assumption would be that they would be offering clearer guidance for submission than simply, “you’ll want to oversize your holes slightly if you intend for a shaft to be inserted”.
NH
nop head
Thu, Oct 31, 2019 9:00 PM

So basically you are just using the nominal clearance value for the fit,
not the tolerance specification.

I think it would be a bit odd to bake this into OpenSCAD. It can just be
done with a library of functions.

On Thu, 31 Oct 2019 at 20:46, Hugo Jackson hugo@apres.net wrote:

On Oct 31, 2019, at 12:44 PM, nop head nop.head@gmail.com wrote:

But again I think you mix up tolerance and clearance. When a part has an

ISO tolerance like g12 it is a specification that says the size will be in
a range. How can you create an STL that represents a range? It can only
represent a target size.

What would the target be?

After I’ve done all the bed levelling and z-level adjustment and extrusion
width compensation and god knows what other tweaking is required I print
off a cube. I then use a micrometer to measure the width, depth and height
of the cube in 9 different places for a total of 27 different readings.
I enter this information in a spreadsheet and calculate the min and max
values to determine the amount of compensation needed for each axis. I then
use the M92 gcode to provide axis compensation aiming to have a centre
point with equal tolerance on each side… e.g. 15mm +/- .3mm… after having
done that I reprint the cube to ensure that everything worked as expected
and then I’m finally ready to start printing.

So the short answer is, the dimensioning of the geometry in the STL file
is the mid-point of the tolerance range for the specified engineering fit.
If the tolerance range for a given fit is greater than the tolerance range
that a printer can produce then I find that more often than not I am
producing 3D printed parts within the tolerance range of the ISO standard I
have specified for geometries within the part, and I’m able to produce
those parts reliably and consistently across a number of different machines.

Of course, no printer bats a thousand, it just takes a little blob to
throw the tolerance for that face in one print totally out of whack, but
that in and of itself is not uncommon in regular machining… and if one
really wants to get picking you can implement go/no-go quality control etc.

I’ve never used or even investigated firms like Shapeways or any of these
other places that will do your 3d printing for you, but my assumption would
be that they would be offering clearer guidance for submission than simply,
“you’ll want to oversize your holes slightly if you intend for a shaft to
be inserted”.


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

So basically you are just using the nominal clearance value for the fit, not the tolerance specification. I think it would be a bit odd to bake this into OpenSCAD. It can just be done with a library of functions. On Thu, 31 Oct 2019 at 20:46, Hugo Jackson <hugo@apres.net> wrote: > > > > On Oct 31, 2019, at 12:44 PM, nop head <nop.head@gmail.com> wrote: > > > > But again I think you mix up tolerance and clearance. When a part has an > ISO tolerance like g12 it is a specification that says the size will be in > a range. How can you create an STL that represents a range? It can only > represent a target size. > > > > What would the target be? > > After I’ve done all the bed levelling and z-level adjustment and extrusion > width compensation and god knows what other tweaking is required I print > off a cube. I then use a micrometer to measure the width, depth and height > of the cube in 9 different places for a total of 27 different readings. > I enter this information in a spreadsheet and calculate the min and max > values to determine the amount of compensation needed for each axis. I then > use the M92 gcode to provide axis compensation aiming to have a centre > point with equal tolerance on each side… e.g. 15mm +/- .3mm… after having > done that I reprint the cube to ensure that everything worked as expected > and then I’m finally ready to start printing. > > So the short answer is, the dimensioning of the geometry in the STL file > is the mid-point of the tolerance range for the specified engineering fit. > If the tolerance range for a given fit is greater than the tolerance range > that a printer can produce then I find that more often than not I am > producing 3D printed parts within the tolerance range of the ISO standard I > have specified for geometries within the part, and I’m able to produce > those parts reliably and consistently across a number of different machines. > > Of course, no printer bats a thousand, it just takes a little blob to > throw the tolerance for that face in one print totally out of whack, but > that in and of itself is not uncommon in regular machining… and if one > really wants to get picking you can implement go/no-go quality control etc. > > I’ve never used or even investigated firms like Shapeways or any of these > other places that will do your 3d printing for you, but my assumption would > be that they would be offering clearer guidance for submission than simply, > “you’ll want to oversize your holes slightly if you intend for a shaft to > be inserted”. > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >