Definition of nut sizes is inconsistent

There are three nut cut-out modules defined in utilities.scad, they are nut(), nut_from_bottom() and nut_y(), and others defined elsewhere nut_trap_and_slot(), m3_nut_trap_with_shaft() and clamping_bolt_and_nut().

The first three nut modules have the same comment on a fudge parameter: "//fudge: multiply the diameter by this number (1.22 works when vertical) However the three modules have different definitions of the radius of the cylinder used to get the nut using $fn=6 from the nominal screw diameter:
nut() has r=d/2*1.05*(fudge+1)/2
nut_from_bottom() has r=0.9*d*fudge
nut_y() has r=0.9*d*fudge
All three define the nut height as 0.8*d if it is not otherwise defined

nut_trap_and_slot() defines the bottom of the nut trap from a slot width that is an input parameter, and the top as r2 = r*squeeze; //top of nut trap is very tight. r is an input parameter which in use is put as the nominal screw diameter (not radius).

The DIN934 standard specifies the maximum across flat size (AF) and nut height (t) for different nominal thread diameter d, from which we can calculate the scale factor t/d, the diameter of the circle circumscribing the nut corners D_C, and the scale factor of the radius of the circle 1/2 D_C/d:

Thread M1 M1.3 M1.4 M1.6 M2 M2.5 M3 M3.5 M4 M5 M6 M7
pitch 0.25 0.25 0.30 0.35 0.40 0.45 0.50 0.60 0.70 0.80 1.00 1.00 mm
max thickness 0.80 1.00 1.20 1.30 1.60 2.00 2.40 2.80 3.20 4.00 5.00 5.50 mm
max AF 2.50 3.00 3.00 3.20 4.00 5.00 5.50 6.00 7.00 8.00 10.00 11.00 mm
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- ----- ------
t / d 0.800 0.769 0.857 0.813 0.800 0.800 0.800 0.800 0.800 0.800 0.833 0.786 factor
AF/d 2.500 2.308 2.143 2.000 2.000 2.000 1.833 1.714 1.750 1.600 1.667 1.571 factor
D_C 2.89 3.46 3.46 3.70 4.62 5.77 6.35 6.93 8.08 9.24 11.55 12.70 mm
1/2 D_C/d 1.44 1.33 1.24 1.15 1.15 1.15 1.06 0.99 1.01 0.92 0.96 0.91 factor

From this:

  • The nut height factor is nearly constant at 0.8*d for all sizes we might use, although this is a little small if we wanted to use M6.
  • The nut AF factor varies considerable over the range of nut sizes, but is far from 0.9*d for the M3 nuts that we actually use. 1.05*d used in nut() is better, but still just a little small. The fudge factor of 1.22 recommended gives 1.22*0.9*d (nearly 1.1*d) which is big enough for M3 with a little tolerance, but it seems an odd way to define the size instead of the nominal diameter (1.06) and a smaller loosening factor (1.35) 1.035*1.06*d
  • The implementation of fudge in nut() is odd, it halves the difference in the factor from 1 for some reason.
  • In nut_trap_and_slot() no part of the trap is supposed to be the size of the nut, but, if squeeze=1 the top of the nut trap is already smaller than the nominal nut size for M3.

The module clamping_bolt_and_nut() in locking_dovetail.scad again gets to the same number by the direct route r=3*1.1

Looking at the DIN table there is not a simple function to define the AF size of a nut. It feels as though it should be a look-up table defined as a function in microscope parameters.

Alternatively we specify that these functions are m3 and remove the parameterisation on d.

Searching for uses of the modules:

nut() is called with fudge=1.2 for the gears, and with fudge not specified (so default fudge=1.18) in the electronics drawer (noted as being rather tight in #290 (closed) and !234 (merged))
nut_from_bottom() is not actually used anywhere.
nut_y() is only used in fitting_wedge_cutout(), the nut slot for optics modules and camera platforms.
nut_trap_and_slot()is used in the actuator and used to define m3_nut_trap_with_shaft() which is widely used.

Edited by William Wadsworth