Wednesday, 25 September 2013

6 pistons, two blocks, 6 conrods, 1 crankshaft...

And that's all by the moment:

Screenshots


Conical view:






I was having problems with freecad and I couldn't finish the crankshaft, so I worked on the assembly and mounted what you've seen.

It starts to look like an engine!


6 types of bearing coded, so far!

Current bearing collection:

Deep groove single-row ball bearing:


Deep groove double-row ball bearing:

Detail of internals:


Needle bearing (needles only):


Thrust ball bearing


Cylindrical roller bearing:


Sealed bearing:



 All code has been re-written in order to make easier to create bearings reading their dimensions contained from a file. This way, bearings can be added using the BOLTS  in a easy way. At the moment only an old version of the deep groove ball bearing is included, I have to talk with jreinhardt and see what we do. I have tried to include these bearings into bolts myself, but without result.
Some of this bearings have colours while others are just plain grey. This is something I am stuck with until someones helps me finding a command that allows to change the material/color of a shape
And another thing to do is convert the bearing into a single part. This is possibly what I will do next.
Without forgetting to create more bearings :D

Sorry, I will not upload the code of the bearings until they are concluded.

PD.This post will be edited to add new bearings. 

Bye!


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