main
John Lauer
Integrate output-locked I2C diagnostics and conservative measurement age; retain mounting qualification limits
26c2c4b
"""Rigid 2D tilted-screw sensitivity; not a toleranced assembly qualification."""
import math,json
from pathlib import Path
def clearance(tab,stem,bore,od,screw):
if min(tab,stem,bore,od,screw)<=0 or bore<=screw or od<=bore:raise ValueError('invalid geometry')
lo,hi=0.,math.pi/2-1e-8
for _ in range(80):
a=(lo+hi)/2
if stem*math.tan(a)+screw/math.cos(a)>bore:hi=a
else:lo=a
angle=(lo+hi)/2
# Sleeve can translate until its OD contacts the tab hole. Screw then tilts
# within the sleeve's bore. Hole diameter cancels from the radial margin.
margin=(od-bore)/2-max(0,tab-stem)*math.tan(angle)
return {'maximumTiltDegrees':math.degrees(angle),'remainingRadialMarginMm':margin}
if __name__=='__main__':
rows=[]
for screw in [2.8448,2.75,2.6]:
rows.append({'screwDiameterMm':screw,**clearance(1.4,.81,2.95,3.43,screw)})
r={'status':'nominal-centering-sensitivity-only','acceptance':False,'washer':'7721-7PPSG',
'assumptions':{'tabMaxMm':1.4,'stemLengthMm':.81,'boreMm':2.95,'stemODMm':3.43,
'screwDiameters':'2.8448 mm is nominal #4 diameter; smaller values are sensitivity inputs, not sourced thread tolerances'},
'model':'Rigid straight cylindrical screw in a straight concentric sleeve; sleeve translates to tab-hole wall; full angular fit includes screw diameter / cos(theta).',
'rows':rows,'limitations':['Thread roots and discontinuous crests are not a solid cylinder','No washer tolerances, deformation, wear, molding flash or eccentricity','No flange/tool access, pad insulation, pressure or torque verification']}
Path(__file__).resolve().parents[1].joinpath('mechanical/short-sleeve-sensitivity.json').write_text(json.dumps(r,indent=2)+'\n')
print(json.dumps(rows,indent=2))