The Pennsylvania State University The Graduate ... - ETDA - Penn State

28 downloads 145752 Views 1MB Size Report
Differences in error reduction ratios between these two machines were ..... Figure 1-1: RP Process (Source: http://www.oki.com/en/otr/html/nf/otr-159-12-.
The Pennsylvania State University The Graduate School College of Engineering

PARAMETRIC ERROR MODELING AND SOFTWARE ERROR COMPENSATION FOR RAPID PROTOTYPING

A Thesis in Industrial Engineering and Operations Research by Kun Tong

© 2005 Kun Tong

Submitted in Partial Fulfillment of the Requirements for the Degree of

Doctor of Philosophy

May 2005

The thesis of Kun Tong was reviewed and approved* by the following:

Sanjay Joshi Professor of Industrial Engineering Thesis Co-advisor Chair of Committee

E. Amine Lehtihet Professor of Industrial Engineering Thesis Co-advisor

Tom M. Cavalier Professor of Industrial Engineering

Enrique del Castillo Professor of Industrial Engineering

Eric Marsh Associate Professor of Mechanical Engineering

Richard J. Koubek Professor of Industrial Engineering Head of the Department of Industrial and Manufacturing Engineering

*Signatures are on file in the Graduate School

iii ABSTRACT Rapid prototyping (RP) machines can build parts of complex geometry with very little process planning and human interaction, making them a very attractive manufacturing process. However, inferior dimensional accuracy of these processes is a major obstacle preventing this technology from greater penetration of manufacturing activities. This research presents a generic method for improving the accuracy of RP machines by error compensation using “virtual” parametric errors. It was inspired by techniques developed for parametric evaluation of Coordinate Measuring Machines (CMM) errors. Under this approach, the confounded effects of all errors in a RP machine are mapped into 18 “virtual” parametric errors which are used to build the machine error model. A specially designed 3D artifact is then built on the RP machine and measured by a master CMM. Measurement results are used to estimate the coefficients of the parametric error functions. Error compensation based on the derived error model is finally applied via software to the files which drive the RP machine. Two compensation methods were developed and tested. The first one applies compensation to StereoLithography (STL) files while the second applies compensation to slice files. Compensation applied to slice files theoretically allows higher compensation resolution, but machine control resolution must be sufficiently fine in order to take advantage of this strategy. The resolution of the RP machine used in this study to test slice file compensation was too coarse to distinguish significant differences between slide file compensation and STL file compensation.

iv Experimental studies were conducted on a SLA 250 machine and a FDM 3000 system to validate and demonstrate the approach. Results showed that the volumetric error was reduced on average to around 33% of its original value for the SLA machine. In the study of a part with common features and dimensional constraints, it was found that (a) overall size of the part and feature positions on the part were considerably improved, (b) cylindrical feature sizes were improved by a small amount, and (c) dimensions along the z direction did not show obvious improvement due to “z quantization”. “z quantization” was addressed in particular to eliminate multiple layers phenomenon in compensated parts. Compensation results of the FDM 3000 machine were compared with those of the SLA machine. Differences in error reduction ratios between these two machines were analyzed. Finally, the design optimization problem of 3D artifact was studied. The coefficients of the “virtual” parametric error functions were estimated using the error data sampled from the 3D artifact. There are potentially different artifacts that can be used to sample these errors in the RP working volume. Each will result in a different accuracy of the estimated coefficients. How to choose these sampling points in the RP working volume is a Design of Experiments (DOE) problem. D-optimality criterion was employed to verify and improve the design of the 3D artifact. Mathematical programming and simulated annealing algorithm were used for optimization of the design. In conclusion, this research provides a low cost, generic software compensation method to improve the accuracy of a RP process with no hardware modification. “Virtual” parametric error functions not only enable a rational comparative evaluation of competing RP processes on the basis of a quantitative assessment of volumetric accuracy,

v but also serve as a diagnostic tool for the identification of direction dependent error sources due to other process characteristics.

vi TABLE OF CONTENTS LIST OF FIGURES .....................................................................................................ix LIST OF TABLES.......................................................................................................xiii ACKNOWLEDGEMENTS.........................................................................................xiv Chapter 1 Introduction to Rapid Prototyping..............................................................1 1.1 Rapid Prototyping Process..............................................................................1 1.1.1 STL (StereoLithography) Model..........................................................2 1.1.1.1 Vertex-to-vertex Rule.................................................................4 1.2 Commercial RP Processes ..............................................................................4 1.3 Advantages and Limitations of RP Processes ................................................7 1.4 Motivation of this research .............................................................................8 1.5 Basic Idea of Software Error Compensation Approach .................................9 1.6 Problem Statement..........................................................................................10 1.7 Organization of the Dissertation.....................................................................11 Chapter 2 Review of Research Related to RP Accuracy ............................................12 2.1 Accuracy Evaluation.......................................................................................12 2.2 Accuracy Improvement ..................................................................................15 Chapter 3 Software Error Compensation Approach ...................................................18 3.1 Machine Error Model .....................................................................................19 3.1.1 Parametric Error Modeling for CMMs.................................................20 3.1.2 “Virtual” Parametric Modeling for RP.................................................26 3.2 Machine Error Measurement ..........................................................................27 3.3 Error Compensation........................................................................................28 Chapter 4 Implementation of Error Compensation on a SLA 250 Machine ..............31 4.1 SLA Machine Error Model.............................................................................31 4.2 Legendre Polynomial Approximation ............................................................ 34 4.3 Artifact Method for Estimation of Error Function Coefficients..................... 38 4.4 Application to a 2D Artifact ...........................................................................39 4.4.1 2D Error Model and Artifact ................................................................39 4.4.2 Parametric Error Functions before Compensation ............................... 42 4.4.3 Parametric Error Functions after Compensation .................................. 47 4.5 Application to a 3D Artifact ...........................................................................49 4.5.1 3D Error Model and 3D Artifact ..........................................................50 4.5.2 Estimation of the Parametric Error Functions ...................................... 54

vii 4.5.3 Compensation Using Machine Error Model......................................... 63 4.5.3.1 Compensation Target File .......................................................... 63 4.5.3.2 Compensation by Correcting STL Files.....................................66 4.5.4 Feature Positioning Accuracy Improvement by Compensation...........69 4.5.5 Profile Accuracy Improvement by Compensation ............................... 73 4.5.6 Compensation of a Part with Common Features.................................. 75 4.5.7 Z Value Quantization in Rapid Prototyping .........................................79 4.5.8 Conclusions of 3D Artifact Test Results ..............................................82 Chapter 5 Implementation of Error Compensation on a FDM 3000 Machine ...........84 5.1 FDM Machine Error Model............................................................................84 5.2 Estimation of Coefficients in the Parametric Error Functions........................86 5.3 Compensation Methods and Results............................................................... 95 5.3.1 Feature Positioning Accuracy Improvement by STL File Compensation.........................................................................................95 5.3.2 Comparison of FDM and SLA Compensation Results ........................ 97 5.3.3 Slice File Compensation for Form Error Reduction.............................100 5.4 Conclusions.....................................................................................................106 Chapter 6 3D Artifact Design ....................................................................................107 6.1 Review of Linear Regression and Design of Experiments............................. 108 6.1.1 Multiple Linear Regression ..................................................................108 6.1.2 Design of Experiments and Computed-aided Design ..........................111 6.2 Linear Regression Machine Error Model .......................................................112 6.2.1 Single Response Model ........................................................................112 6.2.2 Multi-response Model ..........................................................................117 6.3 D-optimal Design for 3D Artifact...................................................................120 6.3.1 Design Problem Definition...................................................................120 6.3.2 Mathematical Programming .................................................................121 6.3.2.1 Problem Definition.....................................................................121 6.3.2.2 Optimization Result.................................................................... 125 6.3.3 Global Optimization .............................................................................128 6.3.3.1 Latin Hypercube Sampling.........................................................128 6.3.3.2 Simulated Annealing ..................................................................129 Chapter 7 Summary and Future Studies .....................................................................138 7.1 Summary.........................................................................................................138 7.2 Future Studies .................................................................................................140 7.2.1 Geometric Dependency of Dimensional Errors ................................... 140 7.2.1.1 Studies on Material Shrinkage in RP .........................................141 7.2.2 Geometric Accuracy of Features ..........................................................143 Bibliography ................................................................................................................154

viii Appendix A FORTRAN 90 Program for STL File Compensation ........................... 160 Appendix B MATLAB Optimization Program ..........................................................171 Appendix C Simulated Annealing MATLAB Program..............................................177

ix LIST OF FIGURES Figure 1-1: RP Process (Source: http://www.oki.com/en/otr/html/nf/otr-159-12fig-2.html).............................................................................................................2 Figure 1-2: STL Model of a Cylinder ..........................................................................3 Figure 1-3: Facet .........................................................................................................3 Figure 1-4: Vertex-to-vertex Rule ..............................................................................4 Figure 1-5: Stereolithography Apparatus.....................................................................5 Figure 1-6: Fused Deposition Modeling ......................................................................6 Figure 1-7: RP Software Error Compensation............................................................10 Figure 2-1: The “User-Part”........................................................................................13 Figure 2-2: Reeves and Cobb Test Part ......................................................................14 Figure 2-3: Juster and Child Test Part ........................................................................15 Figure 3-1: A Bridge-type CMM.................................................................................21 Figure 3-2: Axes and Carriages of a Bridge-type CMM ............................................22 Figure 3-3: The Axes Chain Vector Diagram of a Bridge-type CMM.......................23 Figure 3-4: Ball-plate used for CMM error measurement .......................................... 28 Figure 4-1: The SLA250 Machine Axes Chain Vector Diagram ............................... 32 Figure 4-2: Relationship between Squareness and Linear Term of Straightness Error......................................................................................................................36 Figure 4-3: 2D Hole Plate Test Part ( inch ) ................................................................ 41 Figure 4-4: Scale Error of X Axis before and after Compensation.............................44 Figure 4-5: Scale Error of Y Axis before and after Compensation .............................45 Figure 4-6: Straightness Error of X Axis in Y Direction before and after Compensation .......................................................................................................45 Figure 4-7: Straightness Error of Y Axis in X Direction before and after Compensation .......................................................................................................46

x Figure 4-8: Rotational Error of X Axis around Z Axis before and after Compensation .......................................................................................................46 Figure 4-9: CMM Measuring Probe ............................................................................52 Figure 4-10: 3D Artifact ..............................................................................................53 Figure 4-11: Scale Error of X Axis in SLA 250 Machine...........................................55 Figure 4-12: Straightness Error of X Axis in Y Direction in SLA 250 Machine ........ 56 Figure 4-13: Straightness Error of X Axis in Z Direction in SLA 250 Machine ........ 56 Figure 4-14: Straightness Error of Y Axis in X Direction in SLA 250 Machine .......57 Figure 4-15: Scale Error of Y Axis in SLA 250 Machine...........................................57 Figure 4-16: Straightness Error of Y Axis in Z Direction in SLA 250 Machine .......58 Figure 4-17: Straightness Error of Z Axis in X Direction in SLA 250 Machine ........ 58 Figure 4-18: Straightness Error of Z Axis in Y Direction in SLA 250 Machine ........ 59 Figure 4-19: Scale Error of Z Axis in SLA 250 Machine...........................................59 Figure 4-20: Roll of X Axis in SLA 250 Machine.......................................................60 Figure 4-21: Yaw of X Axis in SLA 250 Machine .....................................................60 Figure 4-22: Pitch of Z Axis in SLA 250 Machine.....................................................61 Figure 4-23: Yaw of Z Axis in SLA 250 Machine .....................................................61 Figure 4-24: Roll of Z Axis in SLA 250 Machine ......................................................62 Figure 4-25: 3D Volumetric Error Map of SLA 250 at Fixed Z Level (Z = 1 inch)....63 Figure 4-26: Compensation Applied only to Vertices of the Facets...........................65 Figure 4-27: Compensation Applied to the Contours of All Slices ............................ 66 Figure 4-28: A Facet of the STL Model ......................................................................67 Figure 4-29: Definition of Chord Height ..................................................................... 68 Figure 4-30: 49-cylinder Test Part...............................................................................70 Figure 4-31: Volumetric Errors of 49 Points before and after Compensation............ 71

xi Figure 4-32: Histogram of Volumetric Error Reduction Ratios .................................72 Figure 4-33: Half Spherical Test Part ..........................................................................74 Figure 4-34: Spherical Cap Defined by α....................................................................74 Figure 4-35: Test Part with Common Features............................................................77 Figure 4-36: Dimensions of Nominal, Uncompensated, Compensated, and Part with Adjusted z (inch) ..........................................................................................78 Figure 4-37: Z Quantization in Uncompensated Parts................................................80 Figure 4-38: Z Quantization and Multiple Layers Phenomenon in Compensated Parts ......................................................................................................................80 Figure 5-1: FDM Machine Axes Chain Vector Diagram ............................................85 Figure 5-2: Scale Error of X Axis of FDM Machine ...................................................88 Figure 5-3: Straightness Error of X Axis in Y Direction of FDM Machine................88 Figure 5-4: Straightness Error of X Axis in Z Direction of FDM Machine...............89 Figure 5-5: Straightness Error of Y Axis in X Direction of FDM Machine...............89 Figure 5-6: Scale Error of Y Axis of FDM Machine ..................................................90 Figure 5-7: Straightness Error of Y Axis in Z Direction of FDM Machine ...............90 Figure 5-8: Straightness Error of Z Axis in X Direction of FDM Machine...............91 Figure 5-9: Straightness Error of Z Axis in Y Direction of FDM Machine ...............91 Figure 5-10: Scale Error of Z Axis of FDM Machine ................................................92 Figure 5-11: Roll of Y Axis of FDM Machine............................................................92 Figure 5-12: Pitch of Y Axis of FDM Machine ..........................................................93 Figure 5-13: Pitch of Z Axis of FDM Machine ..........................................................93 Figure 5-14: Yaw of Z Axis of FDM Machine ...........................................................94 Figure 5-15: Roll of Z Axis of FDM Machine............................................................94 Figure 5-16: Histogram for FDM Machine ................................................................96

xii Figure 5-17: Histogram for SLA Machine..................................................................96 Figure 5-18: Histogram of XY Plane Error Reduction Ratios.....................................98 Figure 5-19: Histogram of Z Direction Error Reduction Ratios .................................99 Figure 5-20: Cylindrical and Planar Test Parts to Compare STL and SSL Compensations......................................................................................................103 Figure 5-21: X coordinates of the Line.......................................................................105 Figure 5-22: Y coordinates of the Line.......................................................................105 Figure 6-1: Original Design ........................................................................................127 Figure 6-2: Optimized Design ....................................................................................127 Figure 6-3: Simulated Annealing Result with the Original Design as Initial Solution.................................................................................................................135 Figure 6-4: Simulated Annealing Result with a Stair Design as Initial Solution ....... 136 Figure 6-5: Simulated Annealing Result with a Flat Surface as Initial Solution........136 Figure 7-1: Part for Feature Form Error Study ............................................................ 144 Figure 7-2: Form Errors of Circles with R=0.5 inch ..................................................145 Figure 7-3: Form Errors of Circles with R=1.0 inch ...................................................146 Figure 7-4: Form Errors of Circles with R=1.5 inch ..................................................147 Figure 7-5: Form Errors of Circles with R=2.0 inch ..................................................148 Figure 7-6: Form Errors of Circles with R=2.5 inch ..................................................149 Figure 7-7: Form Errors of Circles with R=3.0 inch ..................................................150 Figure 7-8: Form Errors of Circles with R=3.5 inch ..................................................151 Figure 7-9: Form Prediction using Machine Error Model ...........................................153

xiii LIST OF TABLES Table 3-1: 21 Parametric Errors of a 3 Axes System................................................... 22 Table 4-1: Hole Center Coordinates of The Original Plate (inch)..............................42 Table 4-2: Parametric Error Functions Coefficients of Uncompensated Machine......43 Table 4-3: Hole Center Coordinates of The Compensated Plate (inch) ..................... 47 Table 4-4: Parametric Error Functions Coefficients in Compensated Machine .......... 48 Table 4-5: Coefficients of Polynomial Error Functions .............................................54 Table 4-6: Spherical Surface Compensation Results.................................................. 75 Table 5-1: Coefficients of FDM Machine Polynomial Error Functions.....................87 Table 5-2: Form Error of Cylinder and Planes with STL and SSL Compensation ....103

xiv ACKNOWLEDGEMENTS First and most, I want to thank my thesis advisors, Dr. Sanjay Joshi and Dr. E. Amine Lehtihet, for their knowledge, guidance, and advice provided me during my study at Penn State. They not only taught me how to attack a research problem but also showed me the door to true scholarship. What I learned from them will benefit me a life-long time. Second, I want to whole heartedly thank Dr. Tom M. Cavalier and Dr. Enrique del Castillo for their great help to my dissertation work. I enjoyed very much their graduate courses and the discussions with them. I feel lucky to get to know them during my study at Penn State. I also want to thank Dr. Eric Marsh for serving on my advisory committee and for his valuable suggestions. Last, but not the least, I want to thank my family for always being there for me. Their support makes all this worthwhile.

Chapter 1 Introduction to Rapid Prototyping Rapid prototyping (RP) is a fabrication method in which parts are constructed layer by layer under computer control. It is also known as Layered Manufacturing (LM), Solid Freeform Fabrication (SSF), Material Additive Manufacturing, or 3Dimensional Printing. Rapid prototyping can build parts of complex geometry with very little process planning and human interaction, making it a very attractive manufacturing process. RP complements existing conventional manufacturing methods of material removal and forming.

1.1 Rapid Prototyping Process Figure 1-1 shows the transformation of a design from a CAD model to a prototype in a rapid prototyping process. Assume a simple 3-Dimensional conical part is designed in a CAD system. In traditional machining, the process starts with a larger material stock and the extra material is removed to get the desired shape. The procedure in RP is totally different. The CAD model is sliced into a number of 2-Dimensional slices. Each slice saves the contour of the cross-section. These slices are sent to the RP process to drive the tool tip to make individual layers. The entire part is built by stacking these 2-Dimensional slices one by one starting from the bottom. The design of RP processes ensures that a bond will form between adjacent layers and thus a solid part is built. The RP process

2 shown in Figure 1-1 is Stereolithography Apparatus (SLA), in which an Ultraviolet (UV) laser beam is used to solidify a photo-curable liquid resin to make the layers and the prototype. Due to finite layer thickness, a staircase effect will result in the final prototype. In Figure 1-1, the staircase effect is exaggerated. In the actual SLA process, the layer thickness is usually around 0.004 ~ 0.006 inch. The staircase effect is still observable but much more acceptable.

Figure 1-1: RP Process (Source: http://www.oki.com/en/otr/html/nf/otr-159-12-fig-2.html)

1.1.1 STL (StereoLithography) Model In the actual RP process, it is not the original CAD model that is sliced, but a StereoLithography (STL) model which is a triangular faceted representation of the 3Dimensional boundary surface geometry. Such a representation for a cylinder is shown in Figure 1-2. The boundary surface is tessellated into a series of small triangles, or facets. Each facet is described by its three vertices and a normal vector (Figure 1-3). The facets define the surface of a 3-dimensional object. The orientation of the facets is specified redundantly in two ways which are consistent. First, the direction of the normal vector is

3 outward. Second, the vertices are listed in a counterclockwise order when looking at the object from the outside. These rules are also illustrated in Figure 1-3.

Figure 1-2: STL Model of a Cylinder

Figure 1-3: Facet A reason for the popularity of the STL representation for RP is that it greatly simplifies the slicing algorithm. With the original CAD model, slicing a part can involve intersecting the slicing plane with a large variety of geometries; with an STL model, slicing any part can be done by intersecting the slicing plane with all the planar facets. The slicing algorithm is simplified and computation time is greatly reduced. The STL format has been accepted as the de facto industry standard. However, it is not an exact

4 representation and this approximation will introduce errors in the geometry of the part. For example, by slicing the STL model of a cylinder, the contour of each layer is not an exact circle, but a polygon formed by the intersection of the slice plane with the planar triangular facets. This is usually called “Tessellation Error”, and is typically user controllable as an input to the tessellation algorithm.

1.1.1.1 Vertex-to-vertex Rule Most CAD software can generate an STL model from a CAD model. The vertexto-vertex rule has to be obeyed in the STL file, which means that each triangle must share two vertices with each of its adjacent triangles. In other words, a vertex of one triangle cannot lie on the side of another. This is illustrated in Figure 1-4.

Invalid STL Model

Valid STL Model

Figure 1-4: Vertex-to-vertex Rule

1.2 Commercial RP Processes There are a number of commercially available RP processes. A non-exhaustive list includes Stereolithography Apparatus (SLA) and Selective Laser Sintering (SLS) by

5 3D Systems, Fused Deposition Modeling (FDM) by Stratasys, Laminated Object Manufacturing by Cubic Technologies, and Laser Engineered Net Shaping (LENS) by Optomec Design Company. The experimental study of this research was conducted on a SLA 250 machine and a FDM 3000 system, hence these two processes are briefly introduced in this section. Stereolithography Apparatus (SLA) creates a prototype by photo-curing a liquid resin (Figure 1-5). A vat is filled with photo-curable liquid polymer with an elevator platform carrying the unfinished part set below the surface of the resin. The computer controlled optical scanning system directs a laser beam across the top of the polymer, which selectively hardens the surface layer. The machine then lowers slightly to cover the top surface of the unfinished part with another layer of the liquid resin, continuing to harden layer by layer until the complete part is built. Layer thickness of the SLA 250 machine used in this study is set to 0.004 inch (0.1016 mm).

Figure 1-5: Stereolithography Apparatus

6 Fused Deposition Modeling (FDM) system builds a prototype by depositing melted plastic (Figure 1-6). A plastic filament is unwound from a spool and is supplied to an extrusion nozzle. The nozzle is heated to melt the plastic and has a mechanism which allows the flow of the melted plastic to be turned on and off. The nozzle is mounted to the head which can travel in the horizontal XY plane. As the nozzle is moved over the table in the required geometry, it deposits a thin bead of extruded plastic to form each layer. The plastic hardens immediately after being squeezed from the nozzle and bonds to the layer below. The entire system is contained within a chamber that is held at a temperature just below the melting point of the plastic.

Figure 1-6: Fused Deposition Modeling

7 1.3 Advantages and Limitations of RP Processes With the ability to process material at virtually any point in the space, RP is able to build parts of very complex geometry or even a whole assembly. Also, since the CAD model is sliced into 2D layers and the part is built by stacking layers, process planning is greatly simplified and often independent of part complexity. No special tool selection or special tool path generation are needed. RP significantly reduces the process planning time needed to materialize a new design. Due to these advantages provided by RP process, RP machines are now an important part of the vast array of tools and techniques used to assist in the design, manufacture and subsequent commercialization of a product (Wohlers (1995)). These additive processes are used in a wide range of fields such as concept modeling, new product marketing, rapid tooling, and biomedical applications. However, additive fabrication methods are not necessarily better than subtractive ones, nor will they become complete replacements for them. Milling, turning, and other subtractive methods have reached an extraordinary level of development and they continue to evolve. They are fast, inexpensive, readily available and well-understood by a large number of practitioners. Indeed, in many cases they are quite sufficient to make prototypes rapidly, and as yet have no equal when it's necessary to make very precise parts in the final material of choice. Additive technologies are complementary to subtractive ones. They should be used if the situation calls for complex or intricate geometric forms, simultaneous fabrication of multiple parts into a single assembly, or multiple materials or composite materials in the same part.

8 Given the above scope of application, there are still limitations in the current RP processes. Considering the available choice of materials and processes used in RP, mechanical properties of the prototypes are usually not as good as those of machined parts. In addition, inferior dimensional accuracy has been identified by the CIRP’s Scientific Technical Committee (Kruth (1998)) as one major obstacle preventing this technology from greater penetration of manufacturing activities. For example, the accuracy of a SLA 250/50 machine is usually quoted as 0.002 inch/inch (Lynn (2000)). An FDM machine has a tolerance of ±0.005 inch in each of the three axes. This is much worse than the accuracy of conventional machine tools.

1.4 Motivation of this research With the development of rapid prototyping techniques, the application of RP is not limited to form verification of designs. People expect to make final functional parts directly from RP. Dimensional accuracy thus becomes an important consideration. This research was motivated by this need to address the dimensional accuracy by providing a software based error compensation approach to improve the dimensional accuracy of the process. Multiple sources of error in RP processes contribute to their poor dimensional accuracy such as the positioning error of the RP tool tip, material shrinkage or expansion during prototyping due to complex physical or chemical reactions, staircase effect of layered manufacturing, and surface approximation error by triangulation. To achieve better accuracy, manufacturers try to develop mechanical drive systems of higher

9 precision and materials with less volume change during prototyping. This is a long-term process which involves research in different disciplines and a large amount of hardware modification. In terms of software, researchers have tried to optimize the algorithms used to generate the machine control commands from the part model, such as STL file correction algorithms, slicing algorithms, tool path planning, and support structure generation methods. In addition, at the user end, studies have been done to achieve better part accuracy by parametric tuning and build orientation optimization. Chapter 2 reviews studies on these issues. All these studies strived to remove the error sources in the RP process and to improve the RP accuracy by “error avoidance”. In general, there are two approaches that can be used to improve the accuracy of a process such as RP: “Error Avoidance”, which seeks to eliminate the source of an error, and “Error Compensation”, which strives to cancel the effect of an error without removing the error source (Hocken, (1995)). This research seeks a generic way to improve the accuracy of a RP machine by means of “Error Compensation”. It was inspired by the technique developed for the parametric evaluation of coordinate measuring machine (CMM) errors.

1.5 Basic Idea of Software Error Compensation Approach When a RP machine is asked to build a point at (x, y, z) in its working volume, it actually makes a point at (x+dx, y+dy, z+dz) due to errors (Figure 1-7). The distance between the actual point and the nominal point is called the volumetric error. If the deviation (dx, dy, dz) can be written as a function of (x, y, z) within the machine working

10 volume, then the error at any location can be predicted and thus the commands sent to the machine (x, y, z) can be tweaked by (-dx, -dy, -dz) in advance to compensate for this error. The deviation (dx, dy, dz) is usually the result of both systematic errors and nonrepeatable errors. It is assumed in this research that the systematic errors dominate in the RP machines to be evaluated. Implementing this error compensation approach will involve measuring the errors of a RP machine, building the machine error model from the measurement results, and using the error model to compensate for errors via software.

Volumetric Error

Nominal Position (x, y, z) dx dz

dy

Actual Position (x+dx, y+dy, z+dz) Compensated Input (x-dx, y-dy, z-dz)

z

y x

RP working envelope

Figure 1-7: RP Software Error Compensation

1.6 Problem Statement The objective of this research is to develop a generic software error compensation method for RP machines, which can be applied to different types of RP machines and parts of different geometry. Methods for error modeling, error measuring, and error compensation of RP machines were explored. Experimental studied were conducted on

11 the SLA 250 machine and the FDM 3000 system to demonstrate and verify the effectiveness of this approach.

1.7 Organization of the Dissertation The rest of the dissertation is organized as follows: Chapter 2 reviews the literature on rapid prototyping accuracy, Chapter 3 introduces the software error compensation approach while Chapter 4 and 5 present the implementation results on a SLA 250 machine and a FDM 3000 system respectively. Chapter 6 then discusses optimization of artifact design using Design of Experiments (DOE) techniques. Finally, Chapter 7 concludes this study and proposes possible future research directions.

Chapter 2 Review of Research Related to RP Accuracy Due to the inferior dimensional accuracy of RP parts, many researchers have conducted studies on RP accuracy issue. These studies can be roughly classified into research on accuracy evaluation and research on accuracy improvement.

2.1 Accuracy Evaluation The dimensional accuracy of a RP machine is usually given in the manufacturer’s machine specifications as a ratio of an error per unit length. For example, the accuracy of a SLA 250/50 machine is usually quoted as 0.002 inch/inch (Lynn (2000)). Such a number cannot fully characterize the accuracy of a RP machine. Users are still unable to determine if the part made by a specific RP machine can meet dimensional accuracy, geometrical accuracy and surface finish requirements. Benchmarking methods have been developed to evaluate accuracy of a specific RP machine. Under this method, a benchmarking part is designed and made by the RP machine. This part usually includes a number of different features which are designed to evaluate dimensional accuracy, geometrical accuracy and surface roughness respectively. These features are measured by a coordinate measuring machine (CMM) and their actual dimensions are compared against the nominal values to determine errors of the RP machine.

13 Many such benchmarking parts have been designed over the years. The North American Stereolithgraphy User Group (NASUG) developed the famous “User-Part” in 1990 which was adopted by 3D System as their standard to establish accuracy levels for SLA machines. This is a plate-like part of 9.5 inch × 9.5 inch × 1.5 inch with numerous out-of-plane features, as shown in Figure 2-1. The part almost fills the entire XY work plane of a SLA 250 machine and can be used to measure the in-plane accuracy. A number of researchers have used this “User-Part” in their studies. Gargiulo (1991) reported a study in which the User-Part was built on ten different SLA 250 machines, and the process accuracy capability and sources of dimensional errors were quantified. Iuliano (1995) used this “User-Part” to compare four RP processes and proposed modification to it by adding non-flat surfaces.

Figure 2-1: The “User-Part” Another popular part, which is shown in Figure 2-2, is credited to P.E. Reeves and R. C. Cobb (1997). It consists of six angled surface planes from zero to ninety degrees and was designed to study the factors affecting surface roughness. The part was used by

14 Shellabear (1999) to compare several RP processes. Factors other than those associated with the individual process or material variations, such as human operators, company procedures, etc, were also included.

Figure 2-2: Reeves and Cobb Test Part Juster and Childs (1995) created a complicated part which included square bosses with horizontal or vertical holes, thin walls, cylinders, pass/fail features and even irregular shapes (Figure 2-3). This part was used to evaluate dimensional accuracy, several types of geometrical accuracy, overhangs, free form surfaces and other characteristics of a RP machine. The previous examples are only three representative test parts; more benchmarking parts have been reported by other researchers (Liu (1998) and Soltysik (2000)). Under the benchmarking approach, different user-organizations use different benchmarking parts, and the evaluation result is typically user-dependent. The result from one study cannot be directly used for comparison with the result from another study using a different benchmarking part. A more universal way to represent the RP process accuracy is needed.

15

Figure 2-3: Juster and Child Test Part

2.2 Accuracy Improvement Aside from benchmarking parts for accuracy evaluation, many other researchers have focused on optimization of RP process variables for accuracy improvement. Most studies on RP accuracy improvement to date fall within the category of error avoidance and have focused on different aspects of the RP process. Among these, RP process parameters tuning (Gargiulo (1991), Lynn (1999), Onuh (2001), and Zhou (2000)) and build orientation optimization (Arni (1999), Cheng (1995), Lynn (2000), and Nee (2001)) have drawn the most attention. For a given RP process, there are usually many process variables that may affect part accuracy and can be set by the users. The setting of these parameters can potentially be optimized to achieve the best part accuracy. Response surface methodology (RSM) is typically used to find the relationship between part accuracy and these process parameters

16 (Lynn (1999)). Once a response surface is obtained, parametric tuning can be conducted to achieve better part accuracy. Optimization of build orientation is a typical example of application and extension of parameter tuning. It is usually formulated as a multi-criteria optimization problem, managing the trade off between surface finish, part accuracy and part build time. Decision variables are the process parameter settings and part building orientation. Response surfaces fitted in parameter tuning problem are usually used in optimization. Besides process parameters tuning and build orientation optimization, other aspects of process planning for RP techniques, such as data file correction, slicing technique improvement, support structure generation and path planning, have also been proposed and studied for process improvement (Kulkarni (1996), Kumar (1997), Lin (2001), Liu (1998), and Wah (2001)). Good process planning can improve machine accuracy to some extent, but with the current RP technology, even the best tuned system will still produce parts with considerable systematic errors. Error compensation can be used to further reduce errors. However, very little work has been done on error compensation for RP machines. Philpott (1995) presented an iterative error compensation strategy for one RP process, which compensated for cumulative error build-up during replication without knowledge of the error creating mechanism. However, since no machine error models were built in this strategy, the iterative process needed to be repeated for every new part. Nee (2001) constructed a correction table with n×n lattice points to improve the Stereolithography process accuracy. This correction table was calculated according to the configuration of the Galvano-mirror system and was used mainly to compensate for the error in

17 positioning the laser beam on the platform. This table was uploaded to the scanner buffer and positioning values were compensated by values in the table. The research proposed in this thesis was motivated by the need for a more generic approach to evaluate and improve the dimensional accuracy of RP machines and was inspired by the technique developed over the years for the parametric evaluation of CMM errors. This research tries to look at the accuracy problem of RP machines from a different standpoint which is to improve the accuracy of RP parts by means of software error compensation. Chapter 3 will introduce the basic procedures of software error compensation approach in detail.

Chapter 3 Software Error Compensation Approach Error compensation usually consists of modeling errors in the process and then modifying the commands to the process in accordance with the model’s predictions. Given the knowledge of the main error sources of the process, software error compensation is usually a three-step approach (Hocken (1995)): 1. Build a mathematical machine error model with unknown coefficients, or write the components of the volumetric error (dx, dy, dz) as functions of the coordinates x, y and z. 2. Develop a method of measurement to determine the coefficients in the model. 3. Implement the error model in the machine control for compensation. The concept of software error compensation has been applied to CMMs and machine tool systems. The original work of parametric error measurement and determination was presented by Hocken (1977) at NIST and further work in this area was undertaken by numerous researchers with applications to both CMMs and metal cutting machine tools (Belforte (1987), Ferreira (1986), Kruth(1994), Kunzman(1990), Mou(1995), Ni(1997), Sartori(1995), Trapet(1991), Zhang(1988, 1995, 2000)). Rapid prototyping machines are relatively new manufacturing machines. They often use different mechanisms from CMMs and traditional machine tool systems. Although the concept of software error compensation has been applied to CMMs and

19 machine tools, the procedures cannot be directly used for RP machines. Special characteristics of RP machines have to be addressed in order to develop a generic software error compensation approach appropriate for RP processes. This chapter summarizes the three-step procedure for software error compensation and discusses the special issues that need to be considered for RP machines.

3.1 Machine Error Model First, a mathematical machine error model needs to be built. There are generally two different ways to build a system’s error model: mechanistic model or statistical model. If the exact mechanism of a system is known, a mechanistic model can be built; otherwise, a statistical empirical model can be built using response surface methodology. As stated previously, rapid prototyping is a very complex system. There are multiple error sources including not only mechanical system inaccuracy but also material volume change during prototyping. It is very difficult, if not impossible, to built an exact mechanistic model. On the other hand, theoretically, a pure response surface model can be built between the responses (dx, dy, dz) and the independent variables (x, y, z). For example, a high order polynomial function can be created relating these variables. However, such a model will introduce a lot of high order terms which might not be significant and have no physical meaning at all. Inspired by the parametric error modeling method used for CMMs and machine tool systems, the approach pursued is to build an approximate model using a “virtual”

20 parametric error model. This method imagines three virtual axes, X, Y, and Z, for the RP machine and maps the overall RP machine errors into a set of parametric errors of the three “virtual” axes. This method is easy to apply and provides physical meanings to each parametric error term. To explain this approach, it is necessary to review how the parametric error model was built for CMMs or machine tool systems.

3.1.1 Parametric Error Modeling for CMMs Figure 3-1 shows a typical bridge-type CMM. Its axes and carriages are illustrated in Figure 3-2. This machine has three linear carriages designed to move independently in order to position a measuring probe, attached to one of the carriages, anywhere in the working volume of the machine. Each of the linear carriages has six degrees of freedom, and under ideal condition, five of the six degrees of freedom are suppressed by design in order to drive the carriage in the remaining linear degree of freedom. In reality, hardware construction, however careful, does not manage to completely suppress the undesirable degrees of freedom of a carriage. The unsuppressed residual errors in the motion of a carriage are referred to as “parametric errors”. Each translation axis is thus considered to have six such errors, five of which are associated with the unwanted five degrees of freedom, while the sixth is associated with the unconstrained degree of freedom. The error of motion associated with the unconstrained degree of freedom is typically referred to as “scale” errors since this motion is dependant on some sort of imperfect scale. Errors of motion related to the unwanted degrees of freedom include two straightness errors and three angular errors. Straightness errors refer to linear errors of motion in the two axes

21 perpendicular to the direction of motion while angular errors refer to the roll, pitch, and yaw errors associated with the axis of motion. Since the typical CMM has three axes of motion, this gives rise to 18 errors of motion.

And since the 3 axes are not perfectly

mutually perpendicular, 3 perpendicularity or squareness errors between the axes are added for a total of 21 parametric errors of a three axes machine. These errors are summarized in Table 3-1.

Figure 3-1: A Bridge-type CMM

22

Y Z X

Nominal

Actual

Figure 3-2: Axes and Carriages of a Bridge-type CMM

Table 3-1: 21 Parametric Errors of a 3 Axes System Axis Scale Error Straightness Error Roll Rotational Pitch Error Yaw

X

δx(x) δy(x), δz(x) εx(x) εy(x) εz(x)

Y

δy(y) δx(y), δz(y) εy(y) εz(y) εx(y)

Z

δz(z) δx(z), δy(z) εz(z) εx(z) εy(z)

In Table 3-1, δj(i) is the undesired translational error of axis i in the j direction.

εj(i) is the rotational error of axis i arising from the undesired rotational movement of the carriage around axis j. Both δj(i) and εj(i) are functions of the position of the carriage along axis i. When squareness errors are defined, priority order of each axis needs to be determined in advance since out-of-square is a relative error between two axes. For the bridge-type CMM in Figure 3-1, the priority sequence of the three axes is assumed as X→Y→Z. That is, axis X is chosen as the reference line for squareness compensation,

23 axis Y is assumed to be out-of-square with X, and axis Z is assumed to be out-of-square with Y and X. Since squareness errors are independent of the axes locations, they are represented by constants αxy, αzx, and αzy. For a CMM or a machine tool system, the final positioning accuracy of the machine probe or tool tip is dominated by the motion errors of its three axes. Assuming rigid body kinematics, the machine volumetric errors can be written as a function of the 21 parametric errors. Mathematical models of machines based on rigid body assumptions vary according to machine types. In general, 3-axes machines can be classified according to the motion of the probe and work piece as XYFZ, XYZF, XFYZ or FYXZ. In this representation, F designates the fixed machine foundation while letters appearing to the right of F indicate probe motion and letters appearing to the left of F indicate work piece motion (Elshennawy (1987)). For the illustrated CMM, the probe can move in X, Y, and Z directions, while the work piece is fixed on the table. Thus a bridge-type CMM is a FXYZ type machine. The kinematic axes chain vector diagram in Figure 3-3 can be used to assist in building the error model.

T

Z

W

O

Y

X

Figure 3-3: The Axes Chain Vector Diagram of a Bridge-type CMM

24 Under the conventional definitions used (Fadel (1996), Jurrens (1999), Lee (1995), Zhang (1988), and Zhang (2000)), O is the fixed origin. X, Y and Z are the three axes vectors, including only the translational and squareness errors. The rotational errors will be considered separately later when writing the kinematical paths. Since the X axis is the reference line when defining squareness, no squareness error will affect its accuracy. The only errors taken into account for the X vector are the translational errors, as shown in Equation 3.1. For the Y and Z axes, translational errors work in the same way, while squareness error also come into play. Squareness errors of the Y and Z axes with respect to the X axis will affect the X position of each vector and squareness error of the Z axis with respect to the Y axis affects its Y location. T is the probe offsets xt, yt and zt with respect to the carriage to which the probe is attached. W is the vector directed from the part origin to the probe in the part frame, which represents the actual size of the part. The components of each vector are listed in Equation 3.1. ⎡ x + δ x ( x )⎤ ⎡δ x ( y ) − α xy ⋅ y ⎤ ⎡δ x (z ) − α zx ⋅ z ⎤ ⎡ xt ⎤ ⎡X P ⎤ ⎢ ⎢ ⎢ ⎢ ⎥ ⎥ ⎥ ⎥ Y = y + δ y (y) Z = δ y (z ) − α zy ⋅ z T = yt W = ⎢ YP ⎥ X = δ y (x ) ⎢ ⎢ ⎢ ⎢ ⎥ ⎢ ⎥ ⎥ ⎥ ⎥ δ z (y) ⎢⎣ δ z ( x ) ⎥⎦ ⎢⎣ ⎢⎣ z + δ z (z ) ⎥⎦ ⎢⎣ zt ⎥⎦ ⎢⎣ Z P ⎥⎦ ⎥⎦

3.1

There are two kinematic paths from origin O to the probe tip: W and X→Y→ Z→T. In each kinematic path, the rotational error of the predecessors to an axis will affect the actual movement of that axis, thus the axis movement needs to be modified by the rotational error of its predecessors. Rotation of the X, Y and Z axes can be represented by infinitesimal rotation matrices R(X), R(Y), and R(Z). Letting u represent X, Y or Z, the rotation matrix and its inverse are respectively:

25

⎡ 1 ε z (u ) − ε y (u )⎤ ⎢ ⎥ R (u ) = ⎢ − ε z (u ) 1 ε x (u ) ⎥ ⎢⎣ ε y (u ) − ε x (u ) 1 ⎥⎦

⎡ 1 − ε z (u ) ε y (u ) ⎤ ⎢ ⎥ − ε x (u )⎥ R −1 (u ) = ⎢ ε z (u ) 1 ⎢⎣− ε y (u ) ε x (u ) 1 ⎥⎦

3.2

In Figure 3-3, X and W have no predecessor. Y has a predecessor axis X, Z has two predecessor axes: X and Y, and T has three predecessor axes: X, Y and Z. Thus the two equivalent vector chains from origin O to the measuring probe can be expressed by the following equation:

r r r r r W = X + R −1 ( X )Y + R −1 ( X ) R −1 (Y ) Z + R −1 ( X ) R −1 (Y ) R −1 ( Z )T

3.3

Substituting X, Y, Z, T, W and rotational matrices into the vector machine model, the expressions for the coordinates of the measuring probe in the work piece coordinates system Xp, Yp and Zp are obtained:

X

p

= x + [δ x ( x ) + δ x ( y ) + δ x ( z )] − y[α xy + ε z ( x )] − z[α zx − ε y ( x ) − ε y ( y )] + xt − yt [ε z ( x) + ε z ( y ) + ε z ( z )] + z t [ε y ( x) + ε y ( y ) + ε y ( z )] + τ x

3.4

Y p = y + [δ y ( x) + δ y ( y ) + δ y ( z )] − z[α zy + ε x ( x) + ε x ( y )]

+ xt [ε z ( x) + ε z ( y ) + ε z ( z )] + yt − z t [ε x ( x) + ε x ( y ) + ε x ( z )] + τ y Z p = z + [δ z ( x) + δ z ( y ) + δ z ( z )] − x[ε y ( x) + ε y ( y )] + yε x ( x) − xt [ε y ( x) + ε y ( y ) + ε y ( z )] + yt [ε x ( x) + ε x ( y ) + ε x ( z )] + zt + τ z This is the machine error model built by using parametric errors and rigid body kinematics. The two assumptions made in this method are: (1) parametric errors of the axes are the dominant error sources in the machine and (2) the rigid body kinematics assumption is valid.

26 3.1.2 “Virtual” Parametric Modeling for RP

In RP processes, the factors affecting the part accuracy are much more complicated. The machine axes motion errors are still an important error source, but not the only one. Material volume change during prototyping is another major error source. In addition, some types of RP machines, say a SLA machine, are no longer composed of 3 translational axes. The rotating mirrors are the driving forces for the laser beam focus. Obviously, it is inappropriate to directly use the parametric error modeling method to derive the exact RP machine error model. However, the geometric errors of the axes or the directing mirrors in the RP systems are not directly relevant, what is relevant is the errors in the resultant motion of the RP “tool tip” and the relationship between (x, y, z) and (dx, dy, dz). The idea here is to assume 3 virtual axes in the RP machine working volume, one associated with the upand-down motion of the table and the other two associated with the horizontal motion of the “tool tip”. These three virtual axes have 21 “virtual” parametric errors and the proposed approach maps all errors in the RP process into the 21 “virtual” parametric errors without considering the actual sources of these errors. This approach will serve a dual purpose: first, it will provide a model with sufficient resolution for compensation; second, it will partition the error budget along meaningful spatial directions and serve as a diagnostic tool for the identification of direction dependent error sources due to other process characteristics. The rigid body kinematics will still be used to derive the machine error model of the RP machine. Of course the model built under this assumption does not reflect the real kinematics of the machine and thus is only a “virtual” error model.

27 However, the artifact method for error measurement discussed in the following section enables this study to use such a model for compensation purpose.

3.2 Machine Error Measurement

The machine error model defines the mechanism of error synthesis, but the actual errors of a specific machine still need to be measured to fully represent the accuracy of a machine. For CMMs or machine tool systems, the predominant way of determining machine parametric errors uses a laser interferometer and electronic levels to measure these errors directly on the machine. Of particular interest to this research, however, is the second approach which uses calibrated artifacts or artifact standards to infer the parametric errors. Under the artifact standard method, a typical CMM is used to perform a series of carefully chosen measurements on a reference artifact whose nominal dimensions are known. Then, the difference between the actual measurement and the nominal dimensions are used to infer the parametric errors of the axes. Polynomial fits such as Legendre polynomials are usually used to approximate each parametric error function. A widely used artifact is a ball-plate as shown in Figure 3-4. This 2D ball plate is measured at different locations and different orientations on the CMM to infer the parametric errors. In a RP machine, the parametric errors defined are “virtual” errors and thus they cannot be measured directly as for CMM or machine tool systems. The artifact method is applied. For a RP machine, the nominal dimensions or the reference artifact is the design

28 itself, and the dimensions of the part materialized by the RP machine represent the actual performance. Under the artifact method, the RP machine is used to manufacture a specially designed artifact and the CMM is used as a master scale to measure artifact characteristics. The accuracy and repeatability of a CMM is assumed to be much higher than that of a RP machine, which is valid in the real case. The measurement results are then used to infer the “virtual” parametric errors of the RP machine. The existing artifacts are mostly designed for CMM calibration and are not suitable for a RP machine case. The design of the artifact needs to be researched.

Figure 3-4: Ball-plate used for CMM error measurement

3.3 Error Compensation

Given the CMM machine error model, the errors in future measurements can be predicted and thus used to compensate the results. For a RP machine, compensation means modification of the commands sent to the machine to cancel the actual error for a more accurate performance. In a RP process, when going from a CAD design to a final

29 prototype, the same part is represented in several file formats: the original CAD model, such as Pro/Engineer model; the STL (stereolithography) file after triangulation; the slice file generated by the slicing software used by the RP machine and the machine control code. Software error compensation means to modify these files according to the error model for accuracy improvement. Where and how to apply the compensation needs to be researched. It needs to be emphasized here that the machine error model built based on “virtual” parametric errors and rigid body kinematics does not reflect the actual kinematics of the RP machine, but reflects the resulting motion of the tool tip. As mentioned previously, the RP machine parametric errors will be determined by producing and measuring an artifact part, rather than measuring the actual error of the motions of the individual axis of the machine. This allows for the selection of a “virtual” parametric error model of the machine which does not represent the actual machine kinematics. This is different from the traditional approach where the six error motions of each axis are directly measured to populate the individual homogeneous transformation matrices in the kinematic chain. When using a “virtual” parametric error model, it has to be determined if the model can successfully produce compensation data to improve machine accuracy. Compensation results discussed in Chapter 4 and 5 will demonstrate the ability of this model to provide useful compensation data. Using the proposed software error compensation approach, “vitual” parametric errors of the rapid prototyping machine can be determined. Although called parametric errors, they include all repeatable error sources present in the rapid prototyping process, such as laser beam deviations, material shrinkage/expansion, work-piece table movement

30 error, etc. They can be thought of as a comprehensive evaluation criterion of RP machine accuracy. By plotting error functions in the range of the workspace, the 3-dimensional accuracy information of the machine can be easily analyzed.

This method can be

duplicated for different machine types. Since the resultant parametric error functions are a global representation of the machine volumetric accuracy, they can be used directly for comparison between systems. In addition, the error functions can be used for error prediction and error compensation of any future part built on the same machine. Software error compensation makes it possible to get better part dimensional accuracy without any hardware modification.

Chapter 4 Implementation of Error Compensation on a SLA 250 Machine

The proposed software error compensation approach was implemented on a SLA 250 machine available in the Department of Industrial and Manufacturing Engineering at The Pennsylvania State University. The “virtual” parametric error model was derived for this machine. Error identification and compensation were implemented first in two dimensions and then extended to three dimensions.

4.1 SLA Machine Error Model

Stereolithography Apparatus (SLA) was introduced in Chapter 1. It creates a prototype by photo-curing a liquid resin (Figure 1-5). The focus point of the laser beam corresponds to the tool tip in machine tools. It is directed by mirrors and can move in two orthogonal horizontal directions, which are defined as X and Y respectively. The work platform carrying the work piece can move up and down along the Z axis, with the vertical up as the positive Z direction. According to these features, SLA 250 corresponds to a ZFXY type machine. It needs to be emphasized again that this classification of the RP machine type does not reflect the actual kinematics of the RP machine, but reflects the resulting motion of the laser beam focus. The kinematic axes chain vector diagram in Figure 4-1 is used to build the error model for SLA 250.

32

W

T

Z

O

Y

X

Figure 4-1: The SLA250 Machine Axes Chain Vector Diagram O is the fixed origin. X, Y and Z are the three axes vectors, including only the translational and squareness errors. The rotational errors will be considered separately later when writing the kinematical paths. T is the tool tip offsets xt, yt and zt with respect to the carriage to which the tool is attached. In the SLA 250 machine, there are no actual X and Y carriages and the laser beam focus itself is considered the tool tip. Since the beam is always focused on the liquid surface, thus T = 0. For generality, T will be included in the error model derivations but dropped afterwards. W is the vector directed from the part origin to the laser focus in the part frame, which represents the actual size of the part. The components of the kinematical vector chain diagram are given below. ⎡ x + δ x ( x )⎤ X = ⎢⎢ δ y ( x ) ⎥⎥ ⎢⎣ δ z (x ) ⎥⎦

⎡δ x ( y ) − α xy ⋅ y ⎤ ⎡δ x (z ) − α zx ⋅ z ⎤ ⎢ ⎥ Y = ⎢ y + δ y (y) ⎥ Z = ⎢δ y (z ) − α zy ⋅ z ⎥ ⎢ ⎥ ⎢⎣ ⎥⎦ δ z (y) ⎣⎢ z + δ z (z ) ⎦⎥ ⎡ xt ⎤ ⎡X P ⎤ ⎢ ⎥ T = yt W = ⎢ YP ⎥ ⎢ ⎥ ⎢ ⎥ ⎣⎢ zt ⎦⎥ ⎣⎢ Z P ⎦⎥

4.1

33 The two kinematic paths from origin O to laser beam focus are Z→W and X→Y→T.

With consideration of rotational errors of the axes, Equation 4.2 can be

formulated: r r r r r Z + R −1 ( Z )W = X + R −1 ( X )Y + R −1 ( X ) R −1 (Y )T

4.2

r After rearranging the terms, vector W is explicitly written as a function of all

other vectors and matrices: r r r r r W = R( Z ) X + R( Z ) R −1 ( X )Y − R( Z ) Z + R( Z ) R −1 ( X ) R −1 (Y )T

4.3

Substituting X, Y, Z, T, W and rotational matrixes into the vector machine model, the expressions for the coordinates of the laser focus point in the work piece coordinates system Xp, Yp and Zp are obtained: X p = x + [δ x ( x ) + δ x ( y ) − δ x ( z )] − y[α xy + ε z ( x ) − ε z ( z )] + z[α zx + ε y ( z )]

[

4.4

]

+ xt − y t [ε z ( x) + ε z ( y ) − ε z (z )] + z t ε y ( x ) + ε y ( y ) − ε y ( z ) + τ x Y p = y + [δ y ( x ) + δ y ( y ) − δ y ( z )] − xε z ( z ) + z[α zy − ε x ( z )] + xt [ε z ( x ) + ε z ( y ) − ε z ( z )] + yt − zt [ε x ( x ) + ε x ( y ) − ε x ( z )] + τ y Z p = − z + [δ z ( x ) + δ z ( y ) − δ z ( z )] + xε y ( z ) + y[ε x ( x ) − ε x ( z )] − xt [ε y ( x ) + ε y ( y ) − ε y ( z )] + yt [ε x ( x ) + ε x ( y ) − ε x ( z )] + zt + τ z

τx, τy, and τz are non-repeatable error terms which represent errors due to nonrepeatable components. Since there is no tool tip offset in the SLA 250, i.e., xt = yt = zt =0, the mathematical model of the SLA 250 machine reduces to:

34 X p = x + [δ x ( x ) + δ x ( y ) − δ x ( z )] − y[α xy + ε z ( x ) − ε z ( z )] + z[α zx + ε y ( z )] + τ x

4.5

Y p = y + [δ y ( x ) + δ y ( y ) − δ y ( z )] − xε z ( z ) + z[α zy − ε x ( z )] + τ y Z p = − z + [δ z ( x ) + δ z ( y ) − δ z ( z )] + xε y ( z ) + y[ε x ( x ) − ε x ( z )] + τ z

ε y ( x ) , ε x ( y ) , ε y ( y ) , and ε z ( y ) do not appear in the model. This is a characteristic of a ZFXY type machine with T =0. Since the parametric error functions in this model are “virtual” errors, some errors may not have a perceptible physical meaning. For example, the laser beam always cures the resin on the vat surface and straightness errors δ z ( x ) and δ z ( y ) do not represent the deviation of laser focus from the resin surface.

4.2 Legendre Polynomial Approximation

Legendre polynomials are used to simulate each parametric error function. Each translational and rotational error is approximated by a linear combination of Legendre polynomials.

n

For example, δ x ( x) = ∑ ai P i ( x) , where ai (i = 0, …, n) are the i =0

approximation coefficients, and Pi(x) is the Legendre polynomial of the ith order

1 1 ( P 0 ( x) = 1 , P 1 ( x) = x , P 2 ( x) = (3x 2 − 1) , P 3 ( x) = (5 x 3 − 3x) …). The order of the 2 2 polynomials to be used for approximation of errors needs to be determined first. The higher the order of the linear combination of polynomials, the smaller the sum of squares of residual errors. However, high order error functions may also approximate the nonrepeatable error in the test part manufacturing process, causing errors in the subsequent

35 compensation procedure. In the CMM system, Kruth (1994) pointed out that geometrical errors are normally slowly varying in the system workspace, thus third order polynomial is a good choice for the approximation. A higher order will decrease the residual error but increase the influence of the non-repeatable error. A 3rd order polynomial was chosen in this study. For instance, 3

δ x ( x) = ∑ ai P i ( x) = a 0 P 0 ( x) + a1 P 1 ( x) + a 2 P 2 ( x) + a3 P 3 ( x) i =0

4.6

1 1 = a0 + a1 ⋅ x + a 2 (3x 2 − 1) + a3 (5 x 3 − 3x ) 2 2

There are four unknown coefficients in this error function, which can be reduced to three by fixing the absolute zero point. By convention, all errors vanish at the starting point of the axis, i.e., δ i (0) = 0 and ε i (0) = 0 . By letting δ x (x = 0) = 0 , the relationship between a0 and a 2 is easily found as a0 =

a2 . Substituting for a0 , the polynomial error 2

function δ x ( x ) can be rewritten as:

3 2

⎛1 ⎝2

⎞ ⎠

δ x ( x) = a1 P 1 ( x) + a 2 P 2 ( x) + a3 P 3 ( x) = a1 ⋅ x + a 2 ⋅ ( x 2 ) + a3 ⋅ ⎜ (5 x 3 − 3x) ⎟

4.7

For better readability, coefficients ai will be replaced by xtxi. Generally, itj’s will be used to represent coefficients of δj(i); irj’s represent coefficients of εj(i); and iwj is the squareness error between axis i and axis j.

Under this definition, all polynomial

functions can be written as a polynomial function with three terms, except straightness error functions δ x ( y ) , δ x (z ) , and δ y (z ) . For example:

36 3 ⎞ ⎛1 2 ⎠ ⎝2 3 ⎞ ⎛1 δ y ( y ) = c1 P1 ( y ) + c2 P 2 ( y ) + c3 P 3 ( y ) = yty1 ⋅ y + yty 2 ⋅ ( y 2 ) + yty 3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟ 2 ⎠ 4.8 ⎝2 3 ⎛1 ⎞ ε z ( x ) = e1 P1 ( x ) + e2 P 2 ( x ) + e3 P 3 ( x ) = xrz1 ⋅ x + xrz 2 ⋅ ( x 2 ) + xrz 3 ⋅ ⎜ (5 x 3 − 3x ) ⎟ 2 ⎝2 ⎠

δ x ( x ) = a1 P 1 ( x ) + a 2 P 2 ( x ) + a 3 P 3 ( x ) = xtx1 ⋅ x + xtx 2 ⋅ ( x 2 ) + xtx3 ⋅ ⎜ (5 x 3 − 3x ) ⎟

There exists a special relationship between squareness errors and the three straightness errors δ x ( y ) , δ x (z ) , and δ y (z ) (Kruth (1994)). Briefly, the linear terms of straightness errors δ x ( y ) , δ x (z ) , and δ y (z ) are the squareness errors α xy , α xz , and α yz , respectively. The example illustrated in Figure 4-2 will clarify this (Kruth (1994)).

Yo

yo

αxy

Yn

yn

P (xo, yo )

xn xo

Xo = Xn

Figure 4-2: Relationship between Squareness and Linear Term of Straightness Error

Suppose a point P is measured on a two-dimensional measuring machine without any error but a squareness error α xy between the Xo and Yo axis. The measured coordinates (xo, yo) of point P in this non-orthogonal coordinate system Xo and Yo can be transformed into an orthogonal coordinate system Xn and Yn as follows:

37 xn = xo − (sin α xy ) ⋅ y o ≈ xo − α xy ⋅ y o

y n = yo

4.9

with the first-order approximation sin α xy ≈ α xy which is valid because α xy is usually very small. α xy ⋅ yo is a function of yo and can be seen as the first order term of the straightness error δ x ( y ) . In fact, the linear term of straightness error δ x ( y ) and the squareness error α xy represent the same error in the system, which is the undesirable motion in the x direction of the y axis whose magnitude is proportional to the y coordinate. It is impossible to distinguish between these two and it is incorrect to model the same error twice. Which one to keep in the model depends on the assumption made about the orthogonality of the system. In the previous sections of this thesis, the machine was viewed as a non-orthogonal system, thus squareness errors were included in the model. Under this assumption, the linear term of the above three straightness errors are zero, i.e., ytx1 = 0 , ztx1 = 0 , and zty1 = 0 . Or alternatively, the machine can be assumed as an orthogonal coordinate system, i.e., all three axes are orthogonal to each other; no squareness errors exist, but the linear term of the straightness errors are included. The final error model will have the same number of terms, although one error is called by different names. For the rest of this research, an orthogonal system is assumed and squareness errors will not be modeled separately. Under this assumption, all straightness errors include a linear term in their polynomial functions and the SLA machine error model is simplified as follows:

38 X p = x + [δ x ( x ) + δ x ( y ) − δ x ( z )] − y[ε z ( x ) − ε z ( z )] + z ⋅ ε y ( z ) + τ x Y p = y + [δ y ( x ) + δ y ( y ) − δ y ( z )] − xε z ( z ) − z ⋅ ε x ( z ) + τ y

4.10

Z p = − z + [δ z ( x ) + δ z ( y ) − δ z (z )] + xε y ( z ) + y[ε x ( x ) − ε x ( z )] + τ z

4.3 Artifact Method for Estimation of Error Function Coefficients

Since the “virtual” parametric errors cannot be measured directly for RP machines as for CMM or machine tool systems, they need to be derived indirectly using the artifact method. The identification of each error function requires determination of three coefficients ai . For a general 3-axes orthogonal system, the total number of unknown coefficients of the 18 parametric errors is 54. At least 54 equations are required to solve for all the unknowns.

However, due to the existence of random errors, an over-

determined equation system is preferred.

The coefficients will be calculated by

minimizing the sum of squares of residual errors. The artifact used is a part with known nominal positions (x, y, z) of the key features. In CMM error evaluation, a high precision artifact, such as ball-bar or hole plate, is measured in different locations and orientations to cover the complete working volume of the CMM. In the RP machine case, the RP machine is used to produce a generic artifact which is then measured by a master CMM.

The accuracy and

repeatability of CMM is assumed to be much higher than that of a RP machine. The measured positions of each feature (Xp, Yp, Zp) are written as functions of (x, y, z) in the form of an error model to infer RP machine parametric error functions. The structure of

39 the artifact is not unique as long as it has enough sampling points at different positions to provide sufficient equations for coefficient determination and error minimization. Spheres built in a 3D structure were first thought to be a good choice. Each ball center can provide three equations. The part structure will be simple but efficient. However, the stair-case effect of RP processes worsens the surface accuracy of the spheres, making spherical features not applicable. Cylinders of different heights or cylindrical holes in a plate were found to be more suitable for RP machine study. Error identification and compensation were implemented first using a 2D artifact and then extended to a 3D artifact. The rest of this chapter will present the results for both the cases.

4.4 Application to a 2D Artifact

4.4.1 2D Error Model and Artifact

Since the parametric errors are assumed to be zero at the starting point of each axis, by manipulating the structure of the artifact, some parametric errors will drop out from the model, leaving an equation system that is easier to solve. To test the feasibility of the software error compensation approach, it was first applied to a simple 2D artifact built in the XY plane. Errors were then predicted by the error model and applied to the same artifact design for compensation. Considering only the XY plane of the machine, all errors associated with the Z axis vanish from the equations. The machine model is simplified into the following form:

40 X p = x + [δ x ( x ) + δ x ( y )] − y ⋅ ε z ( x ) + τ x

[

]

Y p = y + δ y (x ) + δ y ( y ) + τ y

4.11

Z coordinates are not considered in the 2D case. Using 3rd order polynomials for each error function, the machine model can be written as follows: 3 ⎛1 ⎞ X p = x + xtx1 ⋅ x + xtx 2 ⋅ ( x 2 ) + xtx3 ⋅ ⎜ (5 x 3 − 3x ) ⎟ 2 ⎝2 ⎠ 3 ⎞ ⎛1 + ytx1 ⋅ y + ytx2 ⋅ ( y 2 ) + ytx3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟ 2 ⎠ ⎝2 3 ⎡ ⎛1 ⎞⎤ − y ⎢ xrz1 ⋅ x + xrz 2 ⋅ ( x 2 ) + xrz 3 ⋅ ⎜ (5 x 3 − 3x ) ⎟⎥ + τ x 2 ⎝2 ⎠⎦ ⎣ 3 ⎛1 ⎞ Y p = y + xty1 ⋅ x + xty 2 ⋅ ( x 2 ) + xty 3 ⋅ ⎜ (5 x 3 − 3x ) ⎟ 2 ⎝2 ⎠ 3 ⎛1 ⎞ + yty1 ⋅ y + yty 2 ⋅ ( y 2 ) + yty 3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟ + τ y 2 ⎝2 ⎠

4.12

Fifteen unknown coefficients in the 2D error model need to be estimated. A plate with a number of geometric elements mounted into it has been shown to be an effective 2D artifact for CMM error evaluation (Sartori (1995)). In this study, a plate with cylindrical through holes was used. The position of the central axis of each hole is the key feature, which provides two equations for error functions coefficients estimation. The 2D hole-plate designed for this study is shown in Figure 4-3. It is 4.8 inch × 4.8 inch × 0.5 inch, with 36 cylindrical holes in 6 rows and 6 columns. All holes are 0.4 inch in diameter except the one in the right lower corner (0.3 inch) and the one in the right upper corner (0.5 inch). These two holes were made to different sizes on purpose to identify the orientation of the plate. The center positions of the 36 holes can provide 72

41 equations, which are large enough for determining the 15 coefficients by minimizing the random error. This part was designed in Pro/Engineer and then exported as a STL model. 3D Lightyear® software of SLA machine read and verified the STL file, added the support structure, sliced the model and prepared the files required to drive the SLA 250 machine. The part was built in “Exact” style (solid part). By automatic placement, the part was made in the center of the platform. After post processing, the part was measured by a Carl Zeiss CMM ECLIPSE 550. A part coordinate system was built. The top surface defines the XY plane, the front edge defines the X axis and the front left corner is defined as the origin. The Y axis lies on the top surface and is perpendicular to the X axis.

Y 0.72 0.72 0.72 0.72 0.72 0.6 O 0.6

0.72

0.72

0.72

Figure 4-3: 2D Hole Plate Test Part ( inch )

0.72

0.72

X

42 4.4.2 Parametric Error Functions before Compensation

Table 4-1 lists the center coordinates of the holes in the part coordinate system. The data are arranged in the way the holes appear on the plate. Due to the errors of the rapid prototyping machine, the actual hole-centers are not positioned at the nominal locations. Table 4-1: Hole Center Coordinates of The Original Plate (inch) x 0.59970 y 4.18959

1.31822 4.18885

2.03704 4.18867

2.75571 4.18858

3.47456 4.18849

4.19369 4.18914

x 0.59941 y 3.47157

1.31826 3.47089

2.03697 3.47058

2.75590 3.47100

3.47439 3.47077

4.19339 3.47117

x 0.59963 y 2.75379

1.31862 2.75329

2.03733 2.75297

2.75622 2.75279

3.47497 2.75283

4.19333 2.75321

x 0.60009 y 2.03589

1.31863 2.03538

2.03743 2.03511

2.75619 2.03480

3.47506 2.03497

4.19375 2.03543

x 0.60007 y 1.31780

1.31896 1.31741

2.03740 1.31735

2.75662 1.31718

3.47517 1.31736

4.19407 1.31753

x 0.60030 y 0.59968

1.31913 0.59953

2.03781 0.59963

2.75677 0.59931

3.47516 0.59931

4.19394 0.59982

An unconstrained non-linear programming problem was formulated to solve for the coefficients, with the objective function to minimize the sum of square of all the residual random errors τ , where 36

τ = ∑ (τ x ,i 2 + τ y ,i 2 )

4.13

i =1

A LINGO program was written and the coefficients estimated are listed in Table 4-2.

43 Table 4-2: Parametric Error Functions Coefficients of Uncompensated Machine

δ x (y)

δ x (x )

δ y (y)

ε z (x )

δ x (y)

xtx1

-0.0001095

ytx1

0.0010525

xrz1

0.0005540

yty1

0.0011219

xty1

-0.0009974

xtx 2

-0.0004188

ytx 2

-0.0003067

xrz 2

-0.0001427

yty 2

-0.0004853

xty 2

-0.0005653

xtx 3

-0.0000291

ytx3

0.0000264

xrz 3

0.0000097

yty 3

0.0000477

xty 3

0.0000443

With these coefficients, the parametric error functions of the X and Y axes were determined and plotted in Figure 4-4 to Figure 4-8. It can be seen that: 1. The scale error of the X and Y axis are both quite large. The dominant reason for this is thought to be the post cure shrinkage of the resin. 2. The scale error of the Y axis is almost twice the scale error of the X axis. This is thought to be due to the different conditions of two laser scans. During the rapid prototyping process, the laser first scans along the Y direction and then along the X direction. In the first scan, the cured resin is not attached to the previous layer and is thus allowed to freely shrink; in the second scan, the layer is attached to the previous one, is subject to more constraints, and cannot shrink as much as in the Y direction. 3. The straightness errors are much smaller in magnitude compared to the scale errors, but again the Y axis straightness is more than twice the X axis straightness. This can be explained by the manner in which squareness error is handled. The out-of-squareness error between the X and Y axes are modeled as the linear term of straightness error δ x ( y ) . Thus δ x ( y )

44 actually includes the out-of-square error between the X and Y axes besides the straightness of the Y axis. 4. The rotational error of X axis around Z axis is positive.

Scale Error of X axis X coordinates (inch) 0 0

1

2

3

4

Scale Error of X axis (inch)

-0.001 -0.002 -0.003 -0.004 Before Comp.

-0.005

After Comp.

-0.006 -0.007

Figure 4-4: Scale Error of X Axis before and after Compensation

5

45

Scale Error of Y axis Y coordinates (inch) 0

Scale Error of Y axis (inch)

0

1

2

3

4

5

-0.002 -0.004 -0.006 -0.008

Before Comp. After Comp.

-0.01 -0.012

Figure 4-5: Scale Error of Y Axis before and after Compensation

Y Straightness of X axis

Y-straightness of X axis (inch)

0.0005 Before Comp. After Comp.

0.0004 0.0003 0.0002 0.0001 0

0

1

2

3

4

5

-0.0001 -0.0002 -0.0003

X coordinates (inch)

Figure 4-6: Straightness Error of X Axis in Y Direction before and after Compensation

46

X Straightness of Y axis 0.0012 X-straightness of Y axis (inch)

0.001 0.0008 0.0006 0.0004

Before Comp. After Comp.

0.0002 0 -0.0002

0

1

2

3

4

5

-0.0004 -0.0006 Y coordinates (inch)

Figure 4-7: Straightness Error of Y Axis in X Direction before and after Compensation

X axis Rotational Error About Z axis X Rotational Error About Z (Arc. Sec)

100 80 60 Before Comp. After Comp.

40 20 0 0

1

2

3

4

5

-20 -40 X coordinates (inch)

Figure 4-8: Rotational Error of X Axis around Z Axis before and after Compensation

47 4.4.3 Parametric Error Functions after Compensation

With the derived parametric error functions, the volumetric error at the location of each hole center can be predicted by the error model. By applying a negative value of the predicted error to the location of each hole, it is possible to move the actual holes closer to their nominal position. Since these are error compensation for discrete points, it can be directly applied to the CAD model. A second plate, with compensation applied to all the hole positions, was built and the actual hole center coordinates were measured and listed in Table 4-3. Table 4-3: Hole Center Coordinates of The Compensated Plate (inch) x 0.59938 y 4.19885

1.31942 4.19834

2.03912 4.19822

2.75902 4.19851

3.47883 4.19880

4.19885 4.19816

x 0.59937 y 3.47937

1.31956 3.47899

2.03902 3.47866

2.75894 3.47920

3.47906 3.47897

4.19863 3.47877

x 0.59931 y 2.75915

1.31904 2.75917

2.03903 2.75912

2.75907 2.75910

3.47874 2.75893

4.19866 2.75847

x 0.59930 y 2.03943

1.31916 2.03920

2.03904 2.03893

2.75873 2.03937

3.47882 2.03907

4.19857 2.03929

x 0.59962 y 1.31962

1.31932 1.31930

2.03858 1.31952

2.75912 1.31988

3.47885 1.31941

4.19884 1.31940

x 0.59968 y 0.60017

1.31910 0.59956

2.03895 0.60039

2.75916 0.59984

3.47896 0.60037

4.19881 0.59971

Using the same estimation method, the coefficients of the error functions were obtained and listed in Table 4-4 . The new parametric error functions are again plotted in Figure 4-4 to Figure 4-8 .

48 Table 4-4: Parametric Error Functions Coefficients in Compensated Machine

δ x (y)

δ x (x )

δ y (y)

ε z (x )

δ x (y)

xtx1

-0.0009403

ytx1

0.0002012

xrz1

0.0002202

yty1

-0.0001308

xty1

-0.0002238

xtx2

-0.0001998

ytx 2

-0.0000002

xrz 2

-0.0000602

yty 2

-0.0000696

xty 2

-0.0000357

xtx3

-0.0000137

ytx3

0.0000019

xrz 3

0.0000042

yty 3

-0.0000085

xty 3

0.0000028

The following observations can be made by comparing the two sets of error functions: 1. The scale errors are dramatically reduced by error compensation. δ x (x ) is reduced to one sixth of its original value, while δ y ( y ) is only about one tenth of its original value. This is a great improvement of the part dimensional accuracy since scale errors are the dominant errors in terms of magnitude. 2. The straightness errors of the X and Y axes are both reduced to about one half of their original values.

Considering that the magnitude of

straightness errors is very small even in the uncompensated case, this reduction is still a success. The magnitude of rotational error is also reduced from 58.93 arc·sec to 18.61 arc·sec (but different direction). Both 1 and 2 illustrate that the software error compensation works well. The compensated part has much better dimensional accuracy than the original one.

49 3. There still exist errors in the compensated process, although much smaller magnitude. To explain this, the property of software error compensation needs to be understood.

Only stable and repeatable errors can be

simulated by the model and be compensated, random errors cannot be compensated and they will show up in both uncompensated and compensated processes, probably in different magnitudes or even in different directions. It is impossible to compensate for all the errors. The CMM measurement accuracy may also limit how good the compensation can be.

Theoretically, in the worst case of a perfectly compensated

system, the error left in the compensated system should be about twice the sum of the repeatability error of the CMM and the random error in the RP process.

4.5 Application to a 3D Artifact

The 2D error compensation presented demonstrates the feasibility of this method by considerable reduction of feature positioning errors. The approach was then extended to 3 dimensions to make it useful to most applications in a RP machine. In the 3D application, the parametric errors of all three axes of the SLA 250 machine need to be derived simultaneously using a 3D artifact and error compensation need to be applied to the entire 3D part model instead of to discrete data points. These issues will be addressed in this section.

50 4.5.1 3D Error Model and 3D Artifact

Recall that the 3D error model for the SLA machine is as follows: X p = x + [δ x ( x ) + δ x ( y ) − δ x ( z )] − y[ε z ( x ) − ε z ( z )] + z ⋅ ε y ( z ) + τ x Y p = y + [δ y ( x ) + δ y ( y ) − δ y ( z )] − xε z ( z ) − z ⋅ ε x ( z ) + τ y

4.14

Z p = − z + [δ z ( x ) + δ z ( y ) − δ z ( z )] + xε y ( z ) + y[ε x ( x ) − ε x ( z )] + τ z

The coefficients of each parametric error function will be inferred using the error values sampled by a 3D artifact. Thus the design of the 3D artifact, including the feature used to sample errors and the distribution of the sampling points in the working envelope, will play an important role in the error identification procedure. Before designing a 3D artifact, the following questions need to be answered: (1) What kind of feature is appropriate to sample errors in the RP process? (2) How many sampling points are needed? and (3) How should the sample points be distributed in the RP working envelope? (1) Feature used for error sampling An error sample is provided by the difference between the nominal position and the actual position of a feature. Thus the actual position of the feature should be easy to measure. The feature should avoid staircase effect or support structure, which makes the measurement inaccurate. Spherical features and horizontal cylindrical features are usually used for CMM error measurement, but due to the staircase effect and support structures, they are not suitable for RP machines. Down-facing planes cannot be used either due to support structure. Vertical cylinders are easy to build and measure. Their top surface can provide

51 the height information and the center of their top end can provide the position in the XY plane. Vertical cylinders are thus chosen as the error sampling feature. With vertical cylinders, only one cylinder can be made at each (x, y) position. Also, to avoid bending of high vertical cylinders, the diameters of the cylinders cannot be too small compared to their heights. A diameter of 0.4 inch seems a suitable choice. Since the SLA machine automatically positions the part at the center of its platform, to help build a part coordinate system, one cylinder located at the geometric center of the part is preferred. With these considerations, the geometry of the 3D artifact is preliminarily defined as a set of cylinders positioned at the intersections of an odd number of grids on the XY plane. The number of the sampling points and the heights of these cylinders need to be determined. (2) Distribution of sampling points One popular way of sampling is to sample randomly. In this problem, it means to assign the cylinders heights randomly. However, constraints in the measurement process of the artifact eliminate this choice. The features will be measured by a CMM, which uses a probe of certain length to touch the surface and return measurement results. The geometry of the probe is shown in Figure 4-9. To make sure that the probe can touch all the cylinders on the artifact without collision with other cylinders, adjacent cylinders on the artifact cannot have a height difference larger than the probe length. Based on this constraint, it is decided that the heights of adjacent cylinders in any row are differentiated only by two levels. Adjacent rows will be different by shifting one cylinder from one end to the other.

52

Figure 4-9: CMM Measuring Probe

(3) Number of sampling points As stated previously, an over-estimated equation system is preferred to minimize the effect of random errors and to improve the accuracy of the estimated coefficients. However, more sampling points need more time to build and more time to measure. The number of sampling points was determined using the following method. A set of artificial coefficients were first assigned to each parametric error function. Assume the number of sampling points and predict the actual positions of these cylinders using the artificial parametric error model. Then, treat these predicted values as known actual positions to infer coefficients using the least square estimation. Compare the inferred coefficients with the artificial coefficients. If the number of sampling points is enough, they should be close. Experiments showed that 169 is a good number. With all the above constraints and considerations, the 3D artifact designed for this study is shown in Figure 4-10. Using this artifact, a working envelope of 8 inch (x) × 8

53 inch (y) × 4 inch (z) can be studied. It is composed of 169 cylinders at 13 height levels and located at the intersections of 13 x levels and 13 y levels. The heights of the cylinders were designed in such a way that the 13 cylinders in the same x level have 13 different z values and 13 cylinders in the same y level have 13 different z values. It is a Latin Square Design. Also, all cylinder top surfaces are easily reachable by the CMM probe during measurement. The position of the top center point of each cylinder was measured and can be written as a function of its nominal position and the error coefficients. This part can provide 169 × 3 = 507 equations, which are large enough to determine the 42 coefficients by minimizing the non-repeatable errors.

Figure 4-10: 3D Artifact The artifact was built in “Exact” style using the default parameter of the machine. By automatic placement, the part was made in the center of the platform. After post processing, the 3D artifact was measured on a Carl Zeiss ECLIPSE 550 CMM. A part coordinate system was defined with the top surface of the base as the x-y plane and the

54 center of the 3D artifact as the x, y datum. The coordinate of the top central point of each cylinder was measured for estimation of the error function coefficients. The x and y coordinates of the center point were found by measuring around the periphery of each cylinder and computing a best fit center.

4.5.2 Estimation of the Parametric Error Functions

An unconstrained non-linear programming problem was formulated to solve for the coefficients, with the objective function to minimize the sum of square of all the residual non-repeatable errors τ , where 169

τ = ∑ (τ x ,i 2 + τ y ,i 2 + τ z ,i 2 )

4.15

i =1

A LINGO program was written to solve for the 42 coefficients and the results are listed in Table 4-5 for each polynomial error function. Table 4-5: Coefficients of Polynomial Error Functions

δx(x) δy(x) δz(x) δx(y) δy(y) δz(y)

coeff_1 coeff_2 coeff_3 Rotational Error (inch) (inch) (inch) -0.0012621 0.0000236 -0.0000063 εx(x) 0.0004428 0.0000650 -0.0000016 εz(x) -0.0002607 0.0002191 -0.0000024 εx(z) -0.0007991 -0.0000026 -0.0000038 εy(z) -0.0014786 0.0000090 -0.0000037 εz(z) -0.0005633 -0.0000764 0.0000043

δx(z)

-0.0003515 -0.0006555 -0.0000176

δy(z) δz(z)

0.0048894 0.0038285 0.0004453 -0.0204798 -0.0082318 -0.0009434

Translational Error

coeff_1 (rad) 0.0002166 -0.0001421 0.0002496 0.0005416 -0.0013216

coeff_2 coeff_3 (rad) (rad) -0.0000195 -0.0000077 -0.0000104 0.0000037 0.0002741 0.0000410 -0.0000706 -0.0000256 -0.0004488 -0.0000341

55 Using these coefficients, the parametric error functions of all three axes were determined and shown in Figure 4-11 to Figure 4-24. The following observations can be made: 1. The parametric errors are not always linear functions and not always symmetric about the x=0 or y=0 axis. Error compensation based on this error model is more accurate than what is possible by applying simple shrinkage factor compensation. 2. In terms of magnitude, the scale error of the z axis, ztz is the largest translational error. This is quite understandable since the part is made layer by layer in the z direction, the interaction between layers and the top layer shift cause more errors in the z direction than in the x or y direction.

Scale Error of X Axis 0.008 0.006

xtx (inch)

0.004 0.002 -5

-4

-3

-2

0.000 -1 0 -0.002

1

2

-0.004 -0.006 -0.008 X Coordinate (inch)

Figure 4-11: Scale Error of X Axis in SLA 250 Machine

3

4

5

56

Straightness Error of X Axis 0.0040

xty (inch)

0.0030 0.0020 0.0010

-5

-4

-3

-2

0.0000 -1 0

1

2

3

4

5

-0.0010 X Coordinate (inch)

Figure 4-12: Straightness Error of X Axis in Y Direction in SLA 250 Machine

Straightness Error of X Axis 0.008

xtz (inch)

0.006 0.004 0.002

-5

-4

-3

-2

0.000 -1 0

1

2

3

4

5

-0.002 X Coordinate (inch)

Figure 4-13: Straightness Error of X Axis in Z Direction in SLA 250 Machine

57

Straightness Error of Y Axis 0.006 0.004

ytx (inch)

0.002

-5

-4

-3

-2

0.000 -1 0 -0.002

1

2

3

4

5

-0.004 -0.006 Y Coordinate (inch)

Figure 4-14: Straightness Error of Y Axis in X Direction in SLA 250 Machine

Scale Error of Y Axis 0.008

yty (inch)

0.004

-5

-4

-3

-2

0.000 -1 0

1

2

-0.004

-0.008 Y Coordinate (inch)

Figure 4-15: Scale Error of Y Axis in SLA 250 Machine

3

4

5

58

Straightness Error of Y Axis 0.001

-4

-3

ytz (inch)

-5

-2

0.000 -1 0

1

2

3

4

5

-0.001 -0.002 -0.003 -0.004 Y Coordinate (inch)

Figure 4-16: Straightness Error of Y Axis in Z Direction in SLA 250 Machine

Straightness Error of Z Axis 0.000 -5

-4

-3

-2

-1

-0.002

0

ztx (inch)

-0.004 -0.006 -0.008 -0.010 -0.012 -0.014 Z Coordinate (inch)

Figure 4-17: Straightness Error of Z Axis in X Direction in SLA 250 Machine

59

Straightness Error of Z Axis 0.010 0.008

zty (inch)

0.006 0.004 0.002 0.000 -5

-4

-3

-2

-1

0 -0.002

Z Coordinate (inch)

Figure 4-18: Straightness Error of Z Axis in Y Direction in SLA 250 Machine

Scale Error of Z Axis 0.035 0.030

ztz (inch)

0.025 0.020 0.015 0.010 0.005 0.000 -5

-4

-3

-2

Z Coordinate (inch)

Figure 4-19: Scale Error of Z Axis in SLA 250 Machine

-1

0

60

Roll of X Axis 100

xrx (arc . sec)

50 0 -5

-4

-3

-2

-1

0

1

2

3

4

5

2

3

4

5

-50 -100 -150 -200 X Coordinate (inch)

Figure 4-20: Roll of X Axis in SLA 250 Machine

Yaw of X Axis 40

xrz (arc . sec)

20 0 -5

-4

-3

-2

-1

0

1

-20 -40 -60 -80 X Coordinate (inch)

Figure 4-21: Yaw of X Axis in SLA 250 Machine

61

Pitch of Z Axis 150

zrx (arc . sec)

100 50 0 -5

-4

-3

-2

-1

-50

0

-100 -150 -200 Z Coordinate (inch)

Figure 4-22: Pitch of Z Axis in SLA 250 Machine

Yaw of Z Axis 50 0 -4

-3

-2

zry (arc . sec)

-5

-1

0 -50 -100 -150 -200 -250

Z Coordinate (inch)

Figure 4-23: Yaw of Z Axis in SLA 250 Machine

62

Roll of Z Axis 200

zrz (arc . sec)

150 100 50 0 -5

-4

-3

-2

-1

0 -50 -100

Z Coordinate (inch)

Figure 4-24: Roll of Z Axis in SLA 250 Machine With the parametric error functions and the machine error model, the volumetric error of any point in the working volume of SLA 250 machine can be predicted. Figure 425 is an error map computed for a plane at a fixed Z height.

63

3D Volumetric Error Map of SLA 250 @ Fixed Z Level (Z = 1 inch)

0.018

Volumetric Errors (inch)

0.016 0.014 0.012 0.01 0.008 0.006 0.004

4 2

0.002 0

Y Coordinates (inch)

-4 4

3

2

0

1

-2

-2 -1

-4

-3

0

X Coordinates (inch)

Figure 4-25: 3D Volumetric Error Map of SLA 250 at Fixed Z Level (Z = 1 inch)

4.5.3 Compensation Using Machine Error Model

In this section, the compensation method is first introduced and then applied to different parts to evaluate the validity of the error model obtained using the 3D artifact.

4.5.3.1 Compensation Target File

To compensate errors in discrete points, as done for the 2D artifact, the CAD design can be modified directly. However, to compensate an entire 3D part, this is not practical. As shown in Figure 4-25, the RP machine error map is not homogeneous; the topography of the compensated part will of course change. That is, a plane will no longer

64 be a plane after compensation and a sphere will no longer be a sphere. This makes it very difficult, if not impossible, to represent the compensated part in CAD systems and thus impractical to apply compensation to CAD models. The STL file format was introduced in Chapter 1. It is a triangulated representation of the 3D model and can be read by most RP processes. There are two types of STL files: Binary file and ASCII file. Binary format is normally used due to smaller file size, but its format is not as easy to read and modify as ASCII files. An ASCII STL file on the other hand has the following format: *********************************************************** solid PRT0002 facet normal 0.000000e+000 0.000000e+000 -1.000000e+000 outer loop vertex 1.000000e+001 7.500000e+000 0.000000e+000 vertex -1.000000e+001 -7.500000e+000 0.000000e+000 vertex -1.000000e+001 7.500000e+000 0.000000e+000 endloop endfacet ……… ……… facet normal -1.000000e+000 0.000000e+000 0.000000e+000 outer loop vertex -1.000000e+001 7.500000e+000 3.000000e+000 vertex -1.000000e+001 7.500000e+000 0.000000e+000 vertex -1.000000e+001 -7.500000e+000 0.000000e+000 endloop endfacet endsolid PRT0002 ***********************************************************

Except for the first and the last line, the file can be divided into small units, each of 7 lines, starting with facet normal and ending with endfacet. Each unit describes one facet by listing the facet’s normal unit vector and the coordinates of its three vertices. Such a representation for a cylinder is shown in Figure 4-26 where all vertices of the generated triangles lie on the circumference of the two bounding circles.

65

Apply Compensation

Figure 4-26: Compensation Applied only to Vertices of the Facets Compensation can be applied to the vertices of these bounding circles, which will compensate for the dimensional error in the size and positioning error of the object. However, the implication is that when the slices are made to create the layers that drive the part building process, the body of the cylinder will only inherit compensation which propagates from the displacement of the top and bottom bounding vertices. This means that the feature form error along the Z direction cannot be compensated even if it can be predicted by the machine error model. This is coarse compensation. A more refined compensation is to act instead on the contour of each layer, or the slicing file, generated after the STL file is sliced, as shown in Figure 4-27. Each contour is essentially made up of linear, sequentially connected segments which define the boundary of a layer and drive the build tool during execution of that layer. Applying compensation to each slice of the slice file provides resolution of compensation equal to that of the machine layer resolution. Slice files formats however are highly process-dependent and sometimes proprietary and not easily accessible. Compensation to slice files need to be studied for

66 each specific RP machine. To develop a generic compensation procedure, it was decided to apply compensation to the more accessible ASCII STL files.

Slice 1

Apply Compensation

Slice i

Slice N

Figure 4-27: Compensation Applied to the Contours of All Slices

4.5.3.2 Compensation by Correcting STL Files

Given the machine error model, the actual position of each vertex in the STL file can then be predicted. To compensate for the error between the actual position and the nominal position, the negative value of this difference is added to the nominal vertex coordinates in the STL file in advance. The normal unit vector can be re-calculated for each facet using the compensated vertices.

67

Figure 4-28: A Facet of the STL Model As stated in Chapter 1, the orientation of the facet is specified redundantly in two ways. First, the direction of the normal vector is outward. Second, the vertices are listed in counterclockwise order when looking at the object from the outside (Figure 4-28). Given the coordinates of the three vertices P1 (x1, y1, z1), P2 (x2, y2, z2), and P3 (x3, y3, z3), the normal vector can be obtained by taking the cross product of vectors P1 P2 and P2 P3 . The coordinates of the end point of the normal vector are calculated using Equation 4.16 : xv = ( y 2 − y1 ) × ( z 3 − z 2 ) − ( z 2 − z1 ) × ( y3 − y 2 )

4.16

yv = −( x2 − x1 ) × ( z3 − z2 ) + ( z2 − z1 ) × ( x3 − x2 ) zv = ( x2 − x1 ) × ( y3 − y2 ) − ( y2 − y1 ) × ( x3 − x2 ) The magnitude of the normal vector is Lv = xv2 + yv2 + zv2 . Dividing (xv, yv, zv) by Lv gives the unit vector that should be saved in the STL output file. There are 72 facets in the STL model of the cylinder shown in Figure 4-26. When generating an STL file from a CAD model, the number of facets in a STL model depends on the accuracy parameter chosen by the user. For example, in Pro/Engineer, users can choose their own value of “Chord Height”, which numerically describes the maximum

68 distance between the actual part surface and the triangulated surface of the STL file that describes the part. Figure 4-29 illustrates the concept of chord height:

Figure 4-29: Definition of Chord Height The smaller the chord height, the more triangles are required to describe a particular section of part geometry, and thus, better facet resolution. Output of a highresolution STL file does come with a trade-off. File size often becomes extremely large with low chord height settings. Parts that have a complex geometry and small chord height setting could contain over 100,000 triangles. Compensation for a large STL file has to be done automatically. A FORTRAN program was written for the systematic modification of any STL file. It reads in the ASCII STL file generated by the CAD software, applies compensation, and exports the modified results into a new file following the ASCII STL file format. Potentially, adjusting vertices of each facet independently might cause crossing facets in the compensated STL file. However, as shown by the experimental studies, the adjustment made to each vertex is only on the order of 0.001 inch which is very small compared with the part size and usually will not cause invalidity of STL files.

69 In the following sections, the compensation program developed is used to improve the accuracy of three different test parts to demonstrate the capability of the compensation process to improve feature position accuracy, profile accuracy, and dimensional accuracy.

4.5.4 Feature Positioning Accuracy Improvement by Compensation

Since it is very costly to make a part as large as the 3D artifact, a part with similar geometries as the 3D artifact was designed for this study. This part has 49 cylinders of the same diameter as those in the 3D artifact but positioned at different locations and with random heights, as shown in Figure 4-30. Two copies were made by the same SLA machine at exactly the same parameter settings, one without compensation and one with compensation. The volumetric error, i.e. the distance between the nominal position and the actual position, of the top surface center point of each cylinder was calculated and plotted as error maps shown in Figure 4-31. The figure clearly shows a dramatic reduction in the volumetric errors of the compensated part.

70

Figure 4-30: 49-cylinder Test Part

71

Volumetric Errors of 49 Test Points in SLA 250 Working Space Before Compensation 0.016

Volumetric Errors (inch)

0.014 0.012 0.01 0.008 0.006 0.004 -2.7

0.002

-0.9

0 -2.7

X coordinates (inch)

0.9 -1.8

-0.9

0

2.7 0.9

1.8

Y coordinates (inch)

2.7

Volumetric Errors of 49 Test Points in SLA 250 Work Space After Compensation 0.016

Volumetric Errors (inch)

0.014 0.012 0.01 0.008 0.006 0.004 -2.7

0.002

-0.9

0 -2.7

0.9 -1.8

-0.9

0

Y coordinates (inch)

X coordinates (inch)

2.7 0.9

1.8

2.7

Figure 4-31: Volumetric Errors of 49 Points before and after Compensation

72 To quantify this error reduction, the ratio of the volumetric error after compensation and the volumetric error before compensation was calculated for each point. The histogram of the 49 ratios is plotted in Figure 4-32.

On the average, the

volumetric error is reduced to around 33% of its original value. This means that, after compensation for errors, the actual data point is much closer to the nominal position. However, due to non-repeatable factors in the rapid prototyping process and some large z direction errors due to z value quantization in layered manufacturing, the ratio appears to follow a statistical distribution. Most of the data falls between 10%-60%, while one data point even falls in the >1.0 region. Z value quantization will be addressed in later section.

16 14

Ratio = 1.0 Line

Frequency

12 10 8 6 4 2 0 0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Volumetric Error Ratios (Compensated Part / Uncompensated Part)

Figure 4-32: Histogram of Volumetric Error Reduction Ratios

1.1

1.2

73 4.5.5 Profile Accuracy Improvement by Compensation

The previous test demonstrated that discrete points positioning accuracy can be improved by the proposed error compensation approach. Since correcting the STL file not only compensates for the positioning error but also compensates for the error in the shape or profile of the feature itself, this section tests profile accuracy improvement by compensation. A half spherical surface of radius 1.80 inch was designed as a typical example of a continuous surface. Figure 4-33 shows the test part. Data points were sampled on the sphere to cover the entire spherical surface and a best-fit sphere was found by minimizing the sum of square of the deviation of all data points to the fitted surface. It needs to be pointed out that data sampled on a special cap defined by an angle α < 50 degree cannot accurately define the best-fit sphere (Bourdet 1993) (Figure 4-34). A part with α = 45 was first made which failed and was then replaced by a half sphere (α = 90). Around 90 data points were measured on each semi-spherical surface. A GAMS program was written to find the best-fit sphere. Then, among all the points, the two points with maximal deviation and minimal deviation can be easily identified. Using the center of the fitted sphere, these two points will define two concentric spheres between which all data points are contained. The region between these two concentric spheres can be used as an approximate evaluation of the profile accuracy of the surfaces. Table 4-6 lists the calculation results for both the compensated and uncompensated parts.

74

Figure 4-33: Half Spherical Test Part

α

A

Figure 4-34: Spherical Cap Defined by α

B

75 Table 4-6: Spherical Surface Compensation Results Uncompensated Part

Compensated Part

Compensated/ Uncompensated

Fitted Sphere Radius (inch)

1.791

1.794



Sum of Square of the deviations of all data points (inch2)

0.000207

0.000085

41%

Profile Zone (inch)

0.007089

0.005287

74.6%

It is shown that the sum of square of deviations of points on the compensated part is only 41% of that on the uncompensated part, and the profile zone is reduced to 74.6% of the original one. These results show that software error compensation using parametric error models can also improve profile accuracy of continuous surfaces. However, the reduction of the profile zone (74.6%) is not as dramatic as the reduction in the sum of square of deviations (41%). This is because the z value of the top layer of the sphere is quantized due to layered manufacturing and not controllable to a finer scale even in the compensated part. This single point worsens the sphericity of the compensated part by a considerable amount but does not affect the sum of square of deviations by much.

4.5.6 Compensation of a Part with Common Features

A third part was built using the SLA 250 to check how software error compensation works for real parts with common features and dimensional constraints. As shown in Figure 4-35, this part has planes, a sphere, cylindrical holes, a conical hole and slanted vertical surfaces on it. Nominal dimensions and dimensions of the uncompensated and compensated parts are labeled on the same drawing in Figure 4-36

76 for comparison.

Comparison of these three dimensions leads to the following

observations: 1. Overall size of the part and feature positions on the part show considerable improvement. Examples include dimensions of the base block, x-y positions of the sphere, the 0.75 inch diameter cylindrical holes and the conical hole. 2. Cylindrical hole sizes were improved by a smaller amount and both uncompensated and compensated sizes were consistently smaller than their nominal values. The latter can be explained by the tessellation error of STL files. In an STL file, a circle is approximated by a polygon inscribed in the circle; this inevitably reduces its diameter. 3. Dimensions along the z direction such as depth of holes, or sphere size, do not show improvement. In fact, the observation is that these z direction dimensions sometimes got worse because of z value quantization. For example, the accuracy of the 7 degree angle was worsened after compensation due to layer quantization. Ignoring the sphere on the top surface, the nominal height of the part is 0.75 inch, which will be rounded down to 0.748 inch due to layer quantization. The compensated height should be 0.7598 inch, but was rounded up to the closest layer at 0.760 inch. Due to these rounding errors, the compensated part is higher than it should be and thus possess a smaller angle. The layer quantization problem is addressed in the next section.

77

Figure 4-35: Test Part with Common Features

78 3.7500 A 3.3750 B 2.3750 C

Ø0.2500 G 2.9079 D

2.5000 E

0.8750 F

Ø0.5000 H

Ø0.5000 O

15° L 2.5000 M



P

0.8750 N

Ø0.7500 I 0.8750 J 2.8750 K

T 0.2845 0.3750

0.5000 S

Q 0.3750 R

The dimensions of the part are listed in the following table, where, Dim_1 is the nominal dimension; Dim_2 is the dimension of uncompensated part; Dim_3 is the dimension of compensated part; Dim_4 is the dimension of compensated part after removing multiple layers. No. A B C D E F G H I J

Dim_1 3.7500 3.3750 2.3750 2.9079 2.5000 0.8750 0.2500 0.5000 0.7500 0.8750

Dim_2 3.7463 3.3716 2.3724 2.8994 2.4925 0.8730 0.2457 0.4915 0.7445 0.8746

Dim_3 3.7511 3.3754 2.3740 2.9038 2.4943 0.8747 0.2459 0.4922 0.7457 0.8767

Dim_4 3.7520 3.3759 2.3759 2.9048 2.4964 0.8745 0.2463 0.4969 0.7462 0.8760

No. K L M N O P Q R S T

Dim_1 2.8750 15o 2.5000 0.8750 0.5000 7o 0.3750 0.3750 0.500 0.2845

Dim_2 2.8712 14o58’40” 2.4913 0.8738 0.5007 6o52’27” 0.3731 0.3709 0.4995 0.2723

Dim_3 2.8749 15o01’15” 2.4972 0.8754 0.5020 6o38’28” 0.3782 0.3707 0.5081 0.2710

Dim_4 2.8750 15o00’50” 2.4977 0.8746 0.5004 6o37’36” 0.3764 0.3715 0.5074 0.2733

Figure 4-36: Dimensions of Nominal, Uncompensated, Compensated, and Part with Adjusted z (inch)

79 4.5.7 Z Value Quantization in Rapid Prototyping

The error model based on parametric error functions was shown to be quite effective in improving part dimensional accuracy, except in the cases that involve z height or staircase effects. Dimensions in the z direction seem more unpredictable than those in the x-y direction. In addition, an abnormal phenomenon was found in compensated parts: a horizontal surface that should be on the same layer was on multiple layers. This section will explain these anomalies and presents an algorithm to avoid the multiple layers phenomenon, caused by the combination of compensation and layer quantization. Layered manufacturing processes add material to the part layer by layer. The z height of every horizontal surface is thus always an integer multiple of the layer thickness. This is called “Z value quantization” in this study. If the nominal surface height is a little higher or lower, it will be shifted down or up to the adjacent layer during the slicing process (Figure 4-37). This not only results in z value errors in both uncompensated and compensated RP parts, but also causes the multiple layers phenomenon in compensated parts (Figure 4-38). After applying compensation to each vertex in the STL file, the vertices on the same horizontal surface could have different z values. If the difference in z values among vertices is very small and all vertices still fall onto one layer after slicing, the differences in z caused by compensation will vanish; on the other hand, if the difference in z values among vertices is large enough to separate these vertices into two layers, multiple layers will appear on the same connected

80 horizontal surface. Multiple layers phenomenon will reduce the overall quality of the part and should be avoided.

Uncompensated Model

Model Top Surface

Slicing Planes

Actual Surface

Figure 4-37: Z Quantization in Uncompensated Parts

Compensated Model

Model Top Surface

Multiple Layers

Slicing Planes

Actual Surface

Figure 4-38: Z Quantization and Multiple Layers Phenomenon in Compensated Parts An algorithm was developed which eliminates multiple layers on one horizontal surface by first averaging the z coordinates among the vertices on the same horizontal

81 surface and then moving the entire surface up or down to its closest layer. All other facets which are connected to this horizontal surface need to be modified too to ensure connectivity of the entire STL model. The concept of this algorithm is straightforward, while the difficulty in implementation lies in the fact that facets listed in the STL files follow no specific orders. There is no explicit information in the file about which facets belong to the same surface and which facets are connected with each other. With consideration of these issues, the final algorithm proceeds as follows: 1. Count the total number of z levels at which the model has horizontal facets. 2. Put all horizontal facets at the same z level to one group. There could be several disjoint horizontal surfaces in one group. 3. Use the vertex-to-vertex rule discussed in Chapter 1 (each facet must share two vertices with each of its adjacent facets) to further divide each group into disjoint horizontal surfaces. 4. Apply error compensation to the STL model as before. 5. For those facets that belong to one connected horizontal surface, compute the mean z values of all the vertices, adjust it to the height of the closest layer, and assign the adjusted value to all vertices on that surface. Repeat this for all the horizontal surfaces. 6. For each vertex that belongs to a horizontal surface and has been modified, find all the other places where it appears in the STL file. Adjust the z coordinate of each one to the height of that horizontal surface. This step is to ensure connectivity of the STL model.

82 7. Re-compute the normal vector for each facet due to the above modification and export the results. Based on this algorithm, the compensation program was modified and applied to the part in Figure 4-35. The new compensated part no longer has multiple layers. Its dimensions are also listed in Figure 4-36 for comparison with previous values. It is shown that part accuracy is almost the same as the first compensated part. The compensation program with consideration for Z quantization is attached in Appendix A.

4.5.8 Conclusions of 3D Artifact Test Results

By making a specially designed 3D artifact, the parametric errors of the rapid prototyping machine can be determined simultaneously. The compensation tests presented demonstrated how error compensation can be applied to an entire 3D model by modifying its STL file to considerably reduce its dimensional errors. The theoretical development and technological implementation of a generic software compensation technique to improve the accuracy of RP machines have the following impact. 1. They provide a low cost, generic software compensation method to improve the accuracy of a RP process with no hardware modification. 2. Repeatable errors of a RP process are quantified by error functions that will enable a rational comparative evaluation of competing RP processes on the basis of a quantitative assessment of volumetric accuracy.

83 3. The error model of the RP machine partitions the error budget along meaningful spatial directions and serves as a diagnostic tool for the identification of direction dependent error sources due to other process characteristics. Residual dimensional errors still exist in the compensated part. Some are due to non-repeatable errors and inherent properties of layered manufacturing, such as tessellation errors, staircase effects, and z value quantization; others need to be further investigated and might be reduced by refining the error model. Compensation can also be applied to slice files instead of STL files. This will allow control over all vertices on the contour of each layer and thus, theoretically, increases the resolution of direct compensation to that of the layer resolution of the machine. discussed in the following chapters.

These issues will be

Chapter 5 Implementation of Error Compensation on a FDM 3000 Machine

5.1 FDM Machine Error Model

To further test the effectiveness of the software error compensation approach and, more importantly, to implement the slice file compensation method, this study was extended to a FDM 3000 machine available in the Department of Industrial and Manufacturing Engineering at The Pennsylvania State University. Fused Deposition Modeling (FDM) system was introduced in Chapter 1. It builds a prototype by depositing melted plastic. In the FDM machine, the extrusion nozzle, or the tool tip, is mounted to the head which can travel in the horizontal XY plane and the platform can move up and down along the Z axis. In addition, the X axis is carried by the Y carriage. According to these features, a FDM machine corresponds to a ZFYX type machine. The kinematic axes chain vector diagram in Figure 5-1 was used to build the error model for FDM machine, where X, Y, Z, T, and W have the same definition as before: ⎡ x + δ x ( x )⎤ ⎡X P ⎤ ⎡ δ x ( y) ⎤ ⎡ δ x (z ) ⎤ ⎡ xt ⎤ ⎡0⎤ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ X = δ y ( x ) Y = y + δ y ( y ) Z = δ y ( z ) T = y t = 0 W = ⎢ YP ⎥ ⎢ ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢⎣ δ z ( x ) ⎥⎦ ⎢⎣ Z P ⎥⎦ ⎣⎢ δ z ( y ) ⎦⎥ ⎣⎢ z + δ z ( z )⎦⎥ ⎣⎢ z t ⎦⎥ ⎣⎢0⎦⎥

5.1

85

W

T

Z

O

X

Y

Figure 5-1: FDM Machine Axes Chain Vector Diagram By equating the two vector chains from origin O to extrusion nozzle and taking into account rotational errors of X, Y and Z axes, the following equation was obtained. r r r r r Z + R −1 ( Z )W = Y + R −1 (Y ) X + R −1 (Y ) R −1 ( X )T

5.2

Substituting X, Y, Z, T, W and rotational matrices into Equation 5.2 and rearranging the terms, the expressions for the coordinates of the depositing nozzle in the work piece coordinates system Xp, Yp and Zp were obtained: X p = x + δ x (x) + δ x ( y ) − δ x (z ) + y ⋅ ε z (z ) + z ⋅ ε y (z ) + τ x Y p = y + δ y ( x ) + δ y ( y ) − δ y ( z ) + x[ε z ( y ) − ε z ( z )] − z ⋅ ε x ( z ) + τ y

Z p = − z + δ z (x ) + δ z ( y ) − δ z ( z ) + x[−ε y ( y ) + ε y ( z )] − y ⋅ ε x ( z ) + τ z

5.3

In Equation 5.3, each parametric error function again can be represented by a 3rd order polynomial function. For example: 3 ⎛1 ⎞ 2 ⎝2 ⎠ 3 ⎛1 ⎞ ε z ( x) = xrz1 ⋅ x + xrz 2 ⋅ ( x 2 ) + xrz3 ⋅ ⎜ (5 x 3 − 3 x) ⎟ 2 ⎝2 ⎠

δ x ( x) = xtx1 ⋅ x + xtx2 ⋅ ( x 2 ) + xtx3 ⋅ ⎜ (5 x 3 − 3x) ⎟

5.4

86

In general, itj’s are used to represent coefficients of δj(i) and irj’s are used to represent coefficients of εj(i). To fully define the error model of a FDM machine, 42 such coefficients need to be determined.

5.2 Estimation of Coefficients in the Parametric Error Functions

The same 3D artifact design used for the SLA study was used for the FDM machine. This artifact was built with a layer thickness of 0.010 inch, which is the only possible setting of the available FDM machine. Also, the FDM machine does not have a part auto-positioning function as does the SLA machine. Each part will start to be built at the same Z position in the machine, but the location of the part on the platform needs to be specified by the user. In this study, a machine reference coordinate system was defined with the left front corner of the platform as the origin. This point was used as the reference origin for all the parts studied. The 3D artifact was built and measured by the Carl Zeiss Eclipse 550 CMM. During measurement, a part coordinate system was defined with the top surface of the base as the x-y plane and the left front corner of the 3D artifact as the x, y datum. The coordinate of the top central point of each cylinder was measured for estimation of the error function coefficients. With the 169 measured points, the coefficients were found using the same procedure as for the SLA study by minimizing the sum of squares of all residual nonrepeatable errors. The coefficients are listed in Table 5-1 for each polynomial error

87 function. Using these coefficients, the parametric error functions of all three axes are determined and shown in Figure 5-2 to Figure 5-15. The following observations can be made: 1. The parametric errors are not always linear functions and not always symmetric about the x=0 or y=0 axis. Error compensation based on this error model is more accurate than what is possible by applying simple shrinkage factor compensation. 2. In terms of magnitude, scale errors of the three axes are the largest translational errors. 3. The scale error of the X axis and scale error of the Y axis in most of their ranges are positive, which implies an oversized prototype. Table 5-1: Coefficients of FDM Machine Polynomial Error Functions Translational Error

δx(x) δy(x) δz(x) δx(y) δy(y) δz(y) δx(z) δy(z) δz(z)

coeff_1 coeff_2 coeff_3 Rotational Error (inch) (inch) (inch) 0.0024437 -0.0001088 0.0000024 εy(y) 0.0009650 -0.0000994 0.0000033 εz(y) -0.0017483 0.0001725 -0.0000003 εx(z) -0.0000396 -0.0000888 0.0000053 εy(z) -0.0020189 0.0005293 -0.0000244 εz(z) -0.0013518

0.0000971

0.0000012

-0.0059439 -0.0023896 -0.0002756 0.0022604 0.0012610 0.0001175 0.0113696 0.0050943 0.0004876

coeff_1 (rad) 0.0000054 0.0000898 -0.0008350 0.0019100 -0.0006774

coeff_2 (rad) -0.0000123 -0.0000076 -0.0002165 0.0007025 -0.0002798

coeff_3 (rad) -0.0000005 -0.0000002 -0.0000183 0.0000721 -0.0000304

88

Scale Error of X Axis 0.014 0.012 xtx (inch)

0.01 0.008 0.006 0.004 0.002 0 0

2

4

6

8

10

8

10

X coordinates (inch)

Figure 5-2: Scale Error of X Axis of FDM Machine

Straightness Error of X Axis 0.0025

xty (inch)

0.0020 0.0015 0.0010 0.0005 0.0000 0

2

4

6

X coordinates (inch)

Figure 5-3: Straightness Error of X Axis in Y Direction of FDM Machine

89

Straightness Error of X Axis 0.003 0.002

xtz (inch)

0.001 0 -0.001

0

2

4

6

8

10

-0.002 -0.003 -0.004 X coordinates (inch)

Figure 5-4: Straightness Error of X Axis in Z Direction of FDM Machine

Straightness Error of Y Axis 0 0

2

4

6

8

10

ytx (inch)

-0.0005 -0.001 -0.0015 -0.002 -0.0025 Y coordinates (inch)

Figure 5-5: Straightness Error of Y Axis in X Direction of FDM Machine

90

Scale Error of Y Axis 0.005 0.004

yty (inch)

0.003 0.002 0.001 0 -0.001

0

2

4

6

8

10

8

10

-0.002 Y coordinates (inch)

Figure 5-6: Scale Error of Y Axis of FDM Machine

Straightness Error of Y Axis 0 -0.0005

0

2

4

6

ytz (inch)

-0.001 -0.0015 -0.002 -0.0025 -0.003 -0.0035 Y coordinates (inch)

Figure 5-7: Straightness Error of Y Axis in Z Direction of FDM Machine

91

Straightness Error of Z Axis 0.006 0.005 ztx (inch)

0.004 0.003 0.002 0.001 0 -4

-3

-2

-1

0

Z coordinates (inch)

Figure 5-8: Straightness Error of Z Axis in X Direction of FDM Machine

Straightness Error of Z Axis 0.004

zty (inch)

0.003 0.002 0.001 0.000 -4

-3

-2

-1

0 -0.001

Z coordinates (inch)

Figure 5-9: Straightness Error of Z Axis in Y Direction of FDM Machine

92

Scale Error of Z Axis 0.005 0.004 0.003 ztz (inch)

0.002 0.001 -4

-3

-2

0 -0.001 0

-1

-0.002 -0.003 -0.004 -0.005 Z coordinates (inch)

Figure 5-10: Scale Error of Z Axis of FDM Machine

Roll of Y Axis 0 -50

0

2

4

6

yry (Arc. Sec)

-100 -150 -200 -250 -300 -350 -400 Y coordinates (inch)

Figure 5-11: Roll of Y Axis of FDM Machine

8

10

93

Pitch of Y Axis 40 30 yrz (Arc. Sec)

20 10 0 -10 0

2

4

6

8

10

-20 -30 -40 -50 Y coordinates (inch)

Figure 5-12: Pitch of Y Axis of FDM Machine

Pitch of Z Axis 180 160 zrx (Arc. Sec)

140 120 100 80 60 40 20 0 -4

-3

-2 Z coordinates (inch)

Figure 5-13: Pitch of Z Axis of FDM Machine

-1

0

94

Yaw of Z Axis 0 -4

-3

-2

-1

0

zry (Arc. Sec)

-50 -100 -150 -200 -250 Z coordinates (inch)

Figure 5-14: Yaw of Z Axis of FDM Machine

Roll of Z Axis 80 70 zrz (Arc. Sec)

60 50 40 30 20 10 0 -4

-3

-2 Z coordinates (inch)

Figure 5-15: Roll of Z Axis of FDM Machine

-1

0

95 5.3 Compensation Methods and Results

The STL file compensation method was first applied to further test the effectiveness of compensation for the FDM machine. Since the slice file format of the FDM machine is accessible, the slice file compensation method was then developed and compared with the STL file compensation.

5.3.1 Feature Positioning Accuracy Improvement by STL File Compensation

The same 49-cylinder test part as used in the SLA machine study was used in this study. Two copies were made on the same FDM machine, one with compensation and one without compensation. The volumetric error of the top surface center point of each cylinder was calculated. The ratio of the volumetric error after compensation and the volumetric error before compensation was calculated for each point and the histogram of the 49 ratios is plotted in Figure 5-16. On average, the volumetric error is reduced from 0.0063 inch to 0.0037 inch, which is around 68.7% of its original value. This is a considerable improvement. However, due to non-repeatable factors in the rapid prototyping process and Z value quantization in layered manufacturing, the ratios follow a statistical distribution and a number of data points are greater than 1.0, which implies a larger volumetric error after compensation. For comparison, the corresponding test results of the SLA machine are duplicated in Figure 5-17. Clearly, the improvement through compensation for the FDM machine is not as great as that for the SLA machine. The reason behind this is discussed in the next section.

96

Histogram of Volumetric Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

More

Volumetric Error Ratio

Average Ratio = 0.687 Volumetric Error: 0.0063inch →0.0037 inch

Figure 5-16: Histogram for FDM Machine

Histogram of Volumetric Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Volumetric Error Ratio

Average Ratio = 0.355 Volumetric Error: 0.0097 inch→0.0035 inch

Figure 5-17: Histogram for SLA Machine

More

97 5.3.2 Comparison of FDM and SLA Compensation Results

Recall that the layer thickness parameter in the FDM machine is 0.010 inch, 2.5 times thicker than that used in the SLA 250 machine (0.004 inch). This implies larger Z value quantization in FDM machine and thus less controllability of Z direction dimensions. To test whether this was the reason for less volumetric errors reduction by compensation for the FDM machine, the volumetric errors were decomposed into errors in the XY plane and errors in the Z direction and the reduction ratios by compensation were computed for the XY plane errors and the Z direction errors respectively. Figure 518 and 5-19 compare these decomposed errors before and after compensation for SLA

250 and FDM 3000 machines.

98

Histogram of XY Plane Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

More

XY Plane Error Ratio

Average Ratio = 0.383 XY Plane Error: 0.0047 inch →0.0014 inch

(a) FDM Machine Histogram of XY Plane Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

XY Plane Error Ratio

Average Ratio = 0.371 XY Plane Error: 0.0050 inch →0.0018 inch

(b) SLA Machine

Figure 5-18: Histogram of XY Plane Error Reduction Ratios

More

99

Histogram of Z Direction Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

More

Z Direction Error Ratio

Average Ratio = 1.041 Z Direction Error: 0.0039 inch →0.0032 inch

(a) FDM Machine Histogram of Z Direction Error Reduction Ratios 22 20 18 Frequency

16 14 12 10 8 6 4 2 0 0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Z Direction Error Ratio

Average Ratio = 0.395 Z Direction Error: 0.0076 inch →0.0027 inch

(b) SLA Machine Figure 5-19: Histogram of Z Direction Error Reduction Ratios

It can be seen from Figure 5-18 and Figure 5-19 that:

More

100 1. For both the FDM machine and the SLA machine, the errors in the XY plane were greatly reduced by compensation, with an average reduction ratio of 0.383 and 0.371 respectively. Also the average XY plane error values after compensation were about the same for both machines, 0.0014 inch for FDM and 0.0018 inch for SLA. No significant difference was found between FDM and SLA. 2. The Z direction error of the FDM machine was not improved by compensation at all. The average reduction ratio is 1.041, much worse than the reduction ratio of 0.395 in the SLA case. However, the average Z direction error values after compensation are again about the same for both machines, 0.0032 inch for FDM and 0.0027 inch for SLA. This implies that, with the proposed software error compensation method, a dimensional accuracy of around 0.003 inch in the Z direction can be reached for both machines. The difference in the reduction ratios is due to the different Z direction errors in the uncompensated parts. 3. Due to layer quantization, Z direction dimensions are less controllable. This explains why the residual Z direction error is larger than the XY plane error in the compensated part.

5.3.3 Slice File Compensation for Form Error Reduction

In Chapter 4, the slice file compensation method was mentioned. It can provide the resolution of compensation equal to that of machine layer resolution. The slice file format of the SLA machine is proprietary, thus only STL file compensation was

101 developed for the SLA study. The slice file format of the FDM machine, SSL file, is readable and has the following format: (Text in Italic is comment.) ----------------------------------------------------------------------Slice V15 - QuickSlice 6.3 qsnc 09-Sep-99 --- Run Date 03 Oct 02 16:37:09 *Software Info FILE(0,U:\IE research\FDM\block.stl,PRT0001) *File Name Z 0.009 0.01 F *Start a new layer O 0 1 * Start a new contour 4 * Number of vertices in the contour 2.0999999 2.0999999 * Vertex 1 0.10000002 2.0999999 * Vertex 2 0.10000002 0.099999905 * Vertex 3 2.0999999 0.099999905 * Vertex 4 CVIMNNN 0.10000002 2.0999999 0.099999905 2.0999999 7.9999998 3.9999998 *A list of parameters (min X, max X, min Y, max Y, Perimeter, Area) 1 * Start a new contour 4 * Number of vertices in the contour 1.6 1.5999999 1.6 0.5999999 0.60000002 0.5999999 0.60000002 1.5999999 CVBMNNN 0.60000002 1.6 0.5999999 1.5999999 4 -1 * * * End of the layer Z 0.019 0.01 F * Start a new layer 1 4 2.0999999 2.0999999 0.10000002 2.0999999 0.10000002 0.099999905 2.0999999 0.099999905 CVIMNNN 0.10000002 2.0999999 0.099999905 2.0999999 7.9999998 3.9999998 1 4 1.6 1.5999999 1.6 0.5999999 0.60000002 0.5999999 0.60000002 1.5999999 CVBMNNN 0.60000002 1.6 0.5999999 1.5999999 4 -1 * * … END -------------------------------------------------------------------------

The SSL file lists all the contours in each layer after slicing the STL model. For each contour, the number of vertices and the (X, Y) coordinates of each vertex are listed, followed by a number of summary parameters including min X, max X, min Y, max Y, perimeter, and area. The vertices are listed in a sequence such that, when traveling along these vertices, the material is always to the left. When compensating using the slice files, it will be a two-step procedure. First, use the STL compensation method discussed previously to compensate only for the Z

102 direction error for all vertices in the STL model. Then, the compensated STL model is sliced to generate the slice file. Compensation for X and Y errors will be applied to each vertex in the SSL file. With this two-step procedure, the Z direction error can be compensated while taking advantage of the higher resolution of slice file compensation. SSL file compensation compensates error at each individual layer and thus provides a better compensation resolution along the Z direction. A direct benefit over STL file compensation would be improvement in the form error of vertically positioned features, such as vertical cylinders and vertical planes. Compensation for the overall part size and feature position should stay the same and will not be tested against the STL file compensation. To check the extra benefit in vertical feature form error reduction brought by SSL compensation, two test parts were designed, as shown in Figure 5-20. Both parts have a planar base, which was used to assist in positioning the part relative to the origin of the platform. Part (a) has a cylinder of 1.8 inch diameter and part (b) has horizontal, vertical and slanted planar surfaces. Two copies of each part were built, one with STL compensation, and the other with SSL compensation. The cylinder and the planes were measured and their form error data is listed in the Table 5-2.

103

4

2

1 3

5

6

(a) Cylindrical Test Part

(b) Planar Test Part

Figure 5-20: Cylindrical and Planar Test Parts to Compare STL and SSL Compensations

Table 5-2: Form Error of Cylinder and Planes with STL and SSL Compensation Form Error

SSL compensation

STL compensation

Comparison

Cylindricity

0.00401

0.00455

SSL < STL

Plane 1

0.00293

0.00271

SSL > STL

Plane 2

0.00190

0.00191

SSL ≈ STL

Plane 3

0.00134

0.00193

SSL < STL

Plane 4

0.00249

0.00318

SSL < STL

Plane 5

0.00220

0.00157

SSL > STL

Plane 6

0.00169

0.00161

SSL > STL

Flatness

Comparing the form error data of SSL compensation method with that of STL compensation method, there is not enough evidence to conclude that one compensation method is better than the other. This is not what was expected. A possible explanation lies in the machine control resolution. Does the FDM machine have high enough resolution to distinguish between STL compensation and SSL compensation?

104 To answer this question, the actual difference between SSL and STL compensation was analyzed. Take one vertical line on the cylinder surface located at XY location (2.700, 2.700) and consider the points obtained after slicing. The coordinates of those points without compensation are known. Using the machine error model, compute the (X, Y) coordinates of those points with STL compensation and with SSL compensation respectively. Figure 5-21 and Figure 5-22 shows the X and Y coordinates of those points after STL compensation and SSL compensation respectively. It is seen that, at the same Z value, the difference between the STL line and the SSL line is always less than 0.001 inch. This implies that, if the machine control resolution in the X and Y axes is equal to or larger than 0.001 inch, these two types of compensated methods will cause no difference in the motion of the machine tool tip, and hence cannot be differentiated. Unfortunately, based on the data provided by the manufacturer, the FDM 3000 machine has a resolution of just around 0.001 inch in both the X and Y direction. As a result, STL file compensation already reaches the machine control resolution, and SSL compensation will not introduce any further improvement.

105

Compare SSL compensation and STL compensation (Line Nominal X Coordinates = 2.700 inch) 3.5 Line with SSL Compensation

Z coordinates (inch)

3

Line with STL Compensation

2.5 2 Nominal Line

1.5 1 0.5 0 2.700

2.701

2.702

2.703

2.704

2.705

X Coordinates (inch)

Figure 5-21: X coordinates of the Line

Compare SSL compensation and STL compensation (Line Nominal Y Coordinates = 2.700 inch) 3.5 Line with SSL Compensation

Z coordinates (inch)

3

Line with STL Compensation

2.5 2 1.5 1 0.5 Nominal Line

0 2.700

2.701

2.702

2.703

Y Coordinates (inch)

Figure 5-22: Y coordinates of the Line

2.704

2.705

106 5.4 Conclusions

The software error compensation method was applied to the FDM 3000 machine and it reduced the volumetric error by around 30% on average. In comparison with the SLA 250 machine, the reduction ratio was smaller, but the error values after compensation were about the same for both machines. These values can be thought of as the residual errors after compensation and define the ability of the proposed error compensation method. Due to layer quantization, the residual error in the Z direction was larger than the residual error in the XY plane. The slice file compensation method was developed and tested using two test parts. Although it theoretically allows higher compensation resolution, the actual machine control resolution is not high enough to distinguish the difference between STL compensation and slice file compensation. When the machine control resolution is considerably higher than the difference between STL and SSL compensation, SSL compensation will be a better choice.

Chapter 6 3D Artifact Design

In the software error compensation approach, the coefficients of the virtual parametric error functions are estimated using a 3D artifact. The artifact is a part with a number of features. The difference between the actual and the nominal positions of each feature provides a sample, or an observation, of the volumetric errors. These error samples are used to infer the coefficients of each parametric error function. Each coefficient is thus an estimated value, having an associated variance and confidence interval. Different artifacts can be used to sample the volumetric errors, where each artifact can be viewed as a sampling scheme. Each will result in a different confidence region of the estimated coefficients. One interesting problem addresses the choice of these sampling points (artifact design) in the RP working volume so that the confidence region of the estimated coefficients is minimal. This is a Design of Experiments (DOE) problem. In order to demonstrate the relationship between the sampling scheme and the variances of the estimated coefficients, multiple linear regression and design of experiments are first reviewed.

108 6.1 Review of Linear Regression and Design of Experiments

6.1.1 Multiple Linear Regression

Multiple linear regression is a mathematical technique to predict the value of the response as a function of a number of predictors. For example, Equation 6.1 is a two-variable firstorder linear regression model: y = β 0 + β1 x1 + β 2 x2 + ε

6.1

where y represents the response, while x1 and x2 represent the independent variables. Independent variables are also usually called predictor variables or regressors. The term “linear” is used because the above equation is a linear function of the unknown coefficients β0, β1, and β2. ε represents random error in each observation. In general, the response

variable

y

may

be

related

to

k

regressor

variables.

Model

y = β 0 + β1 x1 + β 2 x2 + L + β k xk + ε is called a multiple linear regression model with k regressor variables. Models that are more complex in appearance may often still be analyzed by multiple linear regression techniques. For example, consider the two-variable model with interactions and second order terms: y = β 0 + β1 x1 + β 2 x2 + β11 x1 + β 22 x2 + β12 x1 x2 + ε 2

2

6.2

By defining x3 = x1 , x4 = x2 , x5 = x1 x2 , β 3 = β11 , β 4 = β 22 , and β 5 = β12 , the 2

2

model becomes: y = β 0 + β1 x1 + β 2 x2 + β 3 x3 + β 4 x4 + β 5 x5 + ε , which is again a general multiple linear regression model. The only difference here is that the regressors are no

109 longer independent. In general, any regression model that is linear in the unknown coefficients, β’s, is a linear regression model, regardless of the order of the predictors and the shape of the regression surface that it generates. The method of least square is typically used to estimate the unknown coefficients in a multiple linear regression model. Suppose that n>k observations on the response variable are available, say y1, y2, …, yn. Along with each observed response yn , there associates an observation on each regressor variable. Let xij denote the jth observation of variable xi. The data appear as the following table: y

X1

x2



xk

y1

x11

x12



x1k

y2

x21

x22



x2k











yn

xn1

xn2



xnk

The model can be written in matrix notation: Y = X ⋅ β + ε ⎡ y1 ⎤ ⎡ x11 ⎢y ⎥ ⎢x where Y = ⎢ 2 ⎥ , X = ⎢ 21 ⎢M⎥ ⎢ M ⎢ ⎥ ⎢ ⎣ yn ⎦ ⎣ x n1

x12 x 22 M xn2

K x1k ⎤ ⎡ β1 ⎤ ⎡ ε1 ⎤ ⎢β ⎥ ⎢ε ⎥ K x2k ⎥ ⎥ , β = ⎢ 2 ⎥ and ε = ⎢ 2 ⎥ M ⎥ ⎢M⎥ ⎢M⎥ ⎢ ⎥ ⎢ ⎥ ⎥ K x nk ⎦ ⎣β k ⎦ ⎣ε n ⎦

It is usually assumed that the error terms {ε1, ε2 , …, εn} in the model are uncorrelated random variables and satisfy E(εi)=0 and Var(εi)=σ2. Thus the covariance matrix of the error is Var (ε ) = σ 2 I n and the response variable Y has the same covariance matrix as the random errors: Var (Y ) = Var (ε ) = σ 2 I n . The problem then becomes one of finding the vector of least square estimators, b= βˆ , which minimizes

110 n

L = ∑ ε i2 = ε ′ε = ( y − Xβ )′( y − Xβ ) = y′y − β ′X ′y − y′Xβ + β ′X ′Xβ i =1

= y ′y − 2β ′X ′y + β ′X ′Xβ Since β ′X ′y is a scalar, and its transpose y ′Xβ is the same scalar. The least square estimators must satisfy: ∂L = −2 X ′y + 2 X ′Xb = 0 ∂β b which simplifies to X ′Xb = X ′y and b = ( X ′X ) −1 X ′y . The method of least squares produces an unbiased estimator of the coefficient β in the multiple linear regression model. Thus b is an unbiased estimator of β. The variance property of b is expressed by its covariance matrix: Var (b) = Var[( X ′X ) −1 X ′y ] = ( X ′X ) −1 X ′ ⋅ Var (Y ) ⋅ X ( X ′X ) −1 Since Var (Y ) = Var (ε ) = σ 2 I n , the following equation is obtained: Var (b) = ( X ′X ) −1σ 2

6.3

Equation 6.3 is of special importance. It shows that, although the variance of the random errors in the process, σ2, cannot be controlled, by carefully choosing X, or the experimental design, the variance-covariance matrix of the estimated coefficients, Var(b), can be controlled. This equation relates the accuracy of the estimated coefficients with the sampling scheme, or the design of experiments.

111 6.1.2 Design of Experiments and Computed-aided Design

In an experiment, one or more process variables are deliberately changed in order to observe the effect they have on the response variables. The statistical design of experiments (DOE) is an efficient procedure for planning experiments so that the data obtained can be analyzed to yield valid and objective conclusions. Experimental design was first used in agriculture. Many standard designs, such as Factorial Design, Central Composite Design (CCD), etc., have been developed for common experimental situations. These designs have assured degrees of precision, orthogonality, and other optimal properties that are important for the exploratory nature of most experiments. In some situations, however, standard designs are not appropriate or are impractical. These may include situations such as an irregular experimental region, unusual sample size requirement, or a nonstandard model (Myers, 1995). When such situations exist, computer-aided designs are a useful option. Under this approach, an experimental design is evaluated in terms of a design measure. Depending on the application, there are different design measures. The corresponding design optimality criteria are characterized by letters of the alphabet and as a result are often called alphabetic optimality criteria. The best known and most often used criterion is D optimality. Recall that Var (b) = ( X ' X ) −1σ 2 , thus matrix ( X ' X ) −1 contains variances and covariance of the regression coefficients. As a result, control of matrix ( X ' X ) −1 by design implies control of the variances and covariance of the coefficients. D-optimality is based on the notion that the experimental design should be chosen so as to maximize the

112 determinant of X ' X , i.e. | X ' X | . Geometrically, | X ' X | is inversely proportional to the

square of the volume of the confidence region of the regression coefficients. The volume of the confidence region is relevant because it reflects how well the set of coefficients are estimated. A small | X ' X | implies poor estimation of coefficients in the model. In general, a D-optimal design is one in which

| X'X | is maximized, where N is the NP

number of observations and P is the number of predictors in the model. For a given model and a fixed number of experiments, the D-optimal design is the one with maximal | X'X |. Since the optimality criterion of most computer-aided designs is based on some function of matrix X ' X , the “optimality” of a given design is model dependent. That is, the experimenter must specify a model for the design before the “optimality” design can be generated. The design generated by the computer algorithm is “optimal” only for that model. It will be shown in the following sections that the RP machine error model is a multi-response linear regression model and D-optimality criterion can be used to guide the design of the 3D artifact.

6.2 Linear Regression Machine Error Model

6.2.1 Single Response Model

Recall that the SLA 250 machine has the following machine error model:

113 ∆X = X p − x = [δ x (x ) + δ x ( y ) − δ x (z )] − y[ε z ( x ) − ε z ( z )] + z ⋅ ε y ( z ) + τ x

[

]

∆Y = Y p − y = δ y ( x ) + δ y ( y ) − δ y ( z ) − xε z ( z ) − z ⋅ ε x ( z ) + τ y ∆Z = Z p + z = [δ z ( x ) + δ z ( y ) − δ z ( z )] + xε y ( z ) + y[ε x ( x ) − ε x ( z )] + τ z

Using 3rd order polynomials to approximate each parametric function, for example: δ x ( x) = xtx1 ⋅ x + xtx2 ⋅ (1.5 x 2 ) + xtx3 ⋅ (2.5 x 3 − 1.5 x) , each response can be expanded into a linear regression model. The expanded model of ∆X is: 3 ⎞ ⎛1 ∆X = xtx1 ⋅ x + xtx2 ⋅ ( x 2 ) + xtx3 ⋅ ⎜ (5 x 3 − 3x) ⎟ 2 ⎠ ⎝2 ⎡ 3 ⎞⎤ ⎛1 + ⎢ ytx1 ⋅ y + ytx2 ⋅ ( y 2 ) + ytx3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − ⎢ ztx1 ⋅ z + ztx 2 ⋅ ( z 2 ) + ztx3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − y ⋅ ⎢ xrz1 ⋅ x + xrz 2 ⋅ ( x 2 ) + xrz3 ⋅ ⎜ (5 x 3 − 3x) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣

6.4

⎡ 3 ⎞⎤ ⎛1 + y ⋅ ⎢ zrz1 ⋅ z + zrz 2 ⋅ ( z 2 ) + zrz 3 ⋅ ⎜ (5 z 3 − 3 z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 + z ⋅ ⎢ zry1 ⋅ z + zry 2 ⋅ ( z 2 ) + zry3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ + τ x 2 ⎠⎦ ⎝2 ⎣

⎡ 3 ⎞⎤ ⎛1 In this model, the first two terms in z ⋅ ⎢ zry1 ⋅ z + zry2 ⋅ ( z 2 ) + zry3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ are 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 linearly dependent with ⎢ ztx1 ⋅ z + ztx2 ⋅ ( z 2 ) + ztx3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ . Thus, they are 2 ⎠⎦ ⎝2 ⎣

removed

from

the

model,

and

their

effects

are

instead

included

in

114 ⎡ 3 2 ⎞⎤ ⎛1 3 ⎢ ztx1 ⋅ z + ztx2 ⋅ ( 2 z ) + ztx3 ⋅ ⎜ 2 (5 z − 3z ) ⎟⎥ . As a result, there are 16 terms in the ∆X ⎠⎦ ⎝ ⎣

model. Assume that n observations are made, the equation system can be written in the standard matrix format: Y = X ⋅ β + ε , where ⎡ X 1,1 ⎡Y1 ⎤ ⎡ ∆X 1 ⎤ ⎢X ⎢Y ⎥ ⎢ ∆X ⎥ 2 ,1 2⎥ 2⎥ ⎢ ⎢ , X =⎢ Y= = ⎢ M ⎢M⎥ ⎢ M ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎣Y3 ⎦ ⎣∆X n ⎦ ⎣ X n ,1

X 1, 2 X 2, 2 M X n,2

X 1,k ⎤ K X 2,k ⎥⎥ , M ⎥ ⎥ K X n ,k ⎦ K

⎡ β1 ⎤ ⎢β ⎥ β= ⎢ 2⎥ ⎢M⎥ ⎢ ⎥ ⎣β k ⎦

⎡ ε1 ⎤ ⎢ε ⎥ and ε = ⎢ 2 ⎥ (k = 16) ⎢M⎥ ⎢ ⎥ ⎣ε n ⎦

X and β have the following elements. X i ,1 = xi

X i , 7 = − zi

X i , 2 = 1.5 ⋅ xi

2

X i ,13 = yi zi

X i ,8 = −1.5 ⋅ zi

3

2

X i ,14 = 1.5 ⋅ yi ⋅ zi

3

2

3

X i ,3 = (5 xi − 3xi ) / 2

X i ,9 = −(5 zi − 3zi ) / 2

X i ,15 = yi ⋅ (5 zi − 3zi ) / 2

X i , 4 = yi

X i ,10 = − yi xi

X i ,16 = (5 zi − 3 zi ) / 2

X i ,5 = 1.5 ⋅ yi

2

X i ,11 = −1.5 ⋅ yi ⋅ xi

3

X i ,6 = (5 yi − 3 yi ) / 2

β1 = xtx1 β 2 = xtx 2 β 3 = xtx3

4

β 4 = ytx1 β 5 = ytx2 β 6 = ytx3

2

2

3

X i ,12 = − yi ⋅ (5 xi − 3xi ) / 2

β 7 = ztx1 β 8 = ztx2 β 9 = ztx3

β10 = xrz1 β11 = xrz 2 β12 = xrz3

Similarly, the model of ∆Y can be expanded as:

β13 = zrz1 β14 = zrz 2 β15 = zrz3

β16 = zry3

115 3 ⎞ ⎛1 ∆Y = xty1 ⋅ x + xty 2 ⋅ ( x 2 ) + xty3 ⋅ ⎜ (5 x 3 − 3x) ⎟ 2 ⎠ ⎝2 ⎡ 3 ⎞⎤ ⎛1 + ⎢ yty1 ⋅ y + yty 2 ⋅ ( y 2 ) + yty3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − ⎢ zty1 ⋅ z + zty 2 ⋅ ( z 2 ) + zty3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣

6.5

⎡ 3 ⎞⎤ ⎛1 − x ⋅ ⎢ zrz1 ⋅ z + zrz 2 ⋅ ( z 2 ) + zrz3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − z ⋅ ⎢ zrx1 ⋅ z + zrx2 ⋅ ( z 2 ) + zrx3 ⋅ ⎜ (5 z 3 − 3 z ) ⎟⎥ + τ y 2 ⎠⎦ ⎝2 ⎣

The matrix format with n observations is: Y = X ⋅ β + ε , where ⎡ X 1,1 ⎡Y1 ⎤ ⎡ ∆Y1 ⎤ ⎢X ⎢Y ⎥ ⎢∆Y ⎥ 2 ,1 2⎥ 2⎥ ⎢ ⎢ , X =⎢ = Y= ⎢ M ⎢M⎥ ⎢ M ⎥ ⎢ ⎢ ⎥ ⎢ ⎥ ⎣Y3 ⎦ ⎣∆Yn ⎦ ⎣ X n ,1

X 1, 2 X 2, 2 M X n, 2

X 1,k ⎤ ⎡ β1 ⎤ ⎡ ε1 ⎤ ⎥ ⎢β ⎥ ⎢ε ⎥ K X 2 ,k ⎥ , β = ⎢ 2 ⎥ and ε = ⎢ 2 ⎥ (k = 13) M ⎥ ⎢M⎥ ⎢M⎥ ⎥ ⎢ ⎥ ⎢ ⎥ K X n ,k ⎦ ⎣β k ⎦ ⎣ε n ⎦ K

X and β have the following elements. X i ,1 = xi

X i , 7 = − zi

X i , 2 = 1.5 ⋅ xi

2

4

X i ,8 = −1.5 ⋅ zi

3

2

3

X i ,3 = (5 xi − 3xi ) / 2

X i ,9 = −(5 zi − 3zi ) / 2

X i , 4 = yi

X i ,10 = − xi z i

X i ,5 = 1.5 ⋅ yi

2

X i ,11 = −1.5 ⋅ xi ⋅ z i

3

X i ,6 = (5 yi − 3 yi ) / 2

β1 = xty1 β 2 = xty 2 β 3 = xty3

β 4 = yty1 β 5 = yty 2 β 6 = yty3

2

X i ,13 = −(5 z i − 3z i ) / 2

2

3

X i ,12 = − xi ⋅ (5 zi − 3 zi ) / 2

β 7 = zty1 β 8 = zty 2 β 9 = zty3

β10 = zrz1 β11 = zrz 2 β12 = zrz 3

β13 = zrx3

116 The expanded model of ∆Z is: 3 ⎞ ⎛1 ∆Z = xtz1 ⋅ x + xtz 2 ⋅ ( x 2 ) + xtz 3 ⋅ ⎜ (5 x 3 − 3x) ⎟ 2 ⎠ ⎝2 ⎡ 3 ⎞⎤ ⎛1 + ⎢ ytz1 ⋅ y + ytz2 ⋅ ( y 2 ) + ytz3 ⋅ ⎜ (5 y 3 − 3 y ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − ⎢ ztz1 ⋅ z + ztz 2 ⋅ ( z 2 ) + ztz3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ 6.6

⎡ 3 ⎞⎤ ⎛1 + x ⋅ ⎢ zry1 ⋅ z + zry2 ⋅ ( z 2 ) + zry3 ⋅ ⎜ (5 z 3 − 3z ) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 + y ⋅ ⎢ xrx1 ⋅ x + xrx2 ⋅ ( x 2 ) + xrx3 ⋅ ⎜ (5 x 3 − 3x) ⎟⎥ 2 ⎠⎦ ⎝2 ⎣ ⎡ 3 ⎞⎤ ⎛1 − y ⋅ ⎢ zrx1 ⋅ z + zrx2 ⋅ ( z 2 ) + zrx3 ⋅ ⎜ (5 z 3 − 3 z ) ⎟⎥ + τ z 2 ⎠⎦ ⎝2 ⎣

Its matrix format with n observation is: Y = X ⋅ β + ε , where ⎡ X 1,1 ⎡Y1 ⎤ ⎡ ∆Z1 ⎤ ⎢X ⎢Y ⎥ ⎢∆Z ⎥ 2 ,1 2⎥ 2⎥ ⎢ ⎢ , X =⎢ = Y= ⎢ M ⎢M⎥ ⎢ M ⎥ ⎢ ⎢ ⎥ ⎢ ⎥ ⎣Y3 ⎦ ⎣∆Z n ⎦ ⎣ X n ,1

X 1,k ⎤ ⎡ β1 ⎤ ⎡ ε1 ⎤ ⎥ ⎢β ⎥ ⎢ε ⎥ K X 2 ,k ⎥ , β = ⎢ 2 ⎥ and ε = ⎢ 2 ⎥ (k =18) M ⎥ ⎢M⎥ ⎢M⎥ ⎥ ⎢ ⎥ ⎢ ⎥ K X n ,k ⎦ ⎣β k ⎦ ⎣ε n ⎦ K

X 1, 2 X 2, 2 M X n, 2

X and β have the following elements. X i ,1 = xi

X i , 7 = − zi

X i , 2 = 1.5 ⋅ xi

2

3

X i ,13 = yi xi

X i ,8 = −1.5 ⋅ zi

2

X i ,14 = 1.5 ⋅ yi ⋅ xi

3

2

3

X i ,3 = (5 xi − 3xi ) / 2

X i ,9 = −(5 zi − 3zi ) / 2

X i ,15 = yi ⋅ (5 xi − 3 xi ) / 2

X i , 4 = yi

X i ,10 = xi z i

X i ,16 = − yi z i

X i ,5 = 1.5 ⋅ yi 3

2

X i ,6 = (5 yi − 3 yi ) / 2

X i ,11 = 1.5 ⋅ xi ⋅ z i 3

2

X i ,12 = xi ⋅ (5 z i − 3z i ) / 2

X i ,17 = −1.5 ⋅ yi ⋅ z i 3

2

X i ,18 = − yi ⋅ (5 z i − 3 z i ) / 2

117

β1 = xtz1 β 2 = xtz 2 β 3 = xtz3

β 4 = ytz1 β 5 = ytz 2 β 6 = ytz3

β 7 = ztz1 β 8 = ztz 2 β 9 = ztz 3

β10 = zry1 β11 = zry 2 β12 = zry3

β13 = xrx1 β14 = xrx2 β15 = xrx3

β16 = zrx1 β17 = zrx2 β18 = zrx3

6.2.2 Multi-response Model

As shown previously, each response ∆X, ∆Y, or ∆Z, is a multiple regression model which satisfies the assumptions on random errors. The entire model with three responses forms a multiple response regression problem. The three individual models can be combined into a linear multiple response model as follows: ⎡ Y11 ⎤ ⎡ ⎢Y ⎥ ⎢ ⎢ 21 ⎥ ⎢ ⎢ M ⎥ ⎢ ⎢ ⎥ ⎢ ⎢Yn1 ⎥ ⎢ ⎢Y12 ⎥ ⎢ ⎢ ⎥ ⎢ ⎢Y22 ⎥ ⎢ ⎢ M ⎥=⎢ ⎢ ⎥ ⎢ ⎢Yn 2 ⎥ ⎢ ⎢Y ⎥ ⎢ ⎢ 13 ⎥ ⎢ ⎢Y23 ⎥ ⎢ ⎢ ⎥ ⎢ ⎢ M ⎥ ⎢ ⎢⎣Yn 3 ⎥⎦ ⎢⎣

X1

X2

X3

⎤ ⎡ β 01 ⎤ ⎡ ε 11 ⎤ ⎥ ⎢ β ⎥ ⎢ε ⎥ ⎥ ⎢ 11 ⎥ ⎢ 21 ⎥ ⎥ ⎢ M ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ β p1 ,1 ⎥ ⎢ ε n1 ⎥ ⎥ ⎢ β 02 ⎥ ⎢ ε 12 ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⋅ ⎢ β12 ⎥ + ⎢ε 22 ⎥ ⎥ ⎢ M ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ β ⎢ ⎢ε n 2 ⎥ ⎥ p2 , 2 ⎥ ⎥ ⎢ β ⎥ ⎢ε ⎥ ⎥ ⎢ 03 ⎥ ⎢ 13 ⎥ ⎥ ⎢ β13 ⎥ ⎢ε 23 ⎥ ⎥ ⎢ M ⎥ ⎢ ⎥ ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥⎦ ⎢⎣ β p3 ,3 ⎥⎦ ⎢⎣ε n 3 ⎥⎦

6.7

To distinguish each response, a subscript is added to the matrix of each linear regression model. Hence, the model of the ith response can be written in vector form as: Yi = X i ⋅ β i + ε i

i = 1, 2, or 3

118 where Yi is an n×1 vector of observations on the ith response, Xi is an n× pi matrix of known functions of the independent variables, βi is a pi×1 vector of unknown coefficients, and εi is a vector of the random error associated with the ith response. The following assumptions are usually assumed about the random errors. E (ε i ) = 0 Var (ε i ) = σ ii I N

i = 1, 2, or 3

Cov(ε i , ε j ) = σ ij I N

i, j = 1, 2, or 3; and i ≠ j

6.8

Since εi (i = 1, 2, 3) are the random errors of different responses, they are not necessarily independent. In the general case, there will be covariance among them, i.e.,

σ ij ≠ 0 . In addition, the variance of each εi may not be equal to each other, i.e., σ ii ≠ σ jj if i ≠ j. This will complicate the equations used to estimate the coefficients and the equations used to define D-optimality (Khuri, 1987). Usually, the variances and covariance among random errors are not known during the design stage. However, in this study, since one artifact was already manufactured and a set of coefficients have been inferred from that artifact, the variance and covariance among the errors can be estimated using residuals. The residuals of each response were thus calculated for all sample points. MINITAB was used to compute the covariance matrix and to test the correlation between each pair of random errors. The covariance matrix Σ is:

119 ⎡σ 11 σ 12 σ 13 ⎤ ⎡ 0.1432 − 0.0498 0.0350 ⎤ ⎢ ⎥ −5 ⎢ Σ = ⎢σ 21 σ 22 σ 23 ⎥ = 1.0 × 10 ⎢− 0.0498 0.1454 − 0.0178⎥⎥ ⎢⎣σ 31 σ 32 σ 33 ⎥⎦ ⎢⎣ 0.0350 − 0.0178 0.1597 ⎥⎦

The P-values for correlation testing are: P-value

εx and εy

εx and εz

εy and εz

0.000

0.003

0.132

If P-value = 0.100 is chosen as the critical value, it can be concluded that εy and εz are uncorrelated, while εx and εy are correlated and εx and εz are also correlated. The equations

used

for

Var (Y ) = Var (ε ) = σ 2 I n

the

single

response

linear

regression

model,

such

as

and Var (b) = ( X ' X ) −1σ 2 , are no longer valid. Instead,

Var (ε ) = ∆ = ∑ ⊗ I N , where ⊗ is a symbol for the direct or Kronecker product of matrices (Khuri, 1987). By definition, the direct product of two matrices, A and B, of order n1 × n2 and m1 × m2 , respectively, is the n1m1 × n2 m2 matrix A⊗B, which is partitioned as [aijB], where aij is the (i,j)th element of the matrix A. Also the variancecovariance matrix of b is Var (b) = ( X ' ∆−1 X ) −1 , where ∆−1 = ∑ −1 ⊗ I N . For such a multi-response linear regression model, the D-optimal design is the one which maximizes X ′∆−1 X (Khuri, 1987).

120 6.3 D-optimal Design for 3D Artifact

6.3.1 Design Problem Definition

The coefficients in the machine error model were estimated using the error value observed at the top central point of each cylinder. Thus the distribution of those sampling points defined the matrix X and influenced the variance properties of the estimated coefficients. Chapter 4 discussed the constraints faced when designing the 3D artifact and why the current design was chosen. This 3D artifact helped us to demonstrate the concept of software error compensation for a rapid prototyping machine, but it is not necessarily an optimal design. D-optimal design seeks to minimize the volume of the confidence region of the estimated coefficients and thus results in a more accurate model. In this section, optimization of the design of the 3D artifact using D-optimality criterion will be discussed. The error model was clearly defined. Due to constraints on the size of the artifact and on the diameter of the cylinders, the number of observation points, or the number of cylinders, will be kept the same as 169. More specifically, the X and Y position of each cylinder will be kept the same; the design process is to choose the Z height of each cylinder so that X ′∆−1 X is maximized. In addition, the new design must satisfy the constraints on the height different of every pair of adjacent cylinders to avoid collision during measurement. As discussed in Chapter 4, the CMM probe needs to touch the top of each cylinder and two adjacent cylinders cannot have a height difference which is larger than the length of the probe. Otherwise, the probe will collide with the cylinders.

121 There are different algorithms to solve for D-optimal design. Several papers (De Aguiar (1995) and St. John (1975)) discussed Fedorov’s search algorithm. It starts from an initial design and tries to optimize the design by adding a better point from the candidate list and removing the worst point in the current design. If this algorithm is applied to the design of a 3D artifact, the points to be added and to be removed have to be at the same X and Y combination and the point to be added needs to satisfy the height constraints as stated above. Mathematical programs can also be defined to solve for the D-optimal design. The heights of the 169 cylinders are decision variables, which can be defined as discrete or continuous variables. The objective is to maximize X ′∆−1 X , which is a function of (x, y, z) coordinates of the cylinders. The special requirements of adjacent cylinder height difference form an additional set of constraints of the optimization problem.

6.3.2 Mathematical Programming

6.3.2.1 Problem Definition

In this study, the mathematical programming approach was chosen to solve for the D-optimal design. The mathematical programming problem is defined as follows: Decision Variables: zi—the height of each cylinder, where i = 1, 2, … , 169 is the index of each cylinder as defined in the following illustration if looking from above the artifact.

122 157

158

159

160

161

162

163

164

165

166

167

168

169

144

145

146

147

148

149

150

151

152

153

154

155

156

131

132

133

134

135

136

137

138

139

140

141

142

143

118

119

120

121

122

123

124

125

126

127

128

129

130

105

106

107

108

109

110

111

112

113

114

115

116

117

92

93

94

95

96

97

98

99

100

101

102

103

104

79

80

81

82

83

84

85

86

87

88

89

90

91

66

67

68

69

70

71

72

73

74

75

76

77

78

53

54

55

56

57

58

59

60

61

62

63

64

65

40

41

42

43

44

45

46

47

48

49

50

51

52

27

28

29

30

31

32

33

34

35

36

37

38

39

14

15

16

17

18

19

20

21

22

23

24

25

26

1

2

3

4

5

6

7

8

9

10

11

12

13

X –the design matrix.

Given data: The variance-covariance matrix of random errors Var (ε ) = ∆ = ∑ ⊗ I N , where ⎡σ 11 σ 12 σ 13 ⎤ ⎡ 0.1432 − 0.0498 0.0350 ⎤ ⎢ ⎥ −5 ⎢ Σ = ⎢σ 21 σ 22 σ 23 ⎥ = 1.0 × 10 ⎢− 0.0498 0.1454 − 0.0178⎥⎥ ⎣⎢σ 31 σ 32 σ 33 ⎦⎥ ⎣⎢ 0.0350 − 0.0178 0.1597 ⎦⎥

(xi, yi)—the x and y coordinates of each cylinder, where i = 1, 2, … , 169. Note that x, y, and z coordinates are normalized values. Each has a range of [-1, 1]. x = [-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1

-5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6 -5/6

y = [-1 -5/6 -4/6 -3/6 -2/6 -1/6

-4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6 -4/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6 -3/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6 -2/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6 -1/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

0 0 0 0 0 0 0 0 0 0 0 0 0

-1 -5/6 -4/6 -3/6 -2/6 -1/6

1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6 1/6

2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6 2/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6 3/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6 4/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6 5/6

1... 1... 1... 1... 1... 1... 1... 1... 1... 1... 1... 1... 1]

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-1 -5/6 -4/6 -3/6 -2/6 -1/6

-1 ... -5/6... -4/6... -3/6... -2/6... -1/6...

123 0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 1/6 2/6 3/6 4/6 5/6 1

0 ... 1/6... 2/6... 3/6... 4/6... 5/6... 1]

Objective function: Maximize | X ' ∆−1 X | Constraints: 1) Upper bound and lower bound of zi: − 1 ≤ z i ≤ 1 . 2) Represent the elements of matrix X in terms of xi, yi, and zi according to the multiresponse linear regression model defined previously: ⎡ Y11 ⎤ ⎡ ⎢Y ⎥ ⎢ ⎢ 21 ⎥ ⎢ ⎢ M ⎥ ⎢ ⎢ ⎥ ⎢ ⎢Yn1 ⎥ ⎢ ⎢Y12 ⎥ ⎢ ⎢ ⎥ ⎢ ⎢Y22 ⎥ ⎢ ⎢ M ⎥=⎢ ⎢ ⎥ ⎢ ⎢Yn 2 ⎥ ⎢ ⎢Y ⎥ ⎢ ⎢ 13 ⎥ ⎢ ⎢Y23 ⎥ ⎢ ⎢ ⎥ ⎢ ⎢ M ⎥ ⎢ ⎣⎢Yn 3 ⎥⎦ ⎢⎣

where X 507×47

X1

0

0

0

X2

0

0

0

X3

⎡( X 1 )169×16 = ⎢⎢ 0169×16 ⎢⎣ 0169×16

0169×13 ( X 2 )169×13 0169×13

⎤ ⎡ β 01 ⎤ ⎡ ε 11 ⎤ ⎥ ⎢ β ⎥ ⎢ε ⎥ ⎥ ⎢ 11 ⎥ ⎢ 21 ⎥ ⎥ ⎢ M ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ β p1 ,1 ⎥ ⎢ ε n1 ⎥ ⎥ ⎢ β 02 ⎥ ⎢ ε 12 ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⋅ ⎢ β12 ⎥ + ⎢ε 22 ⎥ ⎥ ⎢ M ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥ ⎥ ⎢ ⎥ ⎢ β p2 , 2 ⎥ ⎢ε n 2 ⎥ ⎥ ⎢ β ⎥ ⎢ε ⎥ ⎥ ⎢ 03 ⎥ ⎢ 13 ⎥ ⎥ ⎢ β13 ⎥ ⎢ε 23 ⎥ ⎥ ⎢ M ⎥ ⎢ ⎥ ⎥ ⎢ M ⎥ ⎥ ⎢ ⎥⎦ ⎢⎣ β p3 ,3 ⎥⎦ ⎢⎣ε n 3 ⎥⎦

0169×18 ⎤ 0169×18 ⎥⎥ ( X 3 )169×18 ⎥⎦ 507×47

The following tables list the elements of the design matrix X. (a) For the first 169 rows of the matrix, or i= 1∼169, they are: X i ,1 = xi X i , 2 = 1.5 ⋅ xi

X i , 7 = − zi 2

X i ,8 = −1.5 ⋅ zi

X i ,13 = yi zi 2

X i ,14 = 1.5 ⋅ yi ⋅ zi

2

124 3

3

3

X i ,3 = (5 xi − 3xi ) / 2

X i ,9 = −(5 zi − 3zi ) / 2

X i ,15 = yi ⋅ (5 zi − 3zi ) / 2

X i , 4 = yi

X i ,10 = − yi xi

X i ,16 = (5 zi − 3 zi ) / 2

X i ,5 = 1.5 ⋅ yi

2

4

X i ,11 = −1.5 ⋅ yi ⋅ xi

3

X i ,6 = (5 yi − 3 yi ) / 2

2

X i , j = 0 j = 17,18,...,47

2

3

X i ,12 = − yi ⋅ (5 xi − 3xi ) / 2

(b) For the middle 169 rows of the matrix, or i= 170∼338, they are: X i , j = 0 j = 1,2,...,16

X i , 22 = (5 yi − 3 yi ) / 2

X i , 28 = − xi ⋅ (5 z i − 3z i ) / 2

X i ,17 = xi

X i , 23 = − z i

X i , 29 = −(5 z i − 3 z i ) / 2

X i ,18 = 1.5 ⋅ xi

2

3

3

4

X i , 24 = −1.5 ⋅ z i 3

X i , 25 = −(5 z i − 3z i ) / 2

X i , 20 = yi

X i , 26 = − xi z i 2

2

X i , j = 0 j = 30,31,...,47

2

X i ,19 = (5 xi − 3xi ) / 2 X i , 21 = 1.5 ⋅ yi

3

X i , 27 = −1.5 ⋅ xi ⋅ z i

2

(c) For the last 169 rows of the matrix, or i= 339∼507, they are: X i , j = 0 j = 1,2,...,29

X i ,36 = − z i

X i ,30 = xi

X i ,37 = −1.5 ⋅ z i

X i , 43 = 1.5 ⋅ yi ⋅ xi 2

2

3

X i , 44 = yi ⋅ (5 xi − 3xi ) / 2

X i ,38 = −(5 z i − 3z i ) / 2

X i , 45 = − yi z i

X i ,32 = (5 xi − 3xi ) / 2

X i ,39 = xi z i

X i , 46 = −1.5 ⋅ yi ⋅ z i

X i ,33 = yi

X i , 40 = 1.5 ⋅ xi ⋅ z i

X i ,31 = 1.5 ⋅ xi

2

3

X i ,34 = 1.5 ⋅ yi

2

3

X i ,35 = (5 yi − 3 yi ) / 2

3

2

2

3

X i , 47 = − yi ⋅ (5 z i − 3z i ) / 2

3

X i , 41 = xi ⋅ (5 z i − 3z i ) / 2 X i , 42 = yi xi

3) Constraints on the height differences of adjacent cylinders: Due to the probe length constraints, any pair of adjacent cylinders cannot have a height difference which is larger than h=1.25 inch. These constraints are listed for all the cylinders as follows: Cylinder Index i = 1: i = 13:

Constraints

z1 − z 2 < h

z1 − z14 < h

z1 − z15 < h

z13 − z12 < h

z13 − z 25 < h

z13 − z 26 < h

125 i = 157:

z157 − z144 < h

z157 − z145 < h

z157 − z158 < h

i = 169:

z169 − z155 < h

z169 − z156 < h

z169 − z168 < h

i = 2∼12:

z i − z i −1 < h

z i − z i +1 < h

z i − z i +12 < h

z i − z i +13 < h

z i − z i +14 < h

i = 158∼168:

z i − z i −14 < h

z i − z i −13 < h

z i − z i −12 < h

z i − z i −1 < h

z i − z i +1 < h

i = 13j+1 (j = 1∼11): i = 13j (j = 2∼12):

z i − z i −13 < h

z i − z i −12 < h

z i − z i +1 < h

z i − z i +13 < h

z i − z i +14 < h

z i − z i −14 < h

z i − z i −13 < h

z i − z i −1 < h

z i − z i +12 < h

z i − z i +13 < h

z i − z i −14 < h

z i − z i −13 < h

z i − z i −12 < h

z i − z i −1 < h

z i − z i +1 < h

z i − z i +12 < h

z i − z i +13 < h

z i − z i +14 < h

All other i

6.3.2.2 Optimization Result

MATLAB optimization toolbox was used to solve this problem. The programs are attached in Appendix B for reference. When solving the problem, an initial solution needed to be provided. As the first experiment, the original artifact design was used as the initial solution z0. z0 = [-1 -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 ... -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 ... -2/6 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 ... 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 ... 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 ... 4/6 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 ... 1 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 ... 5/6 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 ... 3/6 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 5/6 ... 1/6 -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 ... -1/6 -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 1/6 ... -3/6 -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 ... -5/6 -1 -4/6 -2/6 0 2/6 4/6 1 5/6 3/6 1/6 -1/6 -3/6];

The program converged to the following solution. z =

126 -1.000 -1.000 -1.000 -1.000

0.250 -0.250

1.000

1.000

0.603 -0.532 -0.516 0.250 -0.570

0.250 -1.000

0.250 -1.000 -0.563

0.250 -0.250

1.000

1.000

1.000

0.250 -0.250

0.250

0.615

1.000

1.000

1.000

0.626 -0.250 -1.000 -1.000 -1.000

1.000 -0.250

1.000

1.000

0.613

0.613 -0.250 -0.624 -1.000 -1.000

1.000 -0.250

1.000

0.613 -0.637 -0.637 -1.000 -1.000

0.616 -0.250 -0.637 -1.000 -1.000 -1.000 -0.250

1.000

1.000 -0.250 -0.250

1.000

1.000

0.617

1.000

1.000

1.000

0.617 -0.633 -0.634 -0.708 -1.000 -1.000 -1.000

1.000

1.000

0.626 -0.250 -0.633 -1.000 -1.000 -1.000 -1.000 -1.000

1.000

0.250 -1.000 -1.000 0.250

0.250

0.250

0.250 -0.250

1.000

1.000

1.000

0.250

1.000

1.000

0.250

1.000

1.000

1.000 -0.250 -0.624 -1.000 -1.000 -1.000 -0.636 -0.250

0.250 -0.250

1.000

1.000

1.000

1.000 -0.250 -1.000 -1.000 -0.636 -0.636 -0.636

0.614

1.000

1.000

1.000

1.000

0.250

0.250 -0.250 -1.000

0.614

0.630

0.606

0.250 -0.250 0.250 -1.000

0.250 -1.000 -1.000 -1.000 -1.000

0.250

0.250

0.614

0.250 -0.250

1.000

1.000 -0.250

0.609 -0.577 -0.550

1.000

1.000

0.566 -0.533 -1.000 -1.000 -1.000

0.250 -0.250

1.000

0.614

1.000

The value of | X ' ∆−1 X | was increased from 4.419×10-205 to 5.579×10-201. To quantify this improvement, relative D-efficiency was calculated between these two designs:

Deff

⎛ X ' ∆−1 X ⎜ original =⎜ −1 ⎜ X '∆ X D − optimal ⎝

1/ p

⎞ ⎟ ⎟⎟ ⎠

⎛ 4.419 × 10 −205 ⎞ ⎟ = ⎜⎜ − 201 ⎟ ⎝ 5.579 × 10 ⎠

1 / 42

= 0.799

The relative D-efficiency measure states that the original design is only 79.9% as efficient as the improved design. This means that statistically the original design has to be repeated by 1.25 times (=1/0.799) in order to achieve as small a confidence region for the regression parameters as the improved design. Both artifact designs were modeled using Pro/E and are illustrated in Figure 6-1 and Figure 6-2. The two designs look different, but in terms of the peaks and valleys distribution of the cylinders, they still share some similarity. Other initial solutions were

127 also tested. It was found that the optimal solution highly depends on the initial solution and is thus only a local optimum. To find the best design, global optimization techniques need to be employed.

Figure 6-1: Original Design

Figure 6-2: Optimized Design

128 6.3.3 Global Optimization

There are different techniques to search for the global optimum or an approximate global optimum. In this research, two techniques were used. First, the Latin Hypercube Sampling (LHS) method was employed to choose and test a large number of initial points for comparison. Then, a Simulated Annealing (SA) algorithm was used to search for a global optimum by overcoming local optimality.

6.3.3.1 Latin Hypercube Sampling

One approach to obtain a global optimum is to solve the optimization problem with a large number of different initial solutions and to approximate the global optimum using the best result among them. Since each optimization can take up to an hour, great care has to be given to the choice of each initial solution. Studies have been done on similar problems, for example, selecting values of input variables in the analysis of output from a complex computer code. The conventional sampling method is random sampling, which randomly selects each initial solution independently and evaluates the output for each sample. In this study, random sampling means to randomly choose the heights of the 169 cylinders when generating each initial solution and any two initial solutions are independent. An alternative sampling scheme proposed by researchers is Latin Hypercube Sampling (LHS). If the problem has k decision variables x1, …, xk and it is decided to run n experiments, LHS selects n different initial solutions in the following manner. The range of each decision variable is divided into n non-overlapping intervals on the basis of

129 equal probability. One value from each interval is selected randomly. The n values obtained for x1 are paired in a random manner with the n values of x2. These n pairs are then combined in a random manner with the n values of x3 to form n triplets, and so on, until n k-tuplets are formed. These n combinations of k variables are the initial solutions used for the n experiments. Compared with random sampling, LHS was shown to provide a better estimation of the output (McKay (1979)). The LHS method was used to generate 100 initial solutions. The decision variables were the heights of all the cylinders z1, z2, …, z169. The range of each height was thus divided into 100 intervals. The 100 values of z1 were paired randomly with the 100 values of z2, and the 100 pairs were combined randomly with the 100 values of z3, and so on. The optimization problem was then solved 100 times using each combination. All the solutions were compared. The best design was still the one obtained using the original artifact design as initial solution. Although a little disappointing, it showed that, in some sense, the original design is a good one. The problem with this method is that only a local optimum is obtained and randomly generated initial solutions usually cannot provide a good starting point. Testing more initial solutions cannot provide us with a better solution. Other global optimization techniques have to be tested.

6.3.3.2 Simulated Annealing

Simulated Annealing (SA) is a stochastic approach which endeavors to overcome local optimality by accepting bad solutions with a definite probability. This algorithm is

130 based on the analogy between the simulation of the annealing of metals and the problem of solving large combinatorial optimization problems (Van Laarhoven (1987)). In condensed matter physics, annealing denotes a physical process in which a metal is heated to a very high temperature at which all particles of the metal randomly arrange themselves in the liquid phase, followed by cooling through slowly lowering the temperature. In this way, all particles arrange themselves in the low energy ground state of a corresponding lattice, provide the maximum temperature is sufficiently high and the cooling is carried out sufficiently slowly. A Monte Carlo method was used to simulate the evolution to thermal equilibrium of a solid for a fixed value of temperature T. Given the current state of the metal, characterized by the positions of its particles, a small, randomly generated, perturbation is applied by a small displacement of a randomly chosen particle. If the change in energy,

∆E, from the current state to the slightly perturbed one is negative, i.e., if the perturbation results in a lower energy level, then the process is continued with the new state. If ∆E≥0, then the probability of acceptance of the perturbed state is given by exp(−

∆E ) , where k BT

kB is the Boltzmann constant. This acceptance rule for new states is derived according to Botlzmann distribution of the energy levels. Following this criterion, the system eventually evolves into thermal equilibrium. This process is called the Metropolis algorithm. This algorithm can also be used to generate sequence of configurations of a combinatorial optimization problem. A combinatorial optimization problem can be defined as follows:

131 Given a finite configuration space Π = {x | x = ( x1 , x 2 ,..., x m )} where m is called the dimension of this configuration space, and a cost function C : Π → R , which assigns a real number to each configuration, the problem is to find an optimal configuration

x * ∈ Π , such that for all y ∈ Π , C ( x * ) ≤ C ( y ) . When applying simulated annealing to this optimization problem, the configurations assume the role of the states of a metal while the cost function C takes the role of energy. Usually, there is a control parameter Ti defined, which corresponds to temperature in the physical annealing process and defines the probability of accepting an increased cost function. The simulated annealing algorithm can now be viewed as a sequence of Metropolis algorithms evaluated at a sequence of decreasing value of the control parameter T. Start with an initial solution or configuration at, say, x, where the cost is denoted by Cx. A neighbor y of this initial solution is generated and its cost is Cy. If ∆C xy = C y − C x < 0 , the current solution is replaced by its neighbor y. If ∆C xy = C y − C x > 0 , y will still be accepted with a certain probability f(∆Cxy, T). In simulated annealing, this probability is called the acceptance function. A random number is then drawn from the uniform distribution (0, 1) and compared with the value of the acceptance function. If this value is greater than the random number, the bad move is accepted, otherwise it is rejected. At each temperature Ti, this process is repeated until no better solution is found after a prescribed number of trials. Then Ti is reduced at a given rate until no better solution can be found. The pseudo-code of simulated annealing is as following:

132 -------------------------------------------------------------------------------------------------Begin Select an initial solution x; Select an initial temperature or control parameter T=T0; Select the number of perturbations before temperature reduction I; Select reduction factor for the temperature R (0 n_max_group) THEN n_max_group = n_pts_group(i) END IF END DO print *, n_max_group ALLOCATE (level(nlevel,n_max_group))

165 !-------------------------------------------------------------------! The following section save the indices of all facets which belong ! to one level into an array level(i,j). ! level(i,j)=35 means that #35 facet in the input file is the #j ! facet of level i. ! j is the sequence of the facet in the level, meaning nothing else. !-------------------------------------------------------------------DO j=1, nlevel index_k(j)=0 END DO DO i=1, nfacet IF (group(i) == 0) THEN ELSE DO j=1, nlevel IF (group(i) == j) THEN index_k(j) = index_k(j) + 1 level(j, index_k(j)) = i ELSE END IF END DO END IF END DO !-------------------------------------------------------------------! Further divide each level into disjoint surfaces !-------------------------------------------------------------------! ALLOCATE (n_pts_surface(nlevel,n_max_group)) ! ALLOCATE (surface(nlevel,n_max_group,n_max_group)) ! The above allocation is too big. ! Thus, limit the maximum surface in one group to 50. !-------------------------------------------------------------------ALLOCATE (n_pts_surface(nlevel,50)) ALLOCATE (surface(nlevel,50,n_max_group)) ALLOCATE (matchstatus(nlevel,n_max_group)) ALLOCATE (newmatch(n_max_group),nextmatch(n_max_group)) DO i=1, nlevel DO j=1, n_max_group matchstatus(i,j) = 0 END DO END DO DO i=1, nlevel unmatched = n_pts_group(i) nsurface(i) = 1 n_pts_surface(i,1) = 1 surface(i,1,1) = level(i,1) matchstatus(i,1) = 1 unmatched = unmatched - 1 n_newmatch = 1 newmatch(1) = level(i,1)

& &

DO WHILE (unmatched > 0) n_nextmatch = 0 DO k=1,n_newmatch DO j=2, n_pts_group(i) IF (matchstatus(i,j)==1) THEN ELSE commonpoint = 0 DO m=1, 3 DO n=1, 3 deltax=point_in(level(i,j),n,1)- & point_in(newmatch(k),m,1) deltay=point_in(level(i,j),n,2)- & point_in(newmatch(k),m,2)

166 deltaz=point_in(level(i,j),n,3)- & point_in(newmatch(k),m,3) distance=deltax**2+deltay**2+deltaz**2 IF (distance 0) THEN n_newmatch = n_nextmatch DO m=1, n_newmatch newmatch(m) = nextmatch(m) END DO ELSE nsurface(i) = nsurface(i) + 1 pts_found = 0 m = 0 DO WHILE ((pts_found == 0) .AND. (m max_z(i,j)) THEN max_z(i,j) = point_out(m,n,3) ELSE IF (point_out(m,n,3)