bachelor thesis: improving the shear tester at mtm, kuleuven

Upload: niels-cautaerts

Post on 14-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    1/37

    1

    Table of Contents

    ABSTRACT 2

    INTRODUCTION 2

    MECHANICS 2

    STUDY OF CURRENT MECHANICAL PROCEDURE 6

    CURRENT MEASURING PROCEDURE 8

    POSSIBLE ALTERNATE PROCEDURES 10

    STRAIN G AUGES 10 ROTARY ANGLE T RANSDUCER 11 INFEROMETRIC T ECHNIQUES 11 STANDARD 2D-DIC 12

    MATERIALS 12

    PRELIMINARY BUCKLING TESTS 13

    METHOD AND RAW DATA 14

    PROCESSING OF DATA 16

    ANALYSIS AND DISCUSSION 17 STEEL 17

    ALUMINUM 19 OUT OF P LANE MOTION 21 GRIPPING P ROBLEMS 22 D ISCUSSION AND SUGGESTIONS 22

    CONCLUSIONS 23

    APPENDIX A: PROCEDURE 2.0 FOR THE SHEAR TESTER 24

    APPENDIX B. DEVELOPED SOFTWARE CODE 29

    INTERPOLATION PROCEDURE 29 STATISTICS CALCULATION 31 ESSENTIAL SELECTION FROM THE STRAIN EXTRACTION ALGORITHM 33

    REFERENCES 37

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    2/37

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    3/37

    3

    To characterize the motion of material points, two sets of axes are defined: xyz is the globalorthogonal coordinate system while XYZ are axes pinned to the material. It is clear that

    x X Y tan( )

    y Y

    z Z

    x

    y

    z

    1 0

    0 1 0

    0 0 1

    X

    Y

    Z

    x

    y

    z

    F

    X

    Y

    Z

    F is the material deformation tensor and tan( ) is the technical shear strain [Khan,1995] . maps the material coordinates to the world coordinates.There are many ways to define strain. Whereas material experiences necking and thus failureat small strains in tensile tests, this is not the case in shear. Large deformations may berealized and hence the rotation and stretching of the material axes becomes significant. Hencedescribing the deformation with infinitesimal strain is not appropriate. Instead, Green-Lagrange strain is used; this tensor is rotation independent and can be used for large straindeformations such as shear [Khan, 1995]. It can be related to F :

    E 12

    ( F T F I )0 2 0

    2

    2

    2 0

    0 0 0

    Here I denotes the identity matrix. Green-Lagrange strain is the type of strain calculated bythe DIC software. The above expression is what the data should look like if the material istruly undergoing simple shear; if the E 11 entry is non-zero in a point, then the deformationcan t be simple shear. To compare shear strains, E 12 is used. Taking an average of E 12 over the whole deformation zone and doubling this value should give the macroscopicallyobservable technical shear strain.

    Stresses in the sample are difficult to describe, as well as very difficult to measure. To balance the forces, the shear stress in the sample is should be given by

    xyF swt

    However, the force F s also introduces a torque, and the force F N must counterbalance this to prevent the sample from rotating. This force varies in a non-linear way along the edge of thesample and is most outspoken near the edges; this results in an edge effect due to largenormal stresses. Due to the normal stress, the above expression for shear stress is no longer

    valid. Finite element simulations show that it is only an average value over the width; theshear stress near the edges is different, as shown in figure 1.2.

    F

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    4/37

    4

    A corrected stress in the center of the deformation zone is given by

    max xy

    1 f ehw

    This is the stress that relates to the strain in the center of the sample. The factor f e corrects for the edge effect and is dependant on material parameters and some geometrical features. It isdetermined through a finite element simulation. [Vegter, 2008] In this work however, edgeeffects are neglected and the simple expression for the shear stress is assumed to be true.Since tests are always conducted on samples with the same geometry, this should have noinfluence on the ability of comparing different ways of measuring strain.Until appreciable deformations, a simple shear resembles a pure shear. Pure shear is shown infigure 1.3.

    Figure 1.2. Shear stress and shear strain

    along the edge of the deformation zone[Vegter, 2008]

    2

    2

    Y

    X

    x

    y

    Figure 1.3. Pure Shear deforms thesquare to a rhombus

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    5/37

    5

    Pure shear is the deformation that occurs when only shear stresses act on the sample. Asimple shear is a combination of pure shear and a constraint that prevents displacement in thedirection perpendicular to the shear direction. The Green-Lagrange strain tensor can beconstructed for pure shear. With the condition that the area must remain the same(conservation of mass and hence conservation of volume in a solid), it is found that the lengthof one unit in the material axes system is extended to

    f 1

    cos 2 2 sin 2 2

    Now that the length of the material axes are known after the deformation, it can be seen that

    x f cos 2 X f sin 2 Y y f sin 2 X f cos 2 Y z Z

    Hence the material deformation tensor is given by

    F

    f cos 2 f sin 2 0 f sin 2 f cos 2 0

    0 0 1

    The Green-Lagrange strain can be calculated the same way as before.

    E

    12cos

    12

    tan 2 0

    tan 2

    12cos

    12 0

    0 0 0

    This is not identical to the simple shear case. It demonstrates that simple shear is not simply pure shear with an applied rotation (as Green-Lagrange strain would not be affected by therotation). The E 12 and E 21 elements are the same however.Pure shear can be represented on a yield surface. Due to the normality rule, the principalstrains vector must be normal to the yield surface in the point that represents the principal

    stresses [Van Houtte, 2010]. Figure 1.4 shows the principal stress and strain states in pureshear. The principal axes lie along the diagonal of the deformation zone. From doing a shear test and constructing a shear stress versus shear strain curve, determining the yield shear stress gives a point on this surface [Vegter, 2008]. Simple shear can approximate pure shear at very small strains in the center of the deformation zone where the normal stresses aren t toogreat [Vegter, 2008]. Yielding happens at very low strains; hence the simple shear yield pointis interchangeable with the pure shear yield point.Knowledge of the mechanics of the shear deformation can also provide an estimate for theyield shear stress given only the tensile yield stress. This can be achieved using a theoreticalmodel for yield such as the von Mises yield criterion. Using this criterion, one can estimatethat

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    6/37

    6

    y y

    3

    where y is the yield stress in pure shear and y is the yield stress in tension. Depending onwhich yield criterion is used, the estima te will be drastically different. In Tresca s model, theyield stress in shear is only half that of the yield stress in shear. This is why it is important toobtain experimental data on shear to find more accurate yield models.

    Study of Current Mechanical Procedure

    Following is a brief overview of the existing test apparatus and procedure as described by[Shore, 2010]. Figure 2.1 is a diagram of the machine. This is also the procedure that wasfollowed to conduct the 3D tests. The speckled test sample with geometry t

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    7/37

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    8/37

    8

    Current Measuring Procedure

    The machine is equipped with an ultra high accuracy displacement sensor. The initial plan

    when the machine was designed was to use this to measure s and hence obtain the shear straindirectly. However, due to the elasticity of the machine, the displacement sensor can not betrusted for accurate results. Hence it was opted to measure strain with the Limess 3D setup.Two high-speed CCD video cameras are both level with the deformation zone and pointed atthe sample. The cameras are approximately .5m apart and the point in the middle of thecamera is .5-1m away from the deformation zone [Shore, 2010]. This is shown in Figure 3.1.

    Figure 3.1: The setup consists of 2 cameras, both getting a different view of the surface[Gom, 2001]

    Before they are used, the cameras must be calibrated. This is achieved by taking variousimages of a calibration plate plate, shown in figure 3.2.

    Figure 3.2 A calibration plate

    The dots are arranged in columns and rows and their size and separation are known. The plaque is held in one spot as best as possible and rotated around on small angles. From thedifferent views the cameras obtain of the grid of points, the software can calculate the relative

    position and orientation of the cameras as well as some other parameters [Ortheu, 2008]. Thisis a difficult geometrical problem described in more detail in [Lava et al., 2010].

    .5-1m

    .5m

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    9/37

    9

    Every second (this number can be altered in the software, VIC Snap), an image is recorded of the deformation zone from both cameras. Ideally, the recording is started simultaneously withthe test, since the recording software and machine software are different and run on differentcomputers. This is because there is currently no suitable analog output signal from the shear tester to use for synchronization with the DIC system. The software developed for this work attempts to compensate for this.In a 2D DIC algorithm as explained by [Pan et al., 2009], two gray-scale images (oneconsidered undeformed, the other deformed) are compared and from this the displacementfield is calculated. Figure 3.3 represents one step in the image correlation. First both imagesare stored as a matrix of gray-scales, in which the gray value of every pixel is stored. Next, aninterpolation procedure finds gray levels between the pixels. The type of interpolation used(linear, B-spline) affects how accurate the correlation will be. The first image is subdividedinto facets (subsets). For each facet, which has a certain gray level distribution, acorresponding area is found in the deformed image. In order for the gray level distribution to

    be recognized, there must be enough contrast between pixels. This is realized with a random black speckle pattern on a white background. The correspondence between the areas isevaluated using a correlation coefficient. Many different coefficients exist and the optimal

    coefficient will depend on the specific experiment. The search algorithms are very complex ascan be seen in [Bruck et al., 1987]. When the corresponding areas for all facets are found in both images, local displacement gradients can be determined by finding the displacementvector between the center of gravity of the undeformed and the deformed facet. The larger thefacets, the more certain the correlation, but the less local the information becomes.

    Figure 3.3: A representation of 2D-DIC [Pan et al., 2009]

    The 3D DIC algorithm, as described by [Lava et al., 2010], is an extension of the 2D DICalgorithm. It is described here briefly and represented in Figure 3.4.In 3D DIC, 4 images are now to be compared: 1 image from each camera in the undeformedstate and 1 image from each camera in the deformed state. The undeformed image fromcamera 1 is chosen as a reference image. A 2D-correlation is run between the reference andthe undeformed image from camera 2. This should be possible given that the gray-scaledistribution and lighting is approximately the same for both cameras [Ortheu, 2008]. From the

    calibration parameters determined earlier and with a process called triangulation, 3D positionsXYZ can be calculated for each point on the surface. Next a 2D correlation is run between thereference and the deformed image from camera 1. This will find how much each point hasmoved according to camera 1. A 3 rd and last correlation is run between the reference and thedeformed image from camera 2. Since the cameras have not moved, the same triangulation

    process can be used to compare the points in both deformed images. This yields the 3D positions of the points in the deformed state X Y Z . Comparing the 3D positions in thedeformed and undeformed state yields the 3D displacement field.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    10/37

    10

    Figure 3.4: Representation of the 3D DIC algorithm [Lava et al., 2010]

    From this, the displacement gradient tensor as well as strains can be calculated.

    Possible Alternate Procedures

    There many different ways to measure strain. Below are some that were initially considered.

    Strain Gauges

    The principle of a strain gauge is that it measures the change in distance between two points.From this, the local strain may be estimated. Many physical phenomena are used to measurethis change in distance. There exist contact and non-contact (using lasers for example)gauges. The most common strain gauge is one that uses change in electrical resistance as thegauge extends to calculate the extension. [VTI] Two strain gauges glued to the center of thedeformation zone was suggested to calculate the shear strain, since most of the literaturesuggests the simple shear deformation zone is mostly homogeneous. However, strain gaugescan only be accurate in cases of small strains, such as in tensile tests; strains associated withshear are far too large for contact strain gauges. Also, due to the shearing, the glue wouldeasily come undone. There is also the question of efficiency, as gluing on the strain gauges isarduous. Hence the idea of strain gauges was discarded.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    11/37

    11

    Rotary Angle TransducerThis kind of device shown in figure 4.1 was used in the papers and developed by [Vegter andAn, 2008 and 2009]. A small metal fork with two pins is pressed onto the center of thedeformation zone. The fork is connected to a rotary strain guage, which can give an angleread out over time. The authors of these papers showed that when the deformation zone is

    sufficiently homogeneous, one value read from the center of the deformation zone issufficient to characterize the material behavior. This method would have great benefits interms of conducting tests more efficiently, analyzing them in a shorter timespan, and havingto store less data on a computer. As a reference, one 3D test can take up more than 1Gb on ahard-drive. Implementing the device on the MTM machine is however not evident. Thedevice is expensive as the rotary strain guage can cost up to 1000 euro. The pins of the fork must also be precisely machined. Making a design of the mounting mechanism must be wellthought out. It must be made sure the pins fit onto the sample perfectly but aren t loaded toomuch, so alignment of the grips must be flawless. The fact that one side of the sample staysstationary but the other moves means that the metal fork must also move a tiny bit for it not to

    bend. All these considerations made implementation of the device within the given timeframeunrealistic. If the shear tester proves useful, perhaps future work can implement the device.

    Figure 4.1 Shows the rotary strain guage (a). The fork is hiddenInside the block in which the shear test happens. Angle is measured

    Inferometric TechniquesWhen a grid is slightly deformed and the undeformed and deformed grids are overlaid, aninterference pattern appears. From this pattern strains can be measured. This is the basis of Moir inferometry. There exist many kinds of inferometric techniques all reliant on this basic

    principle. [Post et al., 2008] Inferometric techniques can be more accurate than DIC, but tendsto be more complex and sensitive [Pan et al., 2008]. Since the aim is to simplify the procedureand since 3D DIC is already significantly accurate, the idea of inferometric techniques wasdiscarded.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    12/37

    12

    Standard 2D-DICIt is not obvious why [Van Boxel, 2010] decided to use 3D DIC to measure strain for thisessentially 2D-problem. Possibly [Flores, 2005] inspired him, as he used 3D DIC to check whether the grips on his machine were properly aligned.The working of 2D digital image correlation was explained earlier in order to explain the

    working of 3D image correlation. In some situations, 2D DIC has advantages over 3D DIC.Computation time is drastically reduced. Assuming that the camera can be mounted perfectly perpendicular to the sample, it has been found by [Lava et al., 2010] that it is more accurateas well. Even though 3D DIC may correct for possible out of plane motion and non-

    perpendicularity, the 3 correlation runs per step cause an accumulation of error that is muchgreater than a simple 2D setup. In fact, it is shown in the same study that the in-plane strainmeasurements have an error about 3 times greater than standard 2D DIC. There would also beno need to calibrate the camera, only a scale would have to be given as input. 2D DIC runs afaster test, a faster analysis and is possibly more accurate if planarity of displacement isassumed and the camera is positioned perpendicular to the deformation zone. In fact,according to [Pan et al, 2008], an angle difference less than 5 degrees from the normal to the

    plane still only results in an error of .01 pixels in displacement error. It is recommended by

    [Lava et al., 2010] and [Pan et al., 2008] to position the 2D camera set up as far away fromthe sample as possible for best results. The issue of image resolution limits the distance hencean optimum must be found.

    Since cameras and software for standard 2D-DIC are readily available, it was chosen tocompare this to the existing procedure.

    Materials

    Two plate materials were selected to compare 3D-DIC and 2D-DIC: an IFBA-DC06 steel and

    AA6016 aluminum. Some approximate properties of the materials are listed in Table 5.1(planar isotropy is assumed). The G-modulus is calculated using the formula

    GE

    2 1

    with a Poisson ratio of .3. The yield stress in shear is calculated using the von Mises criterion.

    Property Steel AluminumE-modulus 200 GPa 70 GPaG-modulus 77 GPa 26 GPa

    y 140 MPa 160 MPa y 80 MPa 93 MPa

    Thickness .7 mm 1 mmTable 5.1. Some properties of the materials used

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    13/37

    13

    Preliminary Buckling Tests

    Buckling is a form of failure of a material that is characterized by unpredictable deformations.A classical example of elastic buckling is the bending out of an elastic beam when a highenough load is placed along the beam axis. Buckling in a sheet happens also under certain

    loading conditions; elastic buckling behavior can be deduced mathematically for sheetmaterial [Marder et al, 2007]. Plastic buckling however is non-linear and difficult to treat.In shearing, buckling happens when the sample geometry allows for it. For the purpose of thisstudy, buckling is an unwanted effect since it causes out of plane deformations to occur. Thisis then no longer a simple shear test. Some approximate geometrical constraints [Van Boxel,2010] arrived at to prevent buckling were

    t h

    2 max 1 3

    2 G

    w

    h

    7.5

    Here max is the shear stress that can be attained before the sample buckles. A typical valuefor is .01 [Van Boxel]. If no buckling can occur before max 100 then thethickness/height ratio in aluminum must be at least .13 whereas in steel it has to be .077.Hence if a height of 6 mm was chosen, a width of 45 mm would suffice and thicknesses of .76 mm for aluminum and .46 mm for steel.[Shore, 2010] suggests taking a deformation zone height of 3 mm. To be able to measure thestrain with a contact method such as the rotary angle transducer (if such a device were ever installed) a larger deformation zone is necessary.At the earliest stage of the project, the camera system was not available. However, since themechanical procedure complex, it was worthwhile to conduct some tests for qualitative dataand gain familiarity with the practicalities of the experimental method. Tests were conductedon steel samples of varying width; they were sheared with h 6mmto a maximum value of s. It was attempted to estimate with the naked eye at what s the sample started buckling. Thisattempt was unsuccessful, as the buckling seems to happen gradually. Also, the out of planedeformation could only be noticed by running a finger across the surface; it couldn t benoticed visibly. Even then it was difficult to detect. The tests were interrupted when slippingout of the grips became evident, typically at a displacement of 20 mm. Figure 6.1 shows animage of 4 marked up samples. All samples look very different; this is because at this stage of the investigation many variables were altered at once to observe their effect. An example wasconducting a test without aluminum shims.

    Figure 6.1: Samples of different widths tested for buckling with a height of 6mm

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    14/37

    14

    Some observations include: Buckling was not noticeable in the force vs. time plots. This points to plastic buckling

    happening very gradually. Buckling was only noticeable in the two smallest samples by running a finger across

    the surface. No noticeable buckling occurred on the two larger ones, at least not withthis course method. The size of the slip zone seems to be larger on one side when one of the clamping

    zones is smaller. To minimize this effect, the deformation zone should be marked andlie as close to the middle as possible.

    The slip zone expands as deformations get larger. It expands most in the cornerswhere there is tension.

    The aluminum shims inserted between the grips and the clamp are necessary. The40mm width test shows that the slip zone is significantly larger when no shims areused.

    The recorded normal force seems to vary randomly for the first few minutes of thetest before rising monotonously. Positive values denote tension.

    There was no evidence to conclude on whether or when buckling was happening. The finger method was too rough. To be safe, it was decided to trust the criteria by Van Boxel andcontinue testing on samples of width 50mm. Also it was decided to end the test at s 8mm .In an ideal test, this would already be an engineering strain of 133% and a shear angle of

    tan 186 53.1 ; this is more than enough to compare tests and it reduces the time for

    one test significantly. Due to the large slip zones however, such large deformations can never be reached.

    Method and Raw DataTests were conducted first using the procedure outlined in [Shore, 2010]. Then tests wereconducted using the new procedure, outlined in Appendix A. First steel was tested. The rawdata of displacement, shear force and tensile force readouts over time is written to a DAT-file

    by the computer connected to the machine. Figure 7.1 shows shear load and tensile load of 4tests on steel. Graphs of tests on aluminum looked very similar.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    15/37

    15

    Figure 7.1 Force versus time in steel for 4 tests. Tensile loads are represented by blue curves,shear loads by pink.

    Between tests, the shear load over time looks approximately the same, but tensile load alwayslooks very different. As long as the tensile force remains much smaller than the shear force,the impact should be minimal. It shows however that even though careful reproduction of starting condit ions for tests still doesn t produce the same results for each test. So a testconducted in the shear tester is very sensitive to starting conditions.

    The computer connected to the camera initially just saves images at certain points in time. Ananalog.csv file is created as well to document when each image was recorded. To conduct a3D analysis, 2 images are taken at once with two different cameras, while 2D analysisrequires only 1 image. The images are then loaded into software that analyses thedevelopment of the speckle pattern. After the analysis, the displacement field and strains arecalculated for various points in every image. All this information can then be exported asCSV-files. For each image, the software produces a color map as shown in Figure 7.2 for every calculated value. Figure 7.2 shows E 12 of the Lagrangian strain tensor over thedeformation zone in the last image of two tests; the first was a test on steel, the second a teston aluminum.

    Figure 7.2 Color map of E 12 in a test on steel and on aluminum

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    16/37

    16

    In the first image, the colors range from -.006 in the red to -.186 in the magenta. In the secondimage the colors range from -.018 in the red to -.27 in the magenta. This is read on the color legend that isn t shown o n the image; the numbers were too small to read. Hues follow thelogical rainbow color order; red is the highest value and shades of purple are the lowest. Thereason the values are negative is because the shear angle is clockwise. It is interesting to notethat -.186 and -.27 correspond to a technical shear angle of 20.4 and 28.4 respectively. Thisis the maximum value in the deformation zone and is nowhere near the expected 53. Thislarge difference is due to the sample slipping and deforming inside the grips. These slip zoneswere already observed in Figure 6.1. This makes the deformation zone much larger than 6mmand hence a displacement over 8 mm results in a smaller technical shear strain than expected.Measurement with a protractor of the approximate deformation zone plus slip zones onaluminum and steel samples did seem to agree with an approximate shear angle of 15.A second observation is that the strain fields of all the steel tests were not symmetrical like inthe aluminum tests. A magenta spot appeared either in the lower right corner or in the upper left corner. Possibly this was due to more slipping out of the grips because steel is muchstiffer than aluminum or due to unobserved and unexpected buckling.The numerical data obtained at this point is the DAT-file with force data, a csv file for every

    analyzed picture and an analog.csv file stating when each picture was taken. This is valid for both 2D and 3D DIC. The only difference is that the correlation algorithm is different. Further processing of data can hence be done the same way for 2D as for 3D DIC.

    Processing of Data

    In order to compare the effectiveness of 2D and 3D DIC, the force data and strain data must be combined. It was chosen to construct stress-strain curves, using the E 12 entry for strain

    and F swt

    for stress. is calculated from the force data by dividing by the initial width and

    thickness of the sample. Finding a representative E 12 is more difficult, since it is variableacross the deformation zone.An algorithm employed by Van Boxel (reimplemented in Python by Shore) for the shear tester was used to read in all csv files and produces one csv file giving an average E 12 for every image. The process by which this is done is as follows (repeated for every image):

    1) It is possible the sa mple is rotated relative to the camera s viewing plane. This results insimple shear happening parallel to an axis at an angle with the x-axis according to thecamera. The software can check whether this is the case by comparing the first frame andanother frame very early on in the deformation when the deformation field should be veryhomogeneous. For all the points, an average 2D-displacement vector is calculated. Thenthe angle necessary to rotate this average vector onto the x-axis is calculated. The rotationis then applied to all the points.

    2) The software then goes on to filter out points that have a value of F 11 deviating too muchfrom 1. In simple shear, this value must be exactly 0, so points that deviate too muchfrom this are no longer undergoing simple shear.

    3) The points that qualify for the simple shear criterion are averaged. This value is written tothe new csv file.

    Some software developed in Matlab by the author then takes this AvgShear.csv file, theanalog file and the DAT-file and combines the stress and the strain by interpolation. This isnecessary because the computer steering the machine and the computer steering the camerasrun on different clocks. The final product is a csv file with a strain and corresponding stress

    column. The code developed by the author and essential excerpts from the python code aregiven in appendix B.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    17/37

    17

    Analysis and Discussion

    All 3D and 2D stress-strain curves were combined on one graph. Also, a script was writtenthat samples the curves and calculates statistics about them. It is included in appendix B.

    Steel

    Figure 9.1. Stress versus strain in DC06 Steel

    Figure 9.1 shows the stress strain curves of steel tests all overlaid on one graph. The curves

    all follow the same general shape but flare out slightly. From this it is difficult to deducewhether there is a difference in measurement (mean) or a difference in spread (standarddeviation) between 3D and 2D. With the sampling script, a plot was constructed depicting themean stress of both 3D and 2D at various strains. Also a plot of the standard deviation atvarious strains was constructed. These graphs are depicted in figure 9.2.

    Figure 9.2 Mean Stress in steel versus strain for 2D and 3D

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    18/37

    18

    The means practically coincide as the blue markers are mostly hidden behind the red. Itindicates that 2D and 3D-DIC have about the same level of accuracy for this type of test.Sample standard deviation of the sample was also plotted for various strains. The result isshown in figure 9.3. It seems as though the standard deviation of the 3D tests is consistentlylarger. It must be noted however that these tests were conducted first, so larger differences

    between tests could have resulted simply from unfamiliarity with the machine. Variance isChi-squared distributed and a hypothesis test at a .05 significance level showed no difference

    between the standard deviations of 2D and 3D. Hence it is assumed the standard deviationsare the same.

    Figure 9.3 Standard deviation of stress in steel versus strain for 2D and 3D

    A confidence interval can hence be constructed for the difference in mean using a pooledstandard deviation. A 95% confidence interval band is shown in figure 9.4. The difference inmean line always lies very close to 0. The confidence interval is quite narrow especiallycompared to the large stresses that are reached. Hence based on this data, there is no reason toconclude 2D measures any different than 3D for the shear test.

    Figure 9.4 Difference in mean stress (2D-3D) and 95% confidence interval versus strain

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    19/37

    19

    The main question arises from the reliability of the test. The G-modulus is defined as theengineering shear stress over the engineering shear strain. Doubling the values on the x-axisof the stress-strain plots converts them to approximately the engineering shear strain. Thenfinding the slope of the tangent to this curve at the origin gives a G-modulus of only 30 GPacompared to the expected 77 GPa. Also, finding

    0.2%by plotting a line with this slope and

    seeing where it intersects results in a value of about 60 MPa, much lower than the expected80 MPa. It s important to note however that this literature value was calculated from the yieldstress in tension with the von Mises Criterion; depending on which yield criterion is used, adifferent value is obtained. Hence an experimental value is necessary. Most likely the largeexperimental error in the steel tests are due to severe slipping out of the grips, already at verylow deformations. It could also be due to unexpected out of plane motion such as buckling,which makes the plate appear much weaker in shear.

    Aluminum

    Figure 9.5 Shear stress versus strain in Al AA-6016

    As with the steel, the stress strain curves all follow approximately the same shape. However,the elastic zone seems a lot narrower and better defined. Once the non-linear part has passed,the curves flare out. In figure 9.6, the standard deviations for 2D and 3D are plotted. Fromthis it is evident that the curves seem to spread out slightly as the deformation increases, sincethe standard deviation shows a slight positive trend, unlike in the tests on steel. However, alarge difference between 2D and 3D standard deviation is not observed.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    20/37

    20

    Figure 9.6 Standard deviation of stress in Aluminum versus strain

    Figure 9.7 shows sampled means at various strains for the 2D and 3D tests. The means for 2Dtests lie generally higher than the 3D tests. This is most likely due to a slight change in

    procedure that occurred between those tests. For the 3D tests, the whole sample was paintedand placed into the machine. For the 2D tests, only the deformation zone was painted. Alsothe shims were replaced. The 2D tests hence had optimal resistance against slipping out of thegrips. Figure 9.8 shows the difference in mean and a 95% confidence band. The confidence

    band moves below 0 indicating that indeed the means are different. The strain is plotted on alogarithmic scale to show there is a small region where the means are not different. Probablythis is the elastic zone. Again this demonstrates that slight alterations in the procedure can

    have drastic effects on the results.

    Figure 9.7 Mean stress in Aluminum versus strain for both 2D and 3D

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    21/37

    21

    Figure 9.8 Difference in mean stress (3D-2D) versus strain and 95% confidence interval

    In terms of reliability, the tests on aluminum are much better than the tests on steel. A linefitted to the start of the stress strain curves revealed a G-modulus of around 25 GPa, which isaround the literature value. Also, using the .2% offset method, y was calculated to be around100 MPa. Since this is an age-hardening alloy, and the tensile properties were tested a fewmonths ago, it s possible 100 MPa is an accurate value since the material became stronger since. Possibly, because aluminum is a softer material, the grips have a better grip on the testsample than on the steel. Less slip means more accurate results. Also, it s possible that

    because the aluminum sheet was thicker, it experienced less out of plane motion.

    Out of Plane MotionIf out of pl ane motion is occurring, that is the speckled surfaces don t remain planar, thestrain measurement should barely be affected. The out of plane motion will be very small andhence speckles will appear to move approximately the same distance in the x-direction.However, measurements of stress may become highly unreliable. As the plate folds, the platecan locally bend in favor of shearing. Far less energy is required for this type of deformationand hence force readings are a great underestimate. To what extent buckling of the sheet

    produces inaccurate results can be a topic of further study.For further investigations, it would be best if out of plane motion were avoided altogether.Possibly an indication of whether significant displacements in the Z direction are occurringcan be given through the 3D DIC data. Whereas the displacements u and v in the plane of thesample are calculated, w is not. U V and W are calculated, but these are relative to axes fixedto the view of the camera, not the sample. Plotting W over the deformation zone can givelimited qualitative information about out of plane motion. In figure 9.9, this is done for thelast image of a test on steel and aluminum respectively

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    22/37

    22

    Figure 9.9 W plotted over the deformation zone for steel and aluminum respectively

    The color scheme should be interpreted carefully. The blues and reds don t necessarilyindicate regions of most out of plane motion; they indicate regions that moved away from thecamera most. It is reasonable then that if the viewing plane was at an angle to the deformation

    zone, the top edge of the deformation zone underwent a larger Z-displacement than the lower edge. What is most remarkable however are differences in Z-displacement on the samehorizontal line. This is most likely an indication of out of plane motion. How large this effectis, when it occurs, how to calculate it and how to prevent it should be investigated further.

    Gripping ProblemsThe most important factor jeopardizing reliability of the tests are gripping problems. It is verydifficult to reproduce the exact same gripping conditions for each test. Even the dimensions,

    positioning and lubrication of the shims has a large impact on the results of the test.Especially the bottom grip had difficulty properly gripping the sample, as was indicated by anabsence of teeth marks on the sample.Bad gripping encourages slip and makes the stress-strain relationship less certain becauseextra energy is dissipated through friction and the sample will deform differently inside thegrips than outside the grips. If work on this machine is to be continued, a permanent solutionto the grips need to be found. In the meantime, all tests must be conducted with carefullydimensioned and positioned grips as to make the risk of slip as minimal as possible.

    Discussion and suggestionsOverall, it is evident that 2D-DIC gives very comparable results to 3D-DIC. Themeasurements are about the same, as well as the deviations between tests. Most of the error and deviations between tests will result from slight differences in setting up each test. 2D-DIC testing is much easier and faster. It is not easy to quantify out of plane motion becausethe Limess software doesn t provide the z displacement in a convenient form . Writing codeto remap the data is out of the scope of this project. Perhaps it may be worthwhile in a futureinvestigation to test whether out of plane motion truly has a large impact on the propertiestested in simple shear; it is possible the majority of the error comes from the problem with thegrips. To be safe when testing a new material, either a few tests can be conducted using 3D-DIC to test for out of plane motion or, when in doubt, the deformation zone height can bereduced.Most of the error comes from variations in the setup and problems with the gripping. Toincrease test accuracy and precision, the actual machine should be analyzed and upgraded,with emphasis on the grips.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    23/37

    23

    ConclusionsIn this investigation, the shear test was analyzed with 2D and 3D DIC for two referencemetals, aluminum and steel, with the goal of simplifying the procedure of measuring strain.

    The mechanics and significance of simple shear and pure shear were explained in theory. Adiscussion of the machine at MTM tried to clarify how simple shear would be achieved andmeasured. The strengths and weaknesses of the machine were discussed. Test results showedthat 3D and 2D measurements are about equally accurate. It was therefore concluded the 2Dmeasurement procedure could replace the 3D procedure. Caution must always be exercisedwhen there is suspicion of slipping out of the grips or out of plane motion.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    24/37

    24

    Appendix A: Procedure 2.0 for the Shear Tester

    1) Turning the machine on (2 min)

    a) Plug in the machine with the thick cable. This is done at a high voltage power outletnear the white door.b) Turn the machine on, first by turning the red button 90 degrees, then pressing the

    green button.c) Start the computer up with password Labohall. Start the Shearpanel software.

    2) Setting up the camera (20 min) a) Make sure the tripod is leveled, set up so that one leg is pointing backwards and two

    towards the machine. b) Eye it so that the main camera (the labeled one, the other is not used) will face the

    deformation zone perpendicularly. Also it should sit straight up as much as possible. c) The camera should be at a .5-1m distance from the deformation zone. This will

    ensure minimal effects from potential slight non-perpendicularity, whilst optimizingresolution.

    d) Make sure the correct large lens is on the camera that will be used

    3) Connecting the camera (5 min) a) Start up the laptop with either password KUL or no password. b) Connect all the cables by the laptop as shown. Make sure everything is plugged into

    the power (the station should also have one big plug that can plug into the socketsplitter connected to machine) and the power button on the leg of the computer tablelights up orange.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    25/37

    25

    c) Connect the wide and round cable as shown. The wide cable should have a whitelabel. If all is correctly connected, the green light on the camera should be on. If theLimShot software is started on the laptop, the red/orange light should also light upand the view from the camera should be visible on the laptop.

    d) Troubleshooting: if nothing shows up in the LimShot software, check whether thelens cap is off and whether all connections were properly made. The view may also

    just be too dark, try to point the cameras at light and increasing the exposure. If allthis is done, consider a reboot of the computer.

    4) Preparing a sample (5 min) a) Mark the size of the deformation zone with a permanent marker. It should be

    approximately in the center so the clamping zones are equal. Tape off the clampingzones with masking tape.

    b) Go upstairs to the composites lab. One of the fumehoods is covered with black paper on the inside. Lay down a sample and spray it white. It should be completely white,

    but the paint layer on the deformation zone shouldn t be too thick, otherwise it willtake too long to dry and crumble. Once the paint has had about a minute to dry spraysmall black speckles over the white. This is achieved by holding the black spray canat about a meter distance. The white and black paint spray cans are stored in thecabinet to the left of the fumehood.

    c) Once the sample is painted, remove the masking tape d) Turn the spray cans upside down and spray until no more paint comes out. This is to

    keep the nozzles clean. e) Don t prepare multiple samples at once, the paint gets too dry a nd the test

    5) Mounting the sample (20 min)a) Ensure the upper grip is aligned with the lower grip by checking whether the

    displacement reading is around 0. If it is not, start control on shearpanel, then jogcontrol, then align the grips with the jog control box.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    26/37

    26

    b) Make sure the table bolts are loose, then crank down the table until a hand can fit between the grips.

    c) Turn the handle of the upper grip to clamp, hold the sample in the correct place andslowly push down on the pedal. Don t grip it too hard yet, but it should just stay in

    place. Take a piece of metal and push on the shim in the front so it stays in place,then continue to drive up the pressure to the maximum. Release the pedal and turn thehandle to hold.

    d) Zero the tensile and shear force by pressing the rst button

    e) Put the side support of the upper grip in place. The supports should be each fastenedabout 1/4

    thof a turn with the spanner.

    f) Make sure the shear force hasn t changed too much; otherwise loosen the bolts a bit.g) Crank the table up so that only the deformation zone is showing out of the grips. The

    distance between the grips can be verified with a calibrated steel rod.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    27/37

    27

    h) If the lower grip is in place, turn the lower grip handle to grip and press the pedal togrip to the maximum. Also hold down the front shim with a piece of metal.

    i) Play with the table height so the tensile force becomes 0 again. j) Tighten the table bolts to 190 Nm with the spanner that is found in the lab with

    fatigue tests. This should be done in a diagonal fashion: first tighten one bolt, thenwalk around the machine and tighten the bolt furthest away from it.

    k) Play with the table height again to zero the tensile load.

    l)

    Put in place the side support for the lower grip. Tighten the bolts such that the shear force is as near to 0 as possible.6) Lighting and focusing (10 min)

    a) Take one or two spotlights from somewhere and point them at the deformation zone.Make sure no shadows appear on it. Also make sure the sample is sufficiently lit.

    b) Open the aperture completely. This is done by rotating the thing at the front of thelens. When the aperture is open, the view on the screen of the laptop should becomevery bright with red spots all over the place. Turn down the exposure slider in the

    program until no more red is in view.c) Focus the camera by rotating the main cylinder on the lens. The speckles should be

    perfectly visible in the view. Fasten the little screw so the focus is fixed.d) Close the aperture completely. Turn up the exposure slider just before the point red

    spots begin to appear on the deformation zone.7) Start the test (5 min)

    a) On Shearpanel, start control, measurement, new test. Give a name that makes the testidentifiable. Enter a final displacement as well as a test velocity. The velocity usuallystays 1 mm/min.

    b) On the laptop, check into the options that the number of pictures taken isn t limited.Also check the interval at which images are taken. Make sure the images will besaved in the correct folder.

    c) Start recording images by pressing the camera button. Make sure the counter is goingup. Then go start the test on Shearpanel.

    8) After the test (20 min)a) When the test is done depends on the final displacement entered and the test velocity.

    Record a few more pictures and force values in time, then stop recording images andstop the test.

    b) Exit the recording software and open the 2D-DIC software. One must have theLimess USB key! In Project, open Speckle Image Folder and navigate to the folder inwhich the images were taken. Mark off the deformation zone with the rectangle tool.Then go to calibration, calibrate scale and with the second tool mark off the scale (thewidth of the deformation zone should be known). Sometimes the rectangle marker isn t shown. A reboot of the software should fix this p roblem.

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    28/37

    28

    c) Exit measurement and start jog control. Move the upper grip to a position so that theshear force becomes 0.

    d) Take off all the side support.e) Loosen all the table boltsf) Release both the grips to pressure 0g) Take out the sample and label ith) Move the upper grip all the way to position 0 with jog control.i) When the analysis on 2D-DIC is done go to Data, export Data and export as csv files.

    Then close the program and start Limshot again. j) For a new test, begin this procedure again at step 4 and skip 6 as long as the camera

    doesn t move. 9) Every 4-6 tests, the grips should be cleaned and re-lubricated. Do this following the

    procedure described by [Shore, 2010].

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    29/37

    29

    Appendix B. Developed Software Code

    Interpolation procedure

    %uses force.dat analog.csv and AvgShear.csv to construct %a stress strain table that is exported as StressStrain.csv.

    clc;clear;

    %width and thickness of the sample in meters w=.05;t=.0007;

    %import strains (always in the second column of the csv) strains=csvread( 'AvgShear.csv' ,0,1);tilwhen=size(strains);%import the times going along with strain measurements. Depending on whether 2 cameras were used or 1 (3D or 2D),the times are in col 3 or col 2 coltimes=3;times=csvread( 'analog.csv' , 1, coltimes, [1 coltimes tilwhen(1,1) coltimes]);

    %Construct [time (s) strain (green-lagrange)] %divide timestrain by 1000 only in 2D not in 3D!! timestrain=zeros(1,2);for n=1:tilwhen

    timestrain(n,1)=times(n,1);timestrain(n,2)=strains(n,1);

    end

    rwstrain=size(timestrain);%Recording of strain typically happened before the test was actually started. Therefore the 0 values must be takenout at the beginning. There are slight fluctuations so => less than 10^-3 except the first one. Since strain valueshappen to be negative, check for whether it's smaller than -10^-3. Also take off the first value of time so itstarts recording at 0 time. accurac=-2*10^-4;%construct a temporary storage matrix timestrainc=zeros(1,2);for n=1:rwstrain(1,1)

    %check whether strain is larger than .001 if timestrain(n,2)1;

    %copy time strain to the temp matrix only from where the test started timestrainc=[timestrain(n-1:rwstrain(1,1),1), timestrain(n-1:rwstrain(1,1),2)];%set first strain value at 0 timestrainc(1,2)=0;break

    end end

    rwss=size(timestrainc);inistr=timestrainc(1,1);

    for n=1:rwss(1,1)%subtract the beginning time from each time timestrainc(n,1)=timestrainc(n,1)-inistr;

    end

    %The test doesn't end when the set distance is reached, so an end point must be determined. This is seenapproximately in the dat file when the displacement ceases to increase.

    %import the dat file force=dlmread( 'force.dat' , '\t' , 1, 0);%keep only [time, motor position, linear position, shear force]. Use motor position to check when test is done. Accis the interval between motor positions used to check. acc=.001;timestressc=[force(:,2), force(:,3), force(:,4), force(:,5)];rws=size(timestressc);timestress=zeros(1,4);

    %only rows are copied where the machine hasn't stopped for n=1:rws(1,1)

    %difference between the current element of motor pos and the next valy=timestressc(n+1,2)-timestressc(n,2);%check whether difference exceeds acc if abs(valy)>acc && n

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    30/37

    30

    ended. Copy rows until then. if timestrainc(n,1)1%determine the times where the stress time tx lies in between

    tmin1=timestrain(n-1,1);tt=timestrain(n,1);if tt>tx

    %find the new strain value based on linear interpolation interpol=(timestrain(n,2)-timestrain(n-1,2))/(tt-tmin1)*(tx-tt)+timestrain(n,2);break

    end else

    tmin1=0;tt=timestrain(n,1);if tt>tx

    interpol=(timestrain(n,2))/(tt-tmin1)*(tx-tt)+timestrain(n,2);break

    end end

    end %[strain, stress] stressstrain(k,2)=timestress(k,4);stressstrain(k,1)=abs(interpol);

    end

    xlswrite( 'StressStrain.csv' , stressstrain);

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    31/37

    31

    Statistics calculation

    %this script should take in the stress-strain csv data from a few %tests, both 2D and 3D and automatically producethe analysis%prerequisit: the csv should be set up so that 2D tests are first %then 3D tests. Also, tests should start at row0. If the csv was %constructed with 3D tests first then note this in the script. The %data should also be ordered! clc;

    clear;matr=csvread( 'stressstrain.csv' , 0, 0);s=size(matr);s=s(1,1);%number of 2D tests n2=5;%number of 3D tests n3=7;%vector of strain values to check at vec=[.0005; .001; .0015; .002; .003; .004; .005; .01; .02; .03; .04; .06; .08; .1; .12];leng=size(vec);leng=leng(1,1);

    %matrix with interpolated values vals=zeros(1, n2+n3);

    %loop over the tests for k=1:(n2+n3)

    %var that runs over vec stran=1;%loop over one test for n=1:s

    %check whether there are still values to the test if %there are no more values in the test, itcould be the %row is just shorter than the longest one or the test %actually didn't record upto that strain value. This %script has not been tested to deal with the second %type.

    if isnan(matr(n,2*k-1))==false%check where to copy the stress from if matr(n, 2*k-1)>vec(stran,1)

    %interpolating and filling in to vals vals(stran,k)=(matr(n, 2*k)-matr(n-1, 2*k))/(matr(n, 2*k-1)-matr(n-1, 2*k-1))*(vec(stran,1)-matr(n,

    2*k-1))+matr(n, 2*k);stran=stran+1;

    end end if stran>leng

    break end

    end end % now vals should be produced. a table statt is constructed. statt=zeros(1,1);for i=1:leng

    %mean 2D and 3D ALU -> 3D first statt(i,1)=mean(vals(i,1:n2));statt(i,2)=mean(vals(i,(n2+1):(n2+n3)));%difference in means statt(i,3)=statt(i,1)-statt(i,2);%standard dev statt(i,4)=std(vals(i,1:n2));statt(i,5)=std(vals(i,(n2+1):(n2+n3)));%Are variances same? statt(i,6)=vartest2(vals(i,1:n2), vals(i,(n2+1):(n2+n3)), .05);%calculate S if variances are the same statt(i,7)=sqrt(((n2-1)*statt(i,4)^2+(n3-1)*statt(i,5)^2)/(n2+n3-2));%95% conf int coni=.05;statt(i,8)=statt(i,3)-tinv(1-coni/2, n2+n3-2)*statt(i,7)*sqrt(1/n2+1/n3);statt(i,9)=statt(i,3)+tinv(1-coni/2, n2+n3-2)*statt(i,7)*sqrt(1/n2+1/n3);statt(i,10)=statt(i,9)-statt(i,8);%probability of a type II error -> H1 is correct but you don't notice it. You have a t-dist over 0, this is

    your %null hypothesis. what is the probability that the difference actually %is statt_3 -> best estimate? sigx1=0-tinv(coni/2, n2+n3-2)*statt(i,7)*sqrt(1/n2+1/n3);sigx2=0+tinv(coni/2, n2+n3-2)*statt(i,7)*sqrt(1/n2+1/n3);if statt(i,3)sigx2;

    statt(i,11)=tcdf((sigx2-statt(i,3))/(statt(i,7)*sqrt(1/n2+1/n3)),n2+n3-2);else

    statt(i,11)=0;end %if variances are not the same, you can only set up confidence %intervals for the two tests statt(i,12)=statt(i,1)-statt(i,4)*tinv(1-coni/2, n2-1)/sqrt(n2);statt(i,13)=statt(i,1)+statt(i,4)*tinv(1-coni/2, n2-1)/sqrt(n2);statt(i,14)=statt(i,2)-statt(i,5)*tinv(1-coni/2, n3-1)/sqrt(n3);statt(i,15)=statt(i,2)+statt(i,5)*tinv(1-coni/2, n3-1)/sqrt(n3);%copy the vector of strains statt(i,16)=vec(i,1);%copy number of 2D and 3D in there statt(i,17)=n2; %with steel this is 2D statt(i,18)=n3; %with steel this is 3D %confidence interval std 1 statt(i,19)=sqrt((n2-1))*statt(i,4)/chi2inv(coni/2,n2-1);statt(i,20)=sqrt((n2-1))*statt(i,4)/chi2inv(1-coni/2,n2-1);%confidence int std 2 statt(i,21)=sqrt((n3-1))*statt(i,5)/chi2inv(coni/2,n3-1);statt(i,22)=sqrt((n3-1))*statt(i,5)/chi2inv(1-coni/2,n3-1);

    end

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    32/37

    32

    csvwrite( 'stats.csv' , statt);csvwrite( 'vals.csv' , vals)

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    33/37

    33

    Essential Selection from the Strain Extraction Algorithm

    Main Script

    # get the list of data filesfileList = shearFunctions.GetFileList(pattern=filterPattern, extension=fileExtension)

    noFiles = len(fileList)if noFiles < 3:raise Exception('Only {0} files found. Not enough DIC data to work with.'.format(noFiles))

    print '{0} files found.'.format(noFiles)referenceFileNum = int(frameCorrAtPercent*noFiles/100)referenceFileName = fileList[referenceFileNum]

    # get DIC data for the frame to be used for rotation correction(colLabels, data) = shearFunctions.ReadCSVFile(fileName=referenceFileName)

    # calculate rotation angle required using the given reference file(rotationAngle, pointsUsedinCalc, totalNoCorrPoints) = shearFunctions.CalcRotation(colLabels=colLabels, data=data)

    # create a mask to filter out inhomogenously deformed regions. Initially# the array is set everywhere to True (ie. all points are good)totalNoPoints = len(data)filterMask = np.ones((totalNoPoints,1)) == 1.0

    # average shear dataavgExyWholeField = []avgExyCentreLine = []

    avgExySmallCircle = []

    # loop through all of the filesfor counter in range(noFiles):

    fileName = fileList[counter]print 'Processing file {0} of {1} '.format(counter, noFiles, fileName)

    # read each DIC data file(colLabels, data) = shearFunctions.ReadCSVFile(fileName=fileName)noPointsCurFile = len(data)if not noPointsCurFile==totalNoPoints:

    raise Exception('The file {0} has {1} data points, which differs from the reference file ({2}points).'.format(fileName, noPointsCurFile, totalNoPoints))

    # apply rotation to strain and displacement fields in 2D (Z displacement is untouched)correctedData = shearFunctions.RotateStrainDispFields(colLabels, data, angle=rotationAngle)

    # update the filter by checking the homogenity criterion (ie. check if the# deformation gradient component F11, see Van Boxel Thesis)filterMask = shearFunctions.FilterByDeformGrad(colLabels=colLabels, data=correctedData,

    tolerance=defGradientTolereance, oldMask=filterMask)

    # check if too many points have not been correlated/ filtered outremainingPoints = np.count_nonzero(filterMask)

    print '{0} of {1} (successfully correlated) points meet homogeneity criterion.\n'.format(remainingPoints,totalNoCorrPoints)

    if remainingPoints < (minPercentRequir ed * totalNoCorrPoints / 100):raise Exception('Less than {0}% correlated points have passed the homogeneity test.

    Halted.'.format(minPercentRequired))

    # calculate 'average' shear strain E12 (various methods)avgExyWholeField.append(shearFunctions.AvgWholeField(correctedData, filterMask, colLabels, label=exyLabel))

    # the following are not implemented yet# avgShearCentreLine = []# avgShearSmallCircle = []

    # save the result to a CSV fileshearFunctions.SaveColumnCSV(fileName='AvgShear.csv', colData=avgExyWholeField, labels=fileList)

    """Shear tester machine output processing functions"""

    # -------------- function definitions -------------

    def CalcRotation(colLabels, data):""" Calculate the rotation correction to be applied to the shear DIC displacement/ strain field

    reference Frame.

    This is done following Steven Van Boxel's method by determining the angle the 'averagedisplacement vector' makes with the initial reference frame x axis. This assumes that:

    o no significant vertical displacement has occured at the time the referencefiles refers to; that the deformation gradient can be assumed to have the form

    | 1 gamma 0 |F = | 0 1 0 | with gamma = tan(theta), theta = the simple shear angle

    | 0 0 1 |o the displacement field is 'homogenous enough' (it should be!- if not something is likely

    wrong with the test data or the deformation is too advanced at the stage to which thereference displacement data corresponds)

    The algorithm works as follows:1) calculate the average displacement vector for all points in the displacement field2) compare the displacement vector for each point to this average, eliminate those with

    a difference greater than "outlierAngle"3) Recalculate the average, and repeat the above comparison until either the difference

    for all points falls below "convergenceTestAngle", or the iteration limit set by"maxDispAngleIterations" is reached

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    34/37

    34

    Note that outlierAngle > convergenceTestAngle"""print 'Calculating rotation required..'# get displacements and strains. Note the label names are set in the file "shearConfig.py"# note numpy arrays are referenced with square brackets, eg element = data[row,col]horizDisp = data[:,GetColumn(colLabels=colLabels, label=UdispLabel)]vertDisp = data[:,GetColumn(colLabels=colLabels, label=VdispLabel)]

    correlationFlag = data[:,GetColumn(colLabels=colLabels, label=correlationFactorName)]totalNumPoints = len(data)

    # generate a boolean mask to filter uncorrelated pointsfilterMask = correlationFlag != -1

    # variables for filtering outliersconverged = FalseiterationNo = 0firstIteration = TruenewMask = filterMask

    # main algorithm loopwhile(iterationNo < maxDispAngleIterations and not(converged)):

    # copy result from last iteration, increment the counteroldMask = newMask

    # for the first iteration the value given in "outlierAngle" is used# to eliminate points.if firstIteration:

    newMask = GetMaskFromAngleTests(horizDisp=horizDisp, vertDisp=vertDisp, testAngle=outlierAngle,filterMask=oldMask)

    firstIteration = False

    # otherwise use the value of "convergenceTestAngle"else:

    newMask = GetMaskFromAngleTests(horizDisp=horizDisp, vertDisp=vertDisp, testAngle=convergenceTestAngle,filterMask=oldMask)

    # check for convergence by checking if the number of points in the current and# previous filtering operations is the same (ie. no more filtering is occuring)# Note: Python considers "False" to have the value zero, and "True" as non-zeroconverged = np.count_nonzero(newMask) == np.count_nonzero(oldMask)iterationNo += 1

    # get some statisticstotalPoints = np.count_nonzero(filterMask)pointsUsed = np.count_nonzero(newMask)if not(silent):

    print '{0} points of {1} are being used in the rotation calculation'.format(pointsUsed, totalPoints)

    # give a warning if convergence didn't occurif not(converged) and not(silent):

    warnings.warn('Convergence did not occur in {0} iterations.'.format(iterationNo))# return the angle,the number of points used in the calculation and total number of pointsavgDispVector = CalcAvgVector(horizDisp=horizDisp, vertDisp=vertDisp, filterMask=newMask)rotationAngle = np.degrees(np.arctan2(avgDispVector[1],avgDispVector[0]))

    return (rotationAngle, pointsUsed, totalPoints)

    def GetMaskFromAngleTests(horizDisp, vertDisp, testAngle, filterMask):""" return a boolean mask which is "True" for every vector (ie. pair of elements in "horzDisp"

    and "vertDisp") which is at an angle less than or equal to "testAngle", wrt. to the vector"avgDisp". "filterMask" is used to ignore selected points (usually uncorrelated points)

    """

    # calc average displacement vector (Not normalised!)avgDispVector = CalcAvgVector(horizDisp=horizDisp, vertDisp=vertDisp, filterMask=filterMask)

    # calc angles between vector for each point and the average vectornumPoints = len(horizDisp)angles = [0.0]*numPointsangleTestMask = [False]*numPoints

    for currentPoint in range(numPoints):# preivously excluded points are skipped in the angle calculationif filterMask[currentPoint]:

    currentVector = [horizDisp[currentPoint], vertDisp[currentPoint]]angles[currentPoint] = CalcAngle(vectorA=currentVector, vectorB=avgDispVector)

    # return boolean mask for points whose vector makes an angle less than "testAngle" with# the average displacement vector. Note this mask is implicitly ANDed with the given# "filterMask"mask = np.array(angles) < (abs(testAngle))return mask

    def CalcAvgVector(horizDisp, vertDisp, filterMask):""" calculate a vector based on the average of the horizontal and vertical displacements"""return np.array( [np.average(horizDisp[filterMask]), np.average(vertDisp[filterMask])], dtype=defaultPrecision)

    def CalcAngle(vectorA, vectorB, smallestAngle=True, degrees=False):""" return the angle between two n-dimensional vectors (should be two nx1 or nx0 numpy column

    matrices or arrays, or two nx0 or nx1 Python lists)

    setting "smallestAngle"="True" returns the smallest angle between the two vectors"""

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    35/37

    35

    dotProductOfNormedVectors = np.dot( (vectorA/np.linalg.norm(vectorA)), (vectorB/np.linalg.norm(vectorB)) )

    # calculate the angle in radiansif smallestAngle:

    angle = np.arccos(abs(dotProductOfNormedVectors))else:

    angle = np.arccos(dotProductOfNormedVectors)

    # return the angle in radians or degrees, as requiredif degrees:

    return np.degrees(angle)else:

    return angle

    def CalcAvgNormDispVector(horizDisp, vertDisp, filterMask):""" calculate the average normalised displacement vector for the given points, filtering

    out the uncorrelated points using the given boolean mask"""avgHorzDisp = np.average(horizDisp[filterMask])avgVertDisp = np.average(vertDisp[filterMask])vectorNorm = np.linalg.norm([avgHorzDisp, avgVertDisp])

    return np.matrix([[avgHorzDisp/vectorNorm],[avgHorzDisp/vectorNorm]])

    def FilterByDeformGrad(colLabels, data, tolerance, oldMask, returnMask=True):""" return a mask which is False for every point for which the F11 component of the

    deformation gradient is greater than "tolerance" away from 1"""noPoints = len(data)

    # remove any uncorrelated points (flagged as -1 by the DIC system)correlationFlag = data[:,GetColumn(colLabels=colLabels, label=correlationFactorName)]uncorrelatedMask = correlationFlag != -1

    # apply the deformation gradient criterionExx = data[:,GetColumn(colLabels=colLabels, label=exxLabel)]F11 = np.abs(np.sqrt(2*Exx +1))defGradMask = F11 < (1 + tolerance)

    # combine all of the aboveupdatedFilterMask = oldMask.reshape(noPoints,1) * uncorrelatedMask.reshape(noPoints,1) *

    defGradMask.reshape(noPoints,1)updatedFilterMask = updatedFilterMask.reshape(noPoints,)

    # return the filtered data, or just the filtering maskif returnMask:

    return updatedFilterMaskelse:

    return data[updatedFilterMask,:]

    def RotateStrainDispFields(colLabels, data, angle):

    """ returns the data with the strain values and displacements rotatedby the given angle in degrees, within the plane of X/Y U/V Exx/Eyy/Exy(Z displacement and gamma as calculated by VIC are untouched)

    """print 'Applying rotation...'# find data to be manipulatedUcol = GetColumn(colLabels=colLabels, label=UdispLabel)Vcol = GetColumn(colLabels=colLabels, label=VdispLabel)exxCol = GetColumn(colLabels=colLabels, label=exxLabel)eyyCol = GetColumn(colLabels=colLabels, label=eyyLabel)exyCol = GetColumn(colLabels=colLabels, label=exyLabel)

    # break data into componentsrotatedData = dataU = data[:,Ucol]V = data[:,Vcol]Exx = data[:,exxCol]Eyy = data[:,eyyCol]Exy = data[:,exyCol]

    # make vector and tensor matricesUVvector = np.vstack((U.transpose(), V.transpose()))

    EmatrixLeftColTopRow = np.vstack((Exx.transpose(), Exy.transpose()))EmatrixRightColBotRow = np.vstack((Exy.transpose(), Eyy.transpose()))

    # build rotation matrix## R = | c s |# |-s c |r11 = np.cos(np.radians(angle))r12 = np.sin(np.radians(angle))r21 = -r12r22 = r11R = np.array([[r11,r12],[r21,r22]], dtype=defaultPrecision)

    # apply vector rotationrotatedUV = np.dot(R,UVvector)

    # calculate strain tensor rotationrotatedExx = r11*(Exx*r11 + Exy*r12) + r12*(Exy*r11 + Eyy*r12)rotatedExy = r21*(Exx*r11 + Exy*r12) + r22*(Exy*r11 + Eyy*r12)rotatedEyy = r21*(Exx*r21 + Exy*r22) + r22*(Exy*r21 + Eyy*r22)

    # reassemble data and return

    rotatedData[:,Ucol] = rotatedUV[0,:].transpose()rotatedData[:,Vcol] = rotatedUV[1,:].transpose()rotatedData[:,exxCol] = rotatedExxrotatedData[:,eyyCol] = rotatedEyy

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    36/37

  • 7/27/2019 Bachelor thesis: Improving the Shear Tester at MTM, KULeuven

    37/37