Tuesday, 24 September 2013

New Bearings!

Things have speed up this days!

Because of the association with jreinhardt at freecad forum, things are accelerating. At the moment, this are the new type of bearings (code at footer)

Needle Bearing



Needle bearing detail



Axial thrust bearing


To stay up to date and get the last code or project state, go to the Freecad forum

BEARING CODE:

Axial thrust bearing----------- Function: ATB(outer radius, inner radius, bearing width)

import Part
import math

def ATB(rout,rin, bth):
  fth=0.3*bth  #Thrust plate widh 
  #Edge fillet value 
  if rout<70:
    RR=1
  else:
    RR=1.5
  #shapes--
  #shapes=[]
  #Lower ring--------------------------
  lr1=Part.makeCylinder(rout,fth)
  lr2=Part.makeCylinder(rin,fth)
  lr=lr1.cut(lr2)
  lre=lr.Edges
  lr=lr.makeFillet(RR,lre)
  #Upper ring--------------------------
  ur1=Part.makeCylinder(rout,fth)
  ur2=Part.makeCylinder(rin,fth)
  ur=ur1.cut(ur2)
  ure=ur.Edges
  ur=ur.makeFillet(RR,ure)
  #Positioning Vector
  Vur=(0,0,bth-fth)
  ur.translate(Vur)
  #Balltracks---------------------------
  tbigradius=((rout-rin)/2.00)+rin
  tsmradius=(bth/2.00)-(0.75*fth)
  Vtorus=(0,0,bth/2.00)
  torus=Part.makeTorus(tbigradius,tsmradius)
  #Positioning vector
  torus.translate(Vtorus)
  #Booleans------------------------------
  lr=lr.cut(torus)
  ur=ur.cut(torus)
  Part.show(lr)
  Part.show(ur) 
  #shapes.append(ur)
  #shapes.append(lr)
  #Balls--------------------------------
  RBall=tsmradius
  CBall=tbigradius
  #Ball number (constant multiplied by radius and rounded)
  NBall=(2*math.pi*CBall)/(2*RBall)
  NBall=math.floor(NBall)
  NBall=NBall*0.9 
  NBall=int(NBall)
  #Ball creator
  for i in range (NBall):  
    Ball=Part.makeSphere(RBall)
    Alpha=(i*2*math.pi)/NBall  
    BV=(CBall*math.cos(Alpha),CBall*math.sin(Alpha),bth/2.00) 
    Ball.translate(BV) 
    Part.show(Ball)
    #shapes.append(Ball)
    
  #BearingAT=Part.Compund(shapes)
  #Part.show(BearingAT)
  Gui.SendMsgToActiveView("ViewFit")


Needle Bearing--------------- Function: NB(outer radius, inner radius, length)

import Part
import math
def NB(rout,rin,bth):
    rnd=(rout-rin)/2.00
    cnd=((rout-rin)/2)+rin
    nnd=2*math.pi*cnd/(1.8*2*rnd) #Needle number
    nnd=math.floor(nnd)
    nnd=int(nnd)   
    #needle cage--------------
    ncrout=cnd+0.175*(rout-rin)
    ncrin=cnd-0.175*(rout-rin)
    nc1=Part.makeCylinder(ncrout,bth)
    nc2=Part.makeCylinder(ncrin,bth)
    nc=nc1.cut(nc2)
    #needle space on the cage-
    rsnd=rnd*1.2
    thsnd=bth*0.8
    for i in range(nnd):
      snd=Part.makeCylinder(rsnd,thsnd)
      Alpha=(i*2*math.pi)/nnd
      nv=(cnd*math.cos(Alpha),cnd*math.sin(Alpha),0.1*bth)
      snd.translate(nv)
      nc=nc.cut(snd)      
    #Needle creation----------
    for i in range(nnd):
      nd=Part.makeCylinder(rnd,thsnd)
      Alpha=(i*2*math.pi)/nnd
      nv=(cnd*math.cos(Alpha),cnd*math.sin(Alpha),0.1*bth)
      nd.translate(nv)
      Part.show(nd)
    Part.show(nc)
    Gui.SendMsgToActiveView("ViewFit")


All this scripts have the same philosophy than the explained in the bearing script 1 post. 
The needle bearing is the more particular one because it carves the space for the needle in the ring and then creates the needle in that space. But this is nothing new, just a different combination of the same. Because of this there will not be a detailed guide for bearings until there is one that really needs of it. 




In the engine part, I have worked in a new crankshaft. Not finished, but the major part is done.

Stay tuned :D