PCB genesis大孔加卸力孔實現方法
阿新 • • 發佈:2018-11-14
一.為什麼 大孔中要加小孔(即卸力孔)
這其實跟鑽刀的排屑有關了,當鑽刀越大孔,排屑量也越大(當然這也得跟轉速,下刀速的引數有關係),通常當鑽刀越大,轉速越慢,下刀速也越慢(因為要保證它的排屑通暢)。
這裡科普一下鑽刀的【進刀速度】,【轉速】,【進刀量】之間的關係是怎樣的.
進刀速度、轉速之間的關係對於鑽頭來講,切削量越大,產生的粉塵顆粒就會更大,部分切屑尤其是銅絲,會纏繞到鑽頭,從而嚴重影響孔壁的質量。相應的,切削量越小,在鑽孔時,鑽頭停留在孔內的時間就會越長,產生的鑽汙就會越多。
進刀量、轉速之間的關係 如果轉速太高,會導致線速度增大。從而影響鑽頭的平穩性和動態平衡性。合適的引數可以達到合理的切削性,保證下鑽過程中受力對準度和均勻性。反之會影響孔壁的凹凸度,還會產生滲銅
為了保證大孔的排屑效能好,PCB行業作法是,在鑽大孔之前,提前在大孔中間鑽幾個小孔,先小孔排除一定孔屑,等再鑽大孔時,孔屑變少了。不會再造成大孔排屑不暢。
二.大孔加小孔實現原理
求解方法:(具體可以看下方函式)
1.通過已知大孔6.0mm,小孔與小孔間距:0.2mm
小孔個數,求出最大內切孔尺寸=2.585mm
2.最大內切孔2.585mm,向下取整 鑽刀為2.55mm
3. 求大圓中心到小圓中心距離
(6-0.1*2-2.55)*0.5=1.625mm
4.以大圓為中心,並3個小孔的以圓心角為120度依次旋轉,即可得到3個小圓座標
三.C#簡易程式碼實現:
1.大孔加小孔程式碼
#region 大孔加卸力孔 ydkdrl List<gP> MaxHoleList = glayer.Plist.Where(tt => tt.width >= 3200 && tt.width <= 6300View Code).ToList(); if (MaxHoleList.Count() > 0) { for (int i = 0; i < MaxHoleList.Count; i++) { //求內切孔函式共6引數 大孔尺寸 小孔尺寸 小孔個數 小孔與小孔間距 小孔與大孔間距 旋轉角度 //當小孔尺寸不填,由函式自動計算小孔孔徑,否則以填寫小孔孔徑為準 List<gP> smallHoleList = calc2.p_small_hole_Plist(MaxHoleList[i], 0, 3, 0.2, 0.1,30); addCOM.pad(smallHoleList); } } #endregion
2.計算函式(關鍵在於此函式實現)
/// <summary> /// 求點P【內切圓Plist座標】 /// </summary> /// <param name="p">點P</param> /// <param name="small_hole_size">內切圓尺寸,填寫為0時自動計算</param> /// <param name="small_hole_count">內切圓個數</param> /// <param name="small2small">內切圓與內切圓間距</param> /// <param name="small2big">內切圓與外圓間距</param> /// <param name="ang_rotate">內切圓轉旋角度</param> /// <param name="units">單位:mm/inch</param> /// <returns>返回:【內切圓Plist座標】</returns> public List<gP> p_small_hole_Plist(gP p, double small_hole_size, double small_hole_count = 3, double small2small = 0, double small2big = 0, double ang_rotate = 0) { List<gP> list_p = new List<gP>(); double ang_single, ang_sum, dia_hole; gP tempP; tempP.mirror = false; tempP.attribut = ""; tempP.angle = 0; tempP.negative = false; tempP.symbols = ""; dia_hole = p.width / 1000 - small2big * 2; //units mm p.width = p.width - small2big * 2000; //units um if (small_hole_size < 0.001) small_hole_size = Math.Floor(p_small_hole_size(p, small2small, small_hole_count) / 0.05) * 0.05; //um-->mm ang_single = 360 / small_hole_count; ang_sum = 90 - ang_rotate; for (int i = 0; i <= small_hole_count - 1; i++) { tempP.p = p_val_ang(p.p, (dia_hole - small_hole_size) * 0.5, ang_sum); tempP.width = small_hole_size * 1000; tempP.symbols = "r" + tempP.width.ToString(); ang_sum += ang_single; list_p.Add(tempP); } return list_p; } /// <summary> /// 求點P【最大內切圓尺寸】 /// </summary> /// <param name="p">點P</param> /// <param name="small_hole_space">內切圓與內切圓間距</param> /// <param name="small_hole_count">內切圓個數</param> /// <returns>返回:【內切圓尺寸】</returns> public double p_small_hole_size(gP p, double small_hole_space = 0, double small_hole_count = 3) { double sin_val = Math.Sin(180 / small_hole_count * Math.PI / 180); return (sin_val * p.width * 0.0005 - 0.5 * small_hole_space) / (1 + sin_val) * 2; } /// <summary> /// 求增量座標 /// </summary> /// <param name="ps">起點</param> /// <param name="val">增量值</param> /// <param name="ang_direction">角度</param> /// <returns></returns> public gPoint p_val_ang(gPoint ps, double val, double ang_direction) { gPoint pe; pe.x = ps.x + val * Math.Cos(ang_direction * Math.PI / 180); pe.y = ps.y + val * Math.Sin(ang_direction * Math.PI / 180); return pe; }View Code
3.Point,PAD資料結構
/// <summary> /// PAD 資料型別 /// </summary> public struct gP { public gP(double x_val, double y_val, double width_) { this.p = new gPoint(x_val, y_val); this.negative = false; this.angle = 0; this.mirror = false; this.symbols = "r"; this.attribut = string.Empty; this.width = width_; } public gPoint p; public bool negative;//polarity-- positive negative public double angle; public bool mirror; public string symbols; public string attribut; public double width; public static gP operator +(gP p1, gP p2) { p1.p += p2.p; return p1; } public static gP operator -(gP p1, gP p2) { p1.p -= p2.p; return p1; } } /// <summary> /// 點 資料型別 (XY) /// </summary> public struct gPoint { public gPoint(gPoint p_) { this.x = p_.x; this.y = p_.y; } public gPoint(double x_val, double y_val) { this.x = x_val; this.y = y_val; } public double x; public double y; public static gPoint operator +(gPoint p1, gPoint p2) { p1.x += p2.x; p1.y += p2.y; return p1; } public static gPoint operator -(gPoint p1, gPoint p2) { p1.x -= p2.x; p1.y -= p2.y; return p1; } }View Code
四.大孔加小孔指令碼UI
五.實現效果