// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, // EXPRESSED OR IMPLIED. /* Dieses ULP berechnet alle Signallaengen eines Layouts * (nur Layer 1 bis 16) und die zugehoerige Frequenz (f=c/l) * und erzeugt eine Textdatei LENGTH-RI.TXT, die alle Signale nach * Frequenz bzw Laenge sortiert enthaelt. * Bei der Frequenzberechnung handelt es sich um eine ganz einfache * Umrechnung, die eine erste Abschaetzung bzgl. Stoerstrahlung erlaubt. * * This ULP outputs a list LENGTH-RI.TXT of all signals of a layout sorted * by its length and shows the corresponding frequency. * This is a very simplified calcualtion for a first evaluation * of the layout. * * Richard Hammerl 17.08.1998 */ /* * Zusaetzlich wird die minimale und maximale Leiterbahnbreite ermittelt * und die daraus resultierende Strombelastung. * Bei der Widerstands- und Strombelastbarkeits-Berechnung wird die * minimale Leiterbahnbreite herangezogen. * Es wird auch nicht eine Parallelführung bzw. Fläche (Polygon) * berücksichtigt. * * Added the determination of minimum and maximum wire width * and the calculation of the maximum allowed amperage * Parallel tracks and polygons are not taken into consideration. * * * A. Zaffran 05.04.2000 alf@cadsoft.de */ real f, WL, WLtotal ; int index[]; // ** aus "Mechanik der Elektronik" // mm <1 1 2 3 4 5 6 7 8 9 10 11 12 13 mm Leiterbreite bei 35 µm Cu real k[] = { 9, 8.8, 6, 4, 3.2, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9, 2.9 }; // _______________________ // Imax ~ 5.25 V [d x b x (d + b)] x k || (tL ~60°) // // d = µm Cu-Kaschierung // b = Breite mm // k = Korrekturwert aus Tabelle 02.02.2000 alf // ** aus "Mechanik der Elektronik" real Cu = 0.035; // 35 µm Cu Kaschierung real Length[], Freq[], Widthmin[], Widthmax[] ; string Signal[]; real c = 299800; // Lichtgechwindigkeit Vakuum in [km/s] int n = 0; real WireLength(real x1,real x2,real y1,real y2) { WL = sqrt(pow(x2-x1,2) + pow(y2-y1,2)); //Berechnung der Wirelaenge WL return WL; } real Frequency(real c, real l) { real f; f = c/l ; // Berechnung der Frequenz return f; } void WireWidth(string sig, real w) { // ermitteln der min-max Leiterbahnbreite if (w < Widthmin[n]) Widthmin[n] = w; if (w > Widthmax[n]) Widthmax[n] = w; } real imax(real breite) { int b = trunc(breite); if (breite == 0) return 0; else return 5.25 * sqrt((Cu * breite * (Cu + breite)) * k[b]); } if (board) board(B) { output ("LENGTH-RI.txt") { printf("%s\n\n", EAGLE_SIGNATURE); printf("List of signal length and its frequency & max. current\n"); printf("exported from %s\n at %s\n\n", B.name, t2string(time())); int check = 0; B.signals(S) { WLtotal = 0; Widthmin[n] = 32000; Widthmax[n] = 0; S.wires(W) { if (W.layer < 17) { // nur Kupfer-Layer WL = WireLength(u2mm(W.x2),u2mm(W.x1),u2mm(W.y2),u2mm(W.y1)); WLtotal += WL; WireWidth(S.name, u2mm(W.width)); } } if (WLtotal != 0) { f = Frequency(c, WLtotal); Signal[n] = S.name; Length[n] = WLtotal; Freq[n] = (c/WLtotal); ++n; } } printf(" --- Width --- Cu = %.3f mm\n", Cu); printf("Signal f [MHz] l [mm] mm2 ~mOhm Min [mm] Max ~Imax [A]\n\n"); sort(n, index, Freq); for (int i = 0; i < n; ++i) { real mm2 = Widthmin[index[i]] * Cu; real mOhm = 0; string R = "~~~~~~~"; if (Widthmin[index[i]]) { mOhm = (174 * Length[index[i]] / 10) / ( Cu * 1000 * Widthmin[index[i]]); sprintf(R, "%7.2f", mOhm); } printf("%-10s %10.2f %8.2f | %4.3f %s %7.3f %8.3f ~ %4.2f", Signal[index[i]], Freq[index[i]], Length[index[i]], mm2, R, Widthmin[index[i]], Widthmax[index[i]], imax(Widthmin[index[i]]) ); if (Widthmin[index[i]]) printf("\n"); else { check = 1; printf(" ***\n"); }; } if (check) printf("\n *** check wire width.\n"); } }