跳到主要內容

錐面孔倒角(三)

文章日期:2009-02-19 11:46


現在進入主題--錐面軸向直孔的倒角,倒角之前首先得要瞭解市售的45度外倒角刀,如下圖所示
        
                         

由於軸向直孔壁與錐面兩者之間的夾角是不固定的,所以倒角帶的高度也不固定,如下圖中的C1C2所示,C1是最淺的倒角帶高度,而C2則是最深的倒角帶高度,故使用者輸入之倒角深度hk必需大於C2才行。


倒角方法 :
原本想用省事的方法,以直孔和錐面所形成的交線為基準,然後垂直往外倒0.3C的倒角,不過,此法經仔細推敲之後,發現會造成倒角尺寸不穩定,如下圖所示,原本上圖中的C1是最淺的倒角帶高度,但經此法倒角之後反成最深的倒角帶高度
   

因此,倒角的方法還是要先在上視圖的地方先畫出倒角圓,並以此倒角圓投影下來到錐面上,以求得錐面上的倒角圓曲線上的各個座標,最後再以這些座標向內及向下偏置,以求得銑刀底圓中心的座標,這樣才能得到CNC程式所需的座標點
  
AutoLISP的寫法 :
(defun c:bt()
  (command "color" "bylayer" "")
  (setq   r1 5.0  r2 15.0  h1 5.0  r3 4.0  r0 1.0  h0 3.0  c0 0.5)
  (setq r1 (/ (getreal "\nEnter the top diameter : ") 2 ))
  (setq r2 (/ (getreal "\nEnter the bottom diameter : ") 2 ))
  (setq h1 (getreal "\nEnter the height : "))
  (setq r3 (/ (getreal "\nEnter the diameter of the hole : ") 2 ))
  (setq r0 (/ (getreal "\nEnter the bottom diameter of the chamfer tool : ") 2 ))
  (setq h0 (abs (getreal "\nEnter the chamfering height of the chamfer tool : ")) )
  (setq c0 (getreal "\nEnter the chamfering size : ") 2 )
  (setq  x2 0  y2 0  x22 0   y22 0 )
  (setq  i1 1  cta (/ 3.1415926 180.0)  ctaWk 0  h1 (* -1 (abs h1)) )
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2   (* r1 (cos ctaWk))    y2 (* r1 (sin ctaWk )) )
    (setq x22  (* r2 (cos ctaWk))  y22 (* r2 (sin ctaWk )) )
    (command "line" (list x2 y2 0) (list x22 y22 h1) "" )
    (setq i1 (+ 1 i1))
  )

  (command "zoom" "e" "")
  (command "vpoint" "1,-1,1"  "")


  (setq  delR (- r2 r1) z2 0  x1 0   y1 0 x2 0  y2 0)
  (setq  x11 0   y11 0 z11 0  x22 0   y22 0 z22 0)
  (setq  c1 (/ (+ r1 r2) 2)   s1 (/ (* r1 h1) delR) )
  (setq tanValue (/ h1 delR ))
  (setq  i1 0  ctaWk 0  )
  (command "color" "red" "")
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2 (+ c1 (* r3 (cos ctaWk)))    y2 (+ 0 (* r3 (sin ctaWk))) )
    (setq z2 (- (* (sqrt (+ (* x2 x2) (* y2 y2))) tanValue) s1))
    (setq x22 (+ c1 (* (+ r3 c0) (cos ctaWk)))    y22 (+ 0 (* (+ r3 c0) (sin ctaWk))) )
    (setq z22 (- (* (sqrt (+ (* x22 x22) (* y22 y22))) tanValue) s1))
    (if (> i1 0 )
      (progn
        (command "color" "red" "")
        (command "line" (list x1 y1 z1) (list x2 y2 z2) "" )
        (command "line" (list x11 y11 z11) (list x22 y22 z22) "" )
        (command "line" (list x1 y1 10)   (list x2 y2 10) "" )
        (command "line" (list x11 y11 10)   (list x22 y22 10) "" )
        (if (= (rem i1 6 ) 0 )
           (progn
             (command "color" "green" "")
             (command "line" (list x22 y22 10) (list x22 y22 z2) "" ) ))))
    (setq x1 x2   y1 y2   z1 z2    x11 x22    y11 y22   z11 z22)
    (setq i1 (+ 1 i1))
  )
)
啟動AutoLISP後AutoCAD便可自動畫出如下之圖,圖中紅色內圓是直孔,紅色外圓是倒角用的,有了外圓這些座標後向內及向下偏置,就可求得銑刀底圓中心的座標

   
 
將上述程式修改一下,如下所示,把倒角畫出來,啟動AutoLISP後則可得到下列圖形
   (defun c:bt()
  (command "color" "bylayer" "")
  (setq   r1 5.0  r2 15.0  h1 5.0  r3 4.0  r0 1.0  h0 3.0  c0 0.5)
  (setq r1 (/ (getreal "\nEnter the top diameter : ") 2 ))
  (setq r2 (/ (getreal "\nEnter the bottom diameter : ") 2 ))
  (setq h1 (getreal "\nEnter the height : "))
  (setq r3 (/ (getreal "\nEnter the diameter of the hole : ") 2 ))
  (setq r0 (/ (getreal "\nEnter the bottom diameter of the chamfer tool : ") 2 ))
  (setq h0 (abs (getreal "\nEnter the chamfering height of the chamfer tool : ")) )
  (setq c0 (getreal "\nEnter the chamfering size : ") 2 )
  (setq  x2 0  y2 0  x22 0   y22 0 )
  (setq  i1 1  cta (/ 3.1415926 180.0)  ctaWk 0  h1 (* -1 (abs h1)) )
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2   (* r1 (cos ctaWk))    y2 (* r1 (sin ctaWk )) )
    (setq x22  (* r2 (cos ctaWk))  y22 (* r2 (sin ctaWk )) )
    (command "line" (list x2 y2 0) (list x22 y22 h1) "" )
    (setq i1 (+ 1 i1))
  )
  (command "zoom" "e" "")
  (command "vpoint" "1,-1,1"  "")

  (setq  delR (- r2 r1) z2 0  x1 0   y1 0 x2 0  y2 0)
  (setq  x11 0   y11 0 z11 0  x22 0   y22 0 z22 0  x3 0  y3 0  z3  0)
  (setq  c1 (/ (+ r1 r2) 2)   s1 (/ (* r1 h1) delR) )
  (setq tanValue (/ h1 delR ))
  (setq  i1 0  ctaWk 0  )
  (command "color" "red" "")
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2 (+ c1 (* r3 (cos ctaWk)))    y2 (+ 0 (* r3 (sin ctaWk))) )
    (setq z2 (- (* (sqrt (+ (* x2 x2) (* y2 y2))) tanValue) s1))
    (setq x22 (+ c1 (* (+ r3 c0) (cos ctaWk)))    y22 (+ 0 (* (+ r3 c0) (sin ctaWk))) )
    (setq z22 (- (* (sqrt (+ (* x22 x22) (* y22 y22))) tanValue) s1))
    (if (> i1 0 )
      (progn
        (command "color" "red" "")
        (command "line" (list x1 y1 (- z11 c0)) (list x2 y2 (- z22 c0)) "" )
        (command "line" (list x11 y11 z11) (list x22 y22 z22) "" )
        (command "line" (list x2 y2 (- z22 c0)) (list x22 y22 z22) "" )
         (command "line" (list x11 y11 10)   (list x22 y22 10) "" )
        (if (= (rem i1 6 ) 0 )
           (progn
             (command "color" "green" "")
             (command "line" (list x22 y22 10) (list x22 y22 z22) "" ) ))))
    (setq x1 x2   y1 y2   z1 z2    x11 x22    y11 y22   z11 z22)
    (setq i1 (+ 1 i1))
  )
)
   

   

   

最後得將倒角刀底圓中心的路徑角畫出來驗証看看,再來用AutoLISP寫CNC程式,啟動AutoLISP後則可得到下列圖形 :
   

   

   

AutoLISP程式如下:
(defun c:bt()
  (command "color" "bylayer" "")
  (setq   r1 5.0  r2 15.0  h1 5.0  r3 4.0  r0 1.0  h0 3.0  c0 0.5)
  (setq r1 (/ (getreal "\nEnter the top diameter : ") 2 ))
  (setq r2 (/ (getreal "\nEnter the bottom diameter : ") 2 ))
  (setq h1 (getreal "\nEnter the height : "))
  (setq r3 (/ (getreal "\nEnter the diameter of the hole : ") 2 ))
  (setq r0 (/ (getreal "\nEnter the bottom diameter of the chamfer tool : ") 2 ))
  (setq h0 (abs (getreal "\nEnter the chamfering height of the chamfer tool : ")) )
  (setq c0 (getreal "\nEnter the chamfering size : ") )
  (setq  x2 0  y2 0  x22 0   y22 0 )
  (setq  i1 1  cta (/ 3.1415926 180.0)  ctaWk 0  h1 (* -1 (abs h1)) )
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2   (* r1 (cos ctaWk))    y2 (* r1 (sin ctaWk )) )
    (setq x22  (* r2 (cos ctaWk))  y22 (* r2 (sin ctaWk )) )
    (command "line" (list x2 y2 0) (list x22 y22 h1) "" )
    (setq i1 (+ 1 i1))
  )
  (command "zoom" "e" "")
  (command "vpoint" "1,-1,1"  "")

  (setq  delR (- r2 r1) z2 0  x1 0   y1 0 x2 0  y2 0  x3 0  y3 0  z3  0  x4 0  y4 0)
  (setq  x11 0   y11 0 z11 0  x22 0   y22 0 z22 0  x33 0  y33 0  z33  0  x44 0 y44 0)
  (setq  c1 (/ (+ r1 r2) 2)   s1 (/ (* r1 h1) delR) )
  (setq tanValue (/ h1 delR ))
  (setq  i1 0  ctaWk 0  )
  (command "color" "red" "")
  (while (< i1 361)
    (setq ctaWk (* cta i1))
    (setq x2 (+ c1 (* r3 (cos ctaWk)))    y2 (+ 0 (* r3 (sin ctaWk))) )
    (setq z2 (- (* (sqrt (+ (* x2 x2) (* y2 y2))) tanValue) s1))
    (setq x22 (+ c1 (* (+ r3 c0) (cos ctaWk)))    y22 (+ 0 (* (+ r3 c0) (sin ctaWk))) )
    (setq z22 (- (* (sqrt (+ (* x22 x22) (* y22 y22))) tanValue) s1))
    (setq x33 (+ c1 (* (- (+ r3 c0) h0) (cos ctaWk)))  y33 (+ 0 (* (- (+ r3 c0) h0 ) (sin ctaWk))) )
    (setq x44 (+ c1 (* (- (+ r3 c0) r0 h0) (cos ctaWk)))  y44 (+ 0 (* (- (+ r3 c0) r0 h0) (sin ctaWk))) )
    (setq z33 (- z22 h0) )
    (if (> i1 0 )
      (progn
        (command "color" "red" "")
        (command "line" (list x1 y1 (- z11 c0)) (list x2 y2 (- z22 c0)) "" )
        (command "line" (list x11 y11 z11) (list x22 y22 z22) "" )
        (command "line" (list x2 y2 (- z22 c0)) (list x22 y22 z22) "" )
        (command "line" (list x3 y3 z33) (list x33 y33 z33) "" )
        (command "line" (list x4 y4 z33) (list x44 y44 z33) "" )
        (if (= (rem i1 5 ) 0 )
           (progn
             (command "color" "green" "")
             (command "line" (list x33 y33 z33)   (list x22 y22 z22) "" )   ))))
    (setq x1 x2   y1 y2   z1 z2    x11 x22    y11 y22   z11 z22  x3 x33   y3 y33  x4 x44  y4 y44)
    (setq i1 (+ 1 i1))
  )
)
篇幅所限,下篇文章再來寫如何用AutoLISP寫CNC程式
http://tw.myblog.yahoo.com/cu01joe/article?mid=1997&prev=2091&next=1970

留言

這個網誌中的熱門文章

管牙PT

文章日期:2009-07-12 23:08 本文旨在講解 PT錐度管牙 常見的標準的管牙規範計有:  NPT , NPTF ,NPS , PS ,PF , PT.. ,前3者有N開頭的是美國標準的管牙 ,牙角(又稱螺紋角)60度 ,後面這3者則是英國標準的管牙 ,牙角55度 ,這些代號裡面的T意指Taper ,也就是錐度牙 。 不論是PT還是NPT,他們的錐度值都是1/16, 換算成角度值是 2*tan-1(0.5/16)=3.57982度 = 3度34分47.356秒, 3.57982度為什麼等於3度34分47.356分呢? 這是因為角度的單位換算是六十進位,3.5798212度後面的小數點0.5798212"度"要換算成""分"時,0.5798212度 = 0.57982*60分 = 34.789273分 ,而34.789273分後面的小數點0.789273分要換算成秒, 則0.789273*60秒 = 47.356秒。 此外,切記在車削錐牙時得採半錐角,也就是1度47分23.7秒。 NPT (美制管用推拔螺紋) 制定在 ANSI 規格中,稱為美國標準管用推拔螺紋,有外螺紋與內螺紋。 NPT 外螺紋不但對 NPT 內螺紋配合,有時也配合 NPSC ,這點類似 PT 。螺紋峰與根切成同形,又因公差大,餘隙、緊密兩種配合都可用。如用潤滑劑,則變成耐密用,耐密用者另有稱為乾封閉之如 NPTF,NPSF 等付有 F 之一群。 NPTF (美制管用耐密推拔螺紋) NPTF 外螺紋,像 PT.NPT 有時也配合 NPSF.NPSI (都是內螺紋)。因這種螺紋都是峯尖、根淺,峯不是密接於根就是食進,可防止在此部分變成螺旋狀間隙,這是前述耐密性之理由。 PT( 英制管用推拔螺紋 ) 以前是使用面直角的螺紋峯,現在將規格統一為軸直角者。 JIS 定為耐密用而組合外螺紋和內螺紋。 PT 外螺紋除了配合 PT 內螺紋,有時也配合 PS 。 PS ( 英制管用推拔螺紋用平行內螺紋   ─   耐密用 )     屬於 JIS 內 PT 的規格,舊 JIS 裏 PS 牙的外螺紋已被取消,配合的外螺紋現規定要用 PT 。 PF( 英制管用平行螺紋   ─  

G76車牙

文章日期:2008-10-10 00:02 工具機若使用 Fanuc 控制器,車牙轉速有一個先天上的限制: S × P < 4000 請參考 車牙的 NC 碼計有 G32 、 G92 、 G76 三種 ( 使用方法 這三個指令中,手寫 G92 一般是直進式切削,牙刀的兩刃皆受力,直進式切削 ,每刀吃深不多,以免造成牙面粗糙,反觀 G76 則是斜進式單邊車削 ,可以有較大的進刀深度 , 寫法也簡短方便廣受採用,不論多大的牙, G76 只要兩個單節就可解決了。 由於 G76 有單邊切削的效果,廣受學校或職訓單位的喜愛,如下圖所示。         Fanuc0T系列控制器之G76 格式如下 : 指令說明 (m) : 精車次數。 (r) : 車牙末端 拔刀時留下的不完全牙長度(倍率)。 (a) :牙刀之角度,可選擇 80 °、 60 °、 55 °、 30 °、 29 °、 0 °等角度。 Q( △ dmin) :最小進刀深度。 R(d) :精車預留量。 X(u) :螺紋程式終點的 X 軸方向座標。 Z(w) :螺紋程式終點的 Z 軸方向座標。 R(i) :螺紋部份的半徑差,如果 I=0 可作一般直線螺紋車削。 P(k) :螺紋高度即牙深度, K 為正值在 X 軸方向用半徑值指定。 Q( △ d) :第一次螺紋的切削深度,用半徑值指定。 F(l) :螺紋的導程,與 G32 相同。 以M20X2.5外螺紋為例 , 常見的寫法如下 : G76 P01 00 60 Q40 R0.02 G76 X16.933 Z-10.0  P1533    Q500   F2.5 1. G76第一行的 P01 00 60 ,這01表示最後精車時只車一刀精車, 00 表示車牙最後拔刀時不留倒角 ,此所謂之倒角是 不完全牙之意 ,亦即因拔刀而在工件上留下牙深較淺的牙 ,Fanuc的拔刀精度是0.1倍的導程 , 若是此值改成10,則表示拔刀時在軸向會留下一倍導程長度的不完全牙,這一倍就是指導程2.5的一倍,也就是不完全牙會有2.5mm那麼長, 60 表示要車的牙角是 60 度 , G76 所 適應的刀角範圍不但很大, Fanu

CNC的S及F

文章日期:2008-01-25 23:25 刀片的損耗與 S 碼及冷卻潤滑較有關,機台的負載則跟 F 碼與機台剛性及馬力較相關,講到 CNC 的 S 及 F 碼,就一定要先講切削刀具, CNC 切削用的刀具常分為整體型及捨棄式刀片型,整體型刀具材質大都是高速鋼類 (HSS) 或鎢鋼類,捨棄式刀片型刀具材質大都是碳化鎢類 (WC) ,這些刀具表面常鍍上耐磨材料在刀刃及刀面上,以增加刀具壽命;常用的整體型刀具以端銑刀為代表,常用的捨棄式刀片型刀具以面銑刀車刀搪刀或快速鑽為代表。  CNC車床的 S 碼有兩種使用方法  : 1. 切削米速 (m/min) ,與 G96 合用,在公式裡的代號是 V ,一般刀具商都會提供這個建議數據,但是在實際使用上通常要先打半折來當起始米速。 2. 主軸轉速 (RPM 或 rev/min) ,與 G97 合用,公式裡的代號是 N ,切削米速與主軸轉速兩者之間可以換算 (CNC 銑床的 S 碼則常內定為後者,不需要再用 G 碼切換 ) 。 CNC的 F 碼是指進給,也有兩種使用方法  : 1. 每分鐘車刀移動距離 mm/min( 或是銑床床台每分鐘移動距離 ) ,此法單純只指車刀或床台的移動,與主軸並沒有連動的關係,在公式裡的代號是 F 。 2. 車工工件每轉之下車刀移動距離 mm/rev ,此法之主軸刀塔有連動的關係,使用在 CNC 銑床的意義為  :  銑刀每轉之下銑床床台移動之距離 (mm/rev) ,銑刀與車刀不盡相同,銑刀通常是多刀刃,所以銑刀每轉之床台移動距離若再除以銑刀刃數,就可以得到每刃每轉之下的切削量,在本文中所使用的公式代號是 f 。 CNC的 S 碼跟刀具壽命有最直接的關係,而 CNC 的 F 碼則與銑刀及機台承受能力有最直接的關係,主軸轉速過高會耗損刀具壽命,進給過快則銑刀崩裂或斷掉,甚至機台耗損,尤其是近年來台灣製造的 CNC 車床搭配 Fanuc 的伺服馬達,若內無附減速齒輪機構,對於大直徑工件 (500mm 直徑 ) 在低轉速大進給之下車削,主軸的負載會飆升,長時間加工會加速機台耗損。 ★ CNC 銑床主軸轉速的計算  :  主軸轉速 N=1000*V / (3.14*D) D: 指銑刀的直徑 (mm)  , V: 刀片的