Calculation of prestressed screw according to ČSN 014010

Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Category: Source in Pascal
skrutka.pngProgram: Skrutka.pas
File exe: Skrutka.exe
File ubuntu: Skrutka
need: Tabulky.pas

It seems unbelievable that this program could survive the year 2000. It originated in 1990 when I studied at the secondary school. My best friend, Richard Helmeczy who is exploring Germany nowadays, and I programmed it to make the calculation of measurements of the bias screw easier. Although any CAD system concentrating on machine projecting can do it, the advantage of this program is in its ability to display every single step of the calculation, which is a great help. I found it so when I spent 3 days over the assignment just because I made a mistake at the end of the calculation and the only way how to retrieve it was by going through the task from its very beginning. When I visited my school a few years later in 1998, I found out that Ing. Zmija (to whom I'm sending all my regards) still uses it to check the students assignments. The program was told to contain only one single mistake. For me, the most interesting thing about the program is its romantic understanding of subtracting the values from the graphs.
{ TABULKY.PAS               Copyright (c) TrSek alias Zdeno Sekerak }
{ Kniznica pre SKRUTKA.PAS a TLAKSPOJ.PAS blizsie informacie        }
{ v tychto suboroch. Data z STK 2 a Strojnickych tabuliek.          }
{                                                                   }
{ Datum:04.08.1992                             http://www.trsek.com }
 
unit tabulky;
 
interface
 function obr90(lk,d,Da,m:integer):real;
 procedure obr107(da,db,dt:real;var c2a,c2b:real);
{              VYMENOVANE TABULKY V UNITE               }
      {Metricke zavity ,Vyber pre skrutky a matice
       STK  str.151  CSN 01 4010 "MetrickeZavity"}
      {Pozadovana bezpecnost
       STK 2  str 90 "tab9"}
      {Predbezna volba priemeru skrutky
       STK 2  str.92  tab.11  "tab11"}
      {Mechanicke vlastnosti ocelovych skrutiek a matic
       STK 2  str.92   tab.10 "tab10"}
      {Smerne hodnoty sucinitela utahovania Ku
       STK 2  str.94  tab.13  "tab13"}
      {Maximalne dovolene sily predpatia a utahovacie momenty pre
       normalizovane skrutky
       STK 2   str. 96   tab.14  "tab14"}
      {Smerne hodnoty unavovej pevnosti skrutkovych spojov
       sigma a MPa
       STK 2  str.97  tab.15  "tab15"}
      {Smerne hodnoty dovoleneho tlaku Pd MPa pri stlaceni
       suciastok z r“zneho materialu
       STK 2  str.98  tab.16  "tab16"}
      {Diagram na urcenie siloveho pomeru @(fi)c
       STK 2  str.93   obr.88  "obr88"}
      {Stupne presnosti ozubenych kolies
       STT  str.334  tab.1  "ktab1"}
      {Prevadzkovy sucinitel Ki
       STT  str.335  tab.2  "ktab2"}
      {Sucinitele vnutornych dynamickych sil Kv
       STT  str.335  tab.3  "ktab3"}
      {Casova pevnost materialov v ohybe ëfc a v dotyku ëhc
       STT  str.336-337  tab.4  "ktab4"}
      {Pruzna poddajnost spojovanych casti c2
       STK 2   str.95  obr.90  "function obr90"}
      {Hodnoty konstant pruznosti  C2a,C2b
       STK 2  str.112   obr.107}
      {Tolerancie ulozeni s presahom
       STT str. 122-128  "ulozenia"}
      {Tolerancie ulozeni s presahom u ulozeni H
       STT str. 128  "ulozeniah"}
 
const
 
      {Metricke zavity ,Vyber pre skrutky a matice
       STK  str.151  CSN 01 4010 "MetrickeZavity"}
      MetrickeZavity:array[1..11,1..4] of real=
                    ((4,3.545,3.141,7),(5,4.48,4.019,8),
                     (6,5.35,4.773,10),(8,7.188,6.466,14),
                     (10,9.026,8.16,17),(12,10.863,9.853,19),
                     (14,12.701,11.546,22),(16,14.701,11.546,24),
                     (20,18.376,16.933,30),(24,22.051,20.319,36),
                     (30,27.727,25.706,46));
 
      {Pozadovana bezpecnost
      STK 2  str 90 "tab9"}
      tab9:array[1..2,1..9] of real=
           ((4,5,6,8,10,12,16,30,30),(2.2,1.9,1.7,1.5,1.4,1.3,1.2,1.2,1.2));
 
 
      {Predbezna volba priemeru skrutky
      STK 2  str.92  tab.11  "tab11"}
      tab11:array[1..12,1..10] of real=
          ((1.6,1,0.32,2.5,6,5,4,4,4,4),
           (2.5,1.6,0.5,4,8,6,5,5,4,4),
           (4,2.5,0.8,6.3,10,8,6,6,5,5),
           (6.3,4,1.25,10,12,10,8,8,6,5),
           (10,6.3,2,16,16,12,10,8,8,8),
           (16,10,3.15,25,20,16,12,10,10,8),
           (25,16,5,40,24,20,14,14,12,10),
           (40,25,8,63,27,24,18,16,14,12),
           (63,40,12.5,100,33,30,22,20,16,16),
           (100,63,20,160,30,30,27,24,20,20),
           (160,100,31.5,250,30,30,30,30,27,24),
           (250,160,50,400,30,30,30,30,30,30));
 
      {Mechanicke vlastnosti ocelovych skrutiek a matic
      STK 2  str.92   tab.10 "tab10"}
      tab10:array[1..3,1..10] of real=
           ((0,1,2,3,4,5,6,7,8,9),
            (350,500,500,600,800,800,1000,1000,1000,1200),
            (210,300,400,480,650,640,800,900,900,1080));
 
      {Smerne hodnoty sucinitela utahovania Ku
      STK 2  str.94  tab.13  "tab13"}
      tab13:array[1..3] of real=(3,1.4,2);
 
      {Maximalne dovolene sily predpatia a utahovacie momenty pre
      normalizovane skrutky
      STK 2   str. 96   tab.14  "tab14"}
      Tab14:array[1..14,1..13] of real=
            ((4,1.3,1.8,2.4,3.9,5.45,6.55,1,1.35,1.8,2.9,4.1,4.9),
             (5,2.1,3,3.95,6.35,8.95,10.7,2,2.8,3.8,6,8.5,10),
             (6,3,4.2,5.6,9,12.6,15.1,3.3,4.7,6.3,10,14,17),
             (8,5.4,7.7,10.3,16.5,23.2,27.9,8.2,12,16,25,35,41),
             (10,8.6,12.3,16.4,26.2,36.9,44.3,16,23,31,42,69,83),
             (12,12.6,18,23.9,38.3,54,64.5,28,40,54,86,120,145),
             (14,17.2,24.6,32.8,52.5,74,88.5,44,63,84,135,190,230),
             (16,24,34.2,45.6,73,102,123,69,98,131,210,295,355),
             (18,29,41,55,88,124,148,95,136,181,290,405,485),
             (20,37,53,71,114,160,192,134,192,256,410,580,690),
             (22,46,66,88,141,199,239,180,258,345,550,780,930),
             (24,54,77,102,164,230,276,233,335,445,710,1000,1200),
             (27,71,101,134,215,302,363,345,490,655,1050,1500,1800),
             (30,85,123,164,262,368,442,475,680,905,1450,2000,2400));
 
         {Smerne hodnoty unavovej pevnosti skrutkovych spojov
          sigma a MPa
          STK 2  str.97  tab.15  "tab15"}
          TAB15:array[1..6,1..5] of real=
                ((4,4,40,34,27),(5,4,45,38,30),(6,5,55,45,35),
                 (8,6,60,50,40),(10,8,70,60,50),(12,8,70,60,50));
 
         {pomocne, doplnil trsek}
          pomoc:array[0..9] of integer=
             (1,2,3,3,4,4,5,5,6,6);
 
         {Smerne hodnoty dovoleneho tlaku Pd MPa pri stlaceni
          suciastok z r“zneho materialu
          STK 2  str.98  tab.16  "tab16"}
          tab16:array[1..4,1..2] of real=
               ((180,120),(750,500),(500,330),(900,600));
 
         {Diagram na urcenie siloveho pomeru @(fi)c
          STK 2  str.93   obr.88  "obr88"}
          obr88:array[1..3,1..11,1..6] of real=
               (((0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.75,0.63,0.50,0.37,0.51,0.64)),
                 ((0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.69,0.57,0.42,0.27,0.42,0.55),
                 (0.62,0.50,0.37,0.24,0.38,0.49),
                 (0.59,0.45,0.30,0.21,0.32,0.45),
                 (0.54,0.395,0.275,0.17,0.27,0.4),
                 (0.5,0.37,0.25,0.15,0.25,0.35),
                 (0.45,0.32,0.22,0.13,0.22,0.31),
                 (0.42,0.29,0.195,0.118,0.19,0.28),
                 (0.38,0.26,0.175,0.105,0.175,0.26),
                 (0.36,0.24,0.158,0.09,0.155,0.24),
                 (0.33,0.22,0.145,0.085,0.14,0.22)),
                 ((0.75,0.63,0.50,0.37,0.51,0.64),
                 (0.62,0.49,0.35,0.23,0.35,0.49),
                 (0.53,0.39,0.27,0.17,0.28,0.39),
                 (0.48,0.35,0.24,0.14,0.24,0.35),
                 (0.42,0.29,0.19,0.12,0.19,0.28),
                 (0.37,0.25,0.16,0.1,0.16,0.25),
                 (0.34,0.23,0.14,0.08,0.14,0.23),
                 (0.29,0.19,0.12,0.07,0.12,0.19),
                 (0.26,0.17,0.11,0.06,0.11,0.16),
                 (0.23,0.15,0.09,0.055,0.09,0.14),
                 (0.22,0.14,0.08,0.047,0.08,0.13)));
 
         {Stupne presnosti ozubenych kolies
          STT  str.334  tab.1  "ktab1"}
          ktab1:array[1..3,1..12] of real=
               ((1,2,3,4,5,6,7,8,9,10,11,12),
                (0,0,0,12,12,4,4,0.8,0.8,0,0,0),
                (0,0,0,60,60,12,12,4,4,0.8,0.8,0.8));
 
         {Prevadzkovy sucinitel Ki
          STT  str.335  tab.2  "ktab2"}
          ktab2:array[1..3,1..3] of real=
               ((1,1.25,1.75),(1.25,1.5,2),(1.5,1.75,2.25));
 
         {Sucinitele vnutornych dynamickych sil Kv
          STT  str.335  tab.3  "ktab3"}
          ktab3:array[1..2,1..4,1..2,1..5] of real=
               ((((0,1,1.2,1.3,1.45),(0,1,1.15,1.25,1.35)),
                 ((1,1.15,1.35,1.45,0),(1,1.15,1.25,1.35,0)),
                 ((1,1.25,1.45,0,0),(1,1.2,1.35,0,0)),
                 ((1.1,1.45,0,0,0),(1.1,1.35,0,0,0))),
                (((0,1,1,1.1,1.2),(0,1,1,1,1.1)),
                 ((1,1,1,1.2,1.3),(1,1,1,1.1,1.1)),
                 ((1,1.1,1.3,1.4,0),(1,1.1,1.2,1.3,0)),
                 ((1,1.3,1.4,0,0),(1,1.2,1.3,0,0))));
 
 
 
         {Casova pevnost materialov v ohybe ëfc a v dotyku ëhc
          STT  str.336-337  tab.4  "ktab4"}
          ktab4:array[1..44,1..4] of real=
               ((422420,200,40,370),(422425,250,45,380),
                (422430,300,50,390),(422550,500,120,420),
                (422304,420,135,380),(422306,600,135,470),
                (422307,700,135,500),(422650,520,145,500),
                (422460,600,155,530),(422750,650,165,560),
                (422719,700,170,570),(422719,750,175,590),
                (422750,800,185,620),(11500,500,140,490),
                (11523,520,145,500),(11600,600,155,530),
                (11700,700,170,570),(12050,550,150,510),
                (12050,650,165,560),(12061,670,175,590),
                (12061,750,185,620),(13240,800,185,620),
                (14140,900,200,670),(15241,950,210,690),
                (16440,900,200,670),(422660,600,100,1220),
                (422719,700,110,1240),(11600,600,100,1220),
                (11700,700,110,1240),(12051,650,110,1240),
                (14140,800,125,1260),(15241,1000,140,1300),
                (12010,450,185,1320),(12020,500,195,1340),
                (14220,800,270,1460),(14223,900,295,1500),
                (16220,900,295,1500),(16420,950,305,1520),
                (15230,800,270,1250),(15330,800,270,1250),
                (14140,1600,270,1500),(12020,400,160,600),
                (12060,600,185,750),(14140,800,210,900));
 
         {Vybrane mechanicke vlastnosti materialov
          STK 2  str.114  tab.19}
          tab19:array[1..4,1..8] of real=
                ((205000,95000,125000,80000,110000,70000,40500,90000),
                 (0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.25),
                 (11,10,16,18,16,23,26,10),
                 (-8.5,-8,-14,-16,-14,-18,-21,-8));
 
         {Sucinitel zovretia
          STK 2  str.113  tab.18}
          tab18:array[1..5,1..3] of real=
                ((0.13,0.35,0.09),(0.14,0.35,0.09),(0.08,0.15,0.05),
                 (0.055,0.15,0.05),(0,0,0.055));
 
         {Tolerancie ulozeni s presahom
          STT str. 122-128  "ulozenia"}
          ulozenia:array[1..15,1..26] of real=
          ((40,12,53,17,64,20,93,27,121,55,175,97,256,164,364,256,428,
           302,712,568,871,709,1089,911,1347,1153),
          (34,6,46,10,56,12,72,18,97,31,136,58,196,100,264,156,373,
           247,497,353,606,444,749,571,917,723),
          (32,4,41,5,50,6,60,6,81,15,109,31,148,56,198,90,27,148,356,
           212,431,269,524,336,637,443),
          (28,4,35,5,43,6,51,6,62,36,95,31,132,56,179,90,250,147,330,
           212,402,269,492,346,603,443),
          (24,0,31,1,38,1,46,1,56,2,68,4,83,7,106,17,132,37,168,58,
           210,77,247,101,295,135),
          (0,0,0,0,0,0,66,21,88,34,120,56,166,90,226,137,315,212,
           624,294,506,373,619,473,757,597),
          (0,0,0,0,0,0,0,0,108,43,153,89,220,144,308,219,443,340,492,
           474,731,702,909,763,1097,937),
          (24,0,33,3,41,4,50,5,61,7,73,9,89,13,108,19,131,28,156,38,
           179,46,203,57,229,69),
          (28,8,35,11,43,13,51,15,62,27,85,35,117,57,159,89,210,150,
           282,218,367,263,447,333,553,427),
          (0,0,0,0,0,0,0,0,54,20,70,29,94,45,126,69,171,106,225,150,
           272,188,330,237,400,297),
          (24,4,31,7,38,8,46,10,56,14,58,18,83,23,106,36,132,60,
           168,212,210,263,247,333,295,428),
          (24,4,31,7,38,8,46,10,56,14,68,18,83,23,106,36,132,60,168,
           212,210,263,247,333,295,427),
          (16,0,23,3,28,4,34,5,41,7,50,9,60,11,73,16,88,25,106,34,
           126,42,144,51,166,63),
          (20,12,27,11,32,14,39,17,48,22,59,27,78,40,101,57,133,83,
           169,111,202,138,244,172,292,212),
          (16,6,23,10,28,13,34,15,41,19,42,10,62,30,76,39,93,50,113,
           64,130,75,150,89,172,105));
 
         {Tolerancie ulozeni s presahom u ulozeni H
          STT str. 128  "hulozenia"}
          ulozeniah:array[1..5,1..13] of real=
          ((4,5,6,8,9,11,13,15,18,20,23,25,27),
           (6,8,9,11,13,16,19,22,25,29,32,36,40),
           (10,12,15,18,21,25,30,35,40,46,52,57,63),
           (14,18,22,27,33,39,46,54,63,72,81,89,97),
           (25,30,36,43,52,62,74,87,100,115,130,140,155));
 
   rozmery:array[1..13] of integer =
          (3,6,10,18,30,50,80,120,180,250,315,400,500);
 
   naz_ulozenia:array[1..14] of string =
          ('H8/z8','H8/x8','H8/u8','H8/u7','H8/s7','H8/v7','H8/y7',
           'H8/r7','H7/u7','H7/t6','H7/s7','H7/r6','H6/s6','H6/r5');
 
 
implementation
 
   {Pruzna poddajnost spojovanych casti c2
    STK 2   str.95  obr.90  "function obr90"}
   function obr90(lk,d,Da,m:integer):real;
    const
      pz:array[1..2,1..12] of real=
        ((0,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75,5.25,5.75,100),
        (50,39,30,24,19,15,11,8,5,3,0,0));
 
      vz:array[1..4,1..24] of real=
        ((0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,110,115),
        (100,85,70,59,49,41,35,29,24,20,17,14,12,9.5,8,6.8,5.5,4.7,3.9,3.2,2.8,2.2,1.9,1.7),
        (175,150,125,100,85,72,60,50,41,35,29,25,20,17,14,13,10,8.1,6.9,5.8,4.8,4,3.2,2.8),
        (300,250,210,175,150,125,100,85,70,60,50,41,34,29,25,20,17,14,12,9.7,8.1,6.9,5.5,4.7));
 
      var x,y,c:real;
          a,p:integer;
 
      begin
        if m=4 then m:=3;
        if m=3 then m:=1
               else if m=1 then m:=3;
        if lk/d>10 then y:=pz[2,11];
        if lk/d<0 then y:=pz[2,1];
        for a:=1 to 11 do
          if (lk/d>=pz[1,a]) and (lk/d<pz[1,a+1]) then y:=pz[2,a];
          if Da/d<=1.5 then p:=1;
          if (Da/d>1.5) and (Da/d<=3) then p:=2;
          if Da/d>3 then p:=3;
        case p of
          1:x:=1.04*y;
          2:x:=(34*y+1000)/50;
          3:x:=(25*y+1650)/50;
               end;
        case d of
          4:c:=0;
          5:c:=60*6;
          6:c:=60*11;
          8:c:=60*14;
         10:c:=60*26;
         12:c:=60*30;
         14:c:=60*34;
         16:c:=60*38;
         18:c:=60*41;
         20:c:=60*45;
         22:c:=60*47;
         24:c:=60*49;
         27:c:=60*52;
         30:c:=60*55;
               end;
       y:=(59*x+c)/60;
       for a:=1 to 23 do
         if (y>=vz[1,a]) and (y<vz[1,a+1]) then obr90:=vz[m+1,a];
     end;
 
      {Hodnoty konstant pruznosti  C2a,C2b
       STK 2  str.112   obr.107}
      procedure obr107(da,db,dt:real;var c2a,c2b:real);
        const vyb:array[1..3,1..12] of real=
             ((0,1.15,1.3,1.5,1.8,2.25,2.75,3.5,4.5,6.5,9,11),
              (0.1,0.17,0.27,0.35,0.43,0.48,0.52,0.545,0.565,0.57,0.573,-1),
              (0.1,0.16,0.24,0.3,0.375,0.43,0.45,0.47,0.48,0.49,0.5,-1));
        var a,b:real;
            i:integer;
        begin
          if (dt<0) or (da<0) then begin
                                     c2a:=0;c2b:=0;exit;
                                   end;
          if db>0 then b:=dt/db;
          a:=da/dt;
          if a>10 then a:=10;
          for i:=1 to 11 do
            begin
              if (vyb[1,i]<a) and (vyb[1,i+1]>=a) then c2a:=vyb[2,i];
              if db>0 then
               if (vyb[1,i]<b) and (vyb[1,i+1]>=b) then c2b:=vyb[3,i];
            end;
          if db<=0 then c2b:=1;
      end;
 
 
 
 
      function kobr1(d,m,it,p,ze,ea:real;var kfa,kha:real):boolean;
 
       begin
         kobr1:=false;
         if (m<0) or (m>20) then exit;
         if (d<12) or (d>1600) then exit;
         if (it<3) or (it>12) then exit;
 
      end;
 
end.