Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

Spline interpolation and contour error pre-compensation for 5-axis machining Alexander, Yuen 2013

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
24-ubc_2013_fall_yuen_alexander.pdf [ 12.01MB ]
Metadata
JSON: 24-1.0073966.json
JSON-LD: 24-1.0073966-ld.json
RDF/XML (Pretty): 24-1.0073966-rdf.xml
RDF/JSON: 24-1.0073966-rdf.json
Turtle: 24-1.0073966-turtle.txt
N-Triples: 24-1.0073966-rdf-ntriples.txt
Original Record: 24-1.0073966-source.json
Full Text
24-1.0073966-fulltext.txt
Citation
24-1.0073966.ris

Full Text

SPLINE INTERPOLATION AND CONTOUR ERROR PRE-COMPENSATION FOR 5-AXIS MACHINING by Alexander Yuen  B.A.Sc., The University of British Columbia, 2011  A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF APPLIED SCIENCE in The Faculty of Graduate Studies (Mechanical Engineering)  THE UNIVERSITY OF BRITISH COLUMBIA (Vancouver) July 2013 c Alexander Yuen 2013 ⃝  Abstract This thesis presents experimentally verified smooth spline interpolation and contour error precompensation algorithms developed for 5-axis machine tools. In the smooth spline interpolation algorithm, the cutter location data from the computer-aided manufacturing system is first fitted independently to decouple the relative changes in position and orientation. The tool tip positions are fitted to a quintic B-spline, achieving geometric jerk continuity. Next, the tooltip orientations are fitted to another quintic B-spline in spherical coordinates, achieving geometric jerk continuity and feasible orientations at all points of the spline. The nonlinear relationship between spline parameters and displacement are approximated with 9th order and seventh order feed correction splines for position and orientation, respectively. The 9th order feed correction spline is fit adaptively to minimize fitting error while preserving C3 continuity. The seventh order feed correction spline is optimized to minimize jerk while preserving C3 continuity as well. In the contour error pre-compensation algorithm, the position commands generated in the smooth spline interpolation algorithm, are first fitted to piecewise quintic splines while respecting velocity, acceleration and jerk continuity at the spline joints. The transfer function of each servo drive is kept linear by compensating the disturbance effect of friction with a feed-forward block. Using the analytically represented 5-axis, splined tool path, splined tracking errors and kinematic model of the five-axis machine tool, contouring errors are predicted ahead of axis control loops. The contouring errors are decoupled into three linear and two rotary drives, and the position commands are modified before they are sent to servo drives for execution. The methods developed in this thesis have been evaluated on a 5-axis machining center with a tilting-table configuration, and are directly applicable to other 5-axis kinematic configurations ii  Abstract such as spindle-tilting or hybrid configurations. The experiments show improvements in fitting accuracy, reduction in vibrations, reduction in tracking errors, and significant reductions in contour error for five-axis tool paths.  iii  Preface Chapter 3. A version of this material has been published in the International Journal of Machine Tools and Manufacture [Yuen A, Zhang K, Altintas Y. Smooth trajectory generation for five-axis machine tools. International Journal of Machine Tools and Manufacture doi: 10.1016/j.ijmachtools.2013.04.002]. I was the lead investigator, responsible for the major development of the algorithms, experiment design, data collection and analysis, as well as manuscript composition. Zhang K was involved in the early development of the algorithms and contributed to the manuscript edits. Altintas Y was the supervisory author on this project and was involved throughout the project in concept formation and manuscript composition Chapter 4. A version of this material has been accepted by the International Journal of Machine Tools and Manufacture [Zhang K, Yuen A, Altintas Y. Pre-Compensation of Contour Errors in Five-Axis CNC Machine Tools. International Journal of Machine Tools and Manufacture]. Zhang K was the lead investigator, responsible for the major development of the algorithms, analysis, and manuscript composition. In this work, I was involved in the early development of the algorithms, experiment design, data collection, and analysis. Furthermore, I contributed a major portion to the manuscript revision. Altintas Y was the supervisory author on this project and was involved throughout the project in concept formation and manuscript composition Chapter 5. The results found in this chapter were previously published in the above two mentioned works. Modifications include a more detailed analysis of the results. All figures and tables found in this thesis are used with permission from applicable sources.  iv  Table of Contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  ii  Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  iv  Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  v  Abstract  List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  ix  Nomenclature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1  2 Literature Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7  2.1  Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7  2.2  Three-Axis Spline Interpolation Techniques . . . . . . . . . . . . . . . . . . .  8  2.3  Five-Axis Spline Interpolation Techniques  2.4  Five-Axis Spline Contour Error Pre-compensation  2.5  Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19  . . . . . . . . . . . . . . . . . . . 12 . . . . . . . . . . . . . . . 15  3 Spline Parametrization and Interpolation for 5-Axis Machines . . . . . . . . . . 20 3.1  Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 v  Table of Contents 3.2  B-Spline Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22  3.3  Decoupled B-spline Polynomial Representation . . . . . . . . . . . . . . . . . 28  3.4  C3 Tool Tip Position Spline Generation . . . . . . . . . . . . . . . . . . . . . 31  3.5  3.4.1  Parametric Position Spline Fitting . . . . . . . . . . . . . . . . . . . . 31  3.4.2  Feed Correction Polynomial . . . . . . . . . . . . . . . . . . . . . . . 32  C3 Tool Orientation Spline Generation . . . . . . . . . . . . . . . . . . . . . . 40 3.5.1  Parametric Orientation Spline . . . . . . . . . . . . . . . . . . . . . . 40  3.5.2  Orientation Spline Reparametrization . . . . . . . . . . . . . . . . . . 43 3.5.2.1  3.6  Windowing for a High Number of Data  . . . . . . . . . . . 47  Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50  4 Contour Error Pre-compensation . . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.1  Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51  4.2  Definition of Position and Orientation Contour Errors . . . . . . . . . . . . . . 52  4.3  Tracking Error Prediction  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54  4.3.1  Fitting a Quintic Time Spline to Axis Position Commands . . . . . . . 57  4.3.2  Analytical Solution of Tracking Error . . . . . . . . . . . . . . . . . . 63  4.4  Prediction of Contour Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 66  4.5  Compensation of Contour Errors . . . . . . . . . . . . . . . . . . . . . . . . . 69  4.6  Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74  5 Simulations and Experiments  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76  5.1  Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76  5.2  Experimental Test Bed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76  5.3  Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78  vi  Table of Contents  5.4  5.5  5.3.1  Controller Design  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78  5.3.2  Simulation and Experimental Results . . . . . . . . . . . . . . . . . . 79  Simulations and Experiments for 5-Axis Contour Error Pre-compensation . . . 87 5.4.1  Controller Design  . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87  5.4.2  Simulation and Experimental Results . . . . . . . . . . . . . . . . . . 89  Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97  6 Conclusions  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98  6.1  Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98  6.2  Future Research Directions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99  Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101  vii  List of Tables  5.1  Plant parameters for Fadal VMC 2216 . . . . . . . . . . . . . . . . . . . . . . 77  5.2  PID control parameters for 5-Axis spline parameterization and interpolation tests 79  5.3  Comparison of max./min. jerk values for test tool path at constant feed segment 86  5.4  Percentage tracking error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86  5.5  PID control parameters for 5-Axis contour error pre-compensation tests . . . . 88  viii  List of Figures  1.1  Geometric deviations in position and orientation for a typical 5-axis machine tool  1.2  Overview of the work in this thesis, starting from the CAD/CAM system to the  2  generated reference commands. The dashed boxes highlight the main contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.3  5  Overview of the main contributions in this thesis. Figure a) shows the basic overview of the spline interpolation algorithm developed. Figure b) shows the basic overview of the contour error pre-compensation algorithm developed. . .  6  2.1  Basic methodology of the spline fitting process . . . . . . . . . . . . . . . . .  8  2.2  Discrepancy between geometric parameter (u) and actual arc length (s) . . . .  9  2.3  Basic methodology of the 5-axis spline fitting process . . . . . . . . . . . . . . 13  2.4  Approaches to reduce geometric deviations in a multi-axis machine . . . . . . 16  3.1  Use of geometrically smooth splines to interpolate CAM data, and the resulting improvement in feed profiling . . . . . . . . . . . . . . . . . . . . . . . . . . 21  3.2  Overview of proposed trajectory generation scheme. . . . . . . . . . . . . . . 23  3.3  B-spline curve representation. . . . . . . . . . . . . . . . . . . . . . . . . . . 26  3.4  Visualization of basis functions and the first derivative of basis functions over the parametric interval [0,1] . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27  3.5  Decoupled representation for a 5-axis toolpath . . . . . . . . . . . . . . . . . . 29  3.6  Sequence of functions for reparametrization . . . . . . . . . . . . . . . . . . . 30  3.7  Different methods of interpolating along a given spline toolpath . . . . . . . . 33 ix  List of Figures 3.8  Adaption results of the feed correction polynomial fitting algorithm . . . . . . 39  3.9  Mappings between spherical coordinates and (θ, ϕ) plane.  . . . . . . . . . . . 41  3.10 7th order B´ezier spline and its control coefficients fitted to (sk , w¯k ) data. . . . . 44 3.11 Comparison of w(s) with initially guessed control points and converged control points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.12 Comparison of reference jerks with w(s) using initially guessed control points and w(s) using converged control points . . . . . . . . . . . . . . . . . . . . . 48 3.13 Windowing scheme for generation of Orientation Reparameterization Spline . . 49 4.1  Tool position and orientation contour errors . . . . . . . . . . . . . . . . . . . 52  4.2  Five-axis machine tool configuration. . . . . . . . . . . . . . . . . . . . . . . 55  4.3  Offsets of the rotary table that are included in the kinematic calculations for 5-axis rotary table kinematic configuration . . . . . . . . . . . . . . . . . . . . 55  4.4  Tracking error prediction model. . . . . . . . . . . . . . . . . . . . . . . . . . 57  4.5  Axis position fitting. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61  4.6  Block diagram for the PID controller and x-axis drive. . . . . . . . . . . . . . 63  4.7  Tool tip position and orientation contour errors. . . . . . . . . . . . . . . . . . 66  4.8  Orthogonality of On and Oact to O’n . . . . . . . . . . . . . . . . . . . . . . . 69  4.9  Contouring errors pre-compensation strategy. . . . . . . . . . . . . . . . . . . 70  5.1  Experimental setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77  5.2  Control Law for 5-Axis Spline Parameterization and Inteprolation Experiments  5.3  Simulation of Dual Spline and Decoupled Methods . . . . . . . . . . . . . . . 80  5.4  Test toolpath and parametric spline fitting to tooltip position and orientation.  78  Zones of high curvature are identified . . . . . . . . . . . . . . . . . . . . . . 81 5.5  Axis reference commands and encoder position data for experiments . . . . . . 83  x  List of Figures 5.6  Jerk of axis reference commands for experiments . . . . . . . . . . . . . . . . 84  5.7  Fast Fourier Transform of Measured Signals . . . . . . . . . . . . . . . . . . . 85  5.8  Control law for 5-axis contour error pre-compensation simulation and experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88  5.9  Velocity, acceleration, and jerk of tangential feed profile used for simulations and experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89  5.10 Comparison of real tracking error and predicted model . . . . . . . . . . . . . 90 5.11 Comparison of contour error estimation methods . . . . . . . . . . . . . . . . 91 5.12 Comparison of contour error estimation methods . . . . . . . . . . . . . . . . 93 5.13 Comparison of simulated and experimental contour errors . . . . . . . . . . . . 95 5.14 Simulation and experimental results for uncompensated and precompensated trajectory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96  xi  Nomenclature  A9 , A8 , . . . , A0 Coefficients of the 9th order feed correction polynomial B  Viscous friction of plant  C(u) NURBS curve J  Inertia of plant  Je  Objective function to minimize errors in fitting the feed correction polynomial  Jf  Augmented objective function to minimize errors in fitting the feed correction polynomial  L0 , L1 , L2 , L3 Position, velocity, acceleration, and jerk boundary conditions for quintic spline fitting LT ya,z Distance from Y-axis coordinate frame to C-axis coordinate frame Lac,z Distance from A-axis coordinate frame to C-axis coordinate frame M  Number of fitting data found in s and u∗  N  Number of discrete data from CAM System - 1  Ni,p (u) ith basis function of a NURBS or B-spline of degree p Ni,p (w) ith basis function for an orientation spline of degree p Ns  Number of discrete steps at Ts to complete the toolpath xii  Nomenclature P (u) B-spline of Position Qi,k  ith control point for the k th segment of the reparameterization function for orientation spline  S  Total length of toolpath  S(u) Polynomial spline SX , SY , SZ , SA , SC Quintic time splines for various axis Si (t) ith quintic time spline Ts  Sampling time of the servo loop  U  Knot vector of Position B-spline  W  Knot vector for orientation B-spline  [θk , ϕk ] Components of Spherical coordinates of tool orientation data Λ  Lagrange multiplier for feed correction polynomial fitting  u¯k  Parameter values assigned to tool tip position vectors pk  w¯k  Parameter values assigned to tool orientation vectors ok  O(w) Orientation spline in Cartesian coordinates O1  Predicted tool orientation in workpiece coordinates before pre-compensation  Oc  Center of spherical parallelogram used for pre-compensation of orientations  On  Orientation on the reference toolpath closest to the actual orientation  xiii  Nomenclature O act  Actual tool orientation in workpiece coordinates  O comp Compensated orientation reference commands in workpiece coordinates O ref Reference tool orientation in workpiece coordinates P ′ (u), P ′′ (u), P ′′′ (u) First, second, and third derivative of position spline P (u) with respect to u P3  Predicted tool tip position in workpiece coordinates after orientation pre-compensation  Pi  ith control point of a NURBS or B-spline  Pn  Position on the reference toolpath closest to the actual position  P act  Actual tool tip position in workpiece coordinates  P comp Compensated position reference commands in workpiece coordinates P ref Reference tool tip position in workpiece coordinates Θ(w) Orientation spline in spherical coordinates Θi  Control points of orientation spline in spherical coordinates  σ  Vector of normalized arc displacements for feed correction polynomial fitting  ϑk  Spherical coordinates of tool orientation data  e  Axis tracking errors  e(t) = [ex (t), ey (t), ez (t), ea (t), ec (t) Predicted tracking errors ok  Tool orientation vectors provided by CAM system  xiv  Nomenclature pk  Tooltip position vectors from CAM system  q  Actual axis positions  q(t)  Time representation of axis reference position commands  q1  Predicted axis positions before pre-compensation  q2  Axis reference position commands after orientation pre-compensation  q3  Predicted axis positions after orientation pre-compensation  q comp Compensated axis reference position commands q ref  Axis reference position commands  s  Vector of cumulative arc displacements for feed correction polynomial fitting  u∗  Vector of geometric spline parameters for feed correction polynomial fitting  ϵ1  Tolerance for convergence criterion to find tool tip position contour error  ϵ2  Tolerance for convergence criterion to find tool orientation contour error  ϵo  Tool orientation contour error  ϵp  Tool tip position contour error  ˆ u(σ) Normalized feed correction polynomial uˆs , uˆss , uˆsss First, second, and third derivatives of the normalized feed correction polynomial with respect to displacement s λ3 , λ2 , λ1 Poles of the homogenous solution for tracking error prediction  xv  Nomenclature J  Objective function to minimize jerk for quintic time spline fitting  µ3,i , µ2,i , µ1,i Coefficients of the homogenous solution for tracking error prediction △s(a, b) Displacement on toolpath between u = a and u = b △si  Displacement on toolpath between u = ai and u = bi  εM SE Tolerance for feed correction polynomial fitting εs  Tolerance for displacement approximation  ε  Tolerance for quintic time spline fitting  a9 , a8 , . . . , a0 Normalized coefficients of the 9th order feed correction polynomial b5,i , b4,i , . . . , b0,i Coefficients for the ith quintic time spline d3,i , d2,i , . . . , d0,i Coefficients of the particular solution for tracking error prediction hi  Time interval for ith quintic time spline  ka  Gain of current amplifier  kd  Gain of derivative controller  ki  Gain of integral controller  kp  Gain of proportional controller  kt  Torque gain of brushed DC motor  n  Number of control points in a NURBS or B-spline - 1  p  Degree of a NURBS or B-spline xvi  Nomenclature rg  Gearing ratio of plant  sk  Estimated arc-length at each assigned geometric parameter w¯k )  tf  Total path travel time  ti  Ending time for ith quintic time spline  u  Geometric parameter for Position B-spline  u(s)  9th order feed correction polynomial  w  Geometric parameter for Orientation B-spline  w(s) 7th order reparametrization Bezier spline wk′ (r), wk′′ (r), wk′′′ (r) First, second, and third derivative of the reparameterization function for orientation spline with respect to r wi  Weight of ith control point  wk (r) Reparameterization function for orientation spline B-spline B´ezier spline CAD Computer aided design CAM Computer aided manufacturing CNC Computer numerical control FFT  Fast Fourier transform  MSE Mean squared error of feed correction polynomial fitting  xvii  Nomenclature NURBS Non-uniform Rational B-spline PID  Proportional integral derivative controller  xviii  Acknowledgments I am most grateful to my research supervisor, Dr. Yusuf Altintas, for his valuable support, guidance, and encouragement. Working with Dr. Altintas has provided me with unparalleled insight into manufacturing engineering. More importantly, he has been a great mentor in teaching me how to be an excellent researcher. I also wish to thank my friends at the Manufacturing Automation Laboratory. Their willingness to share their insights into their own research has allowed me to learn more than I ever imagined. Their unique personalities created an environment where there was never a dull moment. My studies were made much more fruitful and enjoyable by their presence. I should particularly thank my friends Ke Zhang for his assistance in the development of the theoretical work and Mohammad Rezayi for his help in preparing the experimental test bed. Finally, I would like to thank my family and friends for the moral support they have provided. I would like to dedicate this work to my parents and grandparents, who have made tremendous sacrifices for me and taught me the value of education. This research was sponsored by the Natural Science and Engineering Research Council of Canadian Network for Research and Innovation in Machining Technology (NSERC CANRIMT).  xix  Chapter 1 Introduction In the manufacturing industry, there is a consistent demand for the increased productivity of all manufacturing processes, since inherent to the reduction of cycle time is a proportional reduction of operational costs. Parallel to the demand for increased productivity, the complexitity and precision of parts have also increased, with the goal of improving part performance. Due to these growing demands, the machine tool community has focused its attention on 5-axis computer numerical controlled (CNC) machines. In addition to being able to realize micron level accuracy like its 3-axis predecessor, the ability to orient the tool in 5-axis CNC machines allows parts with complex features, such as the fins found on turbo impellers, to be manufactured. In addition to the physical mechatronics design of the machine, including selection of appropriate sensors, actuators and real-time controllers, the design of motion control strategies is particularly important for 5-axis machine tools. Due to the non-Cartesian dynamics of 5-axis machine tools, traditional motion control strategies developed for 3-axis machines may not be sufficient. As a result, significant effort has been invested into the research of control laws and trajectory generation methods for 5-axis machine tools. Typically the motion control strategies are developed to reduce the machine’s deviation from the commanded toolpath, while providing the highest productivity possible. Fig. 1.1 shows the typical servo tracking performance for a 5-axis machine tool. Due to the limited bandwidth of the servo drives as well as disturbances from friction or cutting forces, the tool is not able to follow the commanded toolpath completely, causing tracking errors. When these tracking 1  Chapter 1: Introduction  Actual Tool Orientation  o  z  Reference Tool Orientation  Actual Tooltip Position  p  y Reference Tooltip Position  x Figure 1.1: Geometric deviations in position and orientation for a typical 5-axis machine tool  2  Chapter 1: Introduction errors are geometrically summed, the result is geometric deviations of the tool motion from the actual toolpath, denoted as εp and εo for geometric deviations in position and orientation, respectively. If the geometric deviations are large enough, then acceptable part tolerances will be violated. Motion control strategies must be adopted to reduce these geometric deviations to a minimum. Typically, the bandwidth of the servo is increased to reduce the tracking error until unmodeled dynamics create instabilities in the closed loop system. However, it is still possible to experience errors due to the inherent phase lag in all systems. Furthermore, a small tracking error in a rotary drive of a 5-axis machine, can result in large geometric errors due to the non-Cartesian kinematics. These errors can be seen to possess both high and low frequency components. The high frequency error components are usually the result of forced vibrations, chatter vibrations, or structural vibrations caused by discontinuous motions commanded by the servo mechanism. Forced vibrations can be minimized by selecting sufficiently rigid physical components, in particular for the spindle. Chatter vibrations can be avoided completely by selecting appropriate process parameters. As a result, the smoothness of the commanded toolpath plays a key role in reducing unwanted high frequency vibrations. The low frequency components are attributed to varying tool deflections which can be caused by feed fluctuations that vary the loading conditions on the cutting tool. As a result, the ideal commanded toolpath must be highly smooth with low feed fluctuations. In addition to high frequency error components, discontinuous motions create problems that extend beyond the simple tracking of a toolpath. At the heart of the problem are the high frequency oscillations generated by the excitation of resonance modes due to discontinuous motions. High frequency oscillations can lead to unwanted surface marks on the machined part. They can manifest themselves as high magnitude accelerations and jerks that put undue 3  Chapter 1: Introduction wear on the servodrives. Though it is possible to select low enough feedrates that avoid these discontinuous motions, the dramatic decrease in productivity is unacceptable. In this thesis, two motion control strategies are proposed to address the issues of smooth trajectory generation and reduction of geometric deviations in the context of trajectory generation for 5-axis machining. A new decoupled spline toolpath planning algorithm has been developed that results in jerk continuous quintic splines that interpolate tool tip position and tool orientation. Furthermore, the proposed interpolation strategy produces minimal feed fluctuation and jerks along any 5-axis curved toolpath. Geometric deviations are reduced using a novel trajectory modification technique. Based on error predictions and the natural phase lag of a linear closed loop system, the trajectory is pre-compensated with the objective of reducing the predicted position and orientation geometric deviations. The proposed strategy has also been designed to accommodate for the non-linear relationship between axis commands and tooltip position and orientation. The application of the motion control strategies developed can be summarized by Fig. 1.2. The detailed overview of the motion control strategies can be seen in Fig. 1.3. The proposed methods have been evaluated on a 5-axis machine with a tilting-table configuration and are directly applicable to 5-axis machines with other configurations. The rest of this thesis is organized as follows: The review of literature relevant to this thesis is presented in Chapter 2. Chapter 3 presents the novel smooth 5-axis spline interpolation technique, followed by a trajectory modification scheme to pre-compensate for contour errors in Chapter 4. The methodologies presented in Chapter 3 and Chapter 4 are both validated with experiments and simulations presented in Chapter 5. Chapter 6 concludes the thesis with remarks and discussions on possible future research directions.  4  Chapter 1: Introduction  1. CAD/CAM System  Quintic parametric splines and reparameterization functions  px py pz oi oj ok  Tooltip position and tool orientation data  2. Spline Fitting & Parameterization of 5-axis toolpath  P(u), O(w), u(s), w(s) Use fitting and parameterization to optimize feedrate and interpolate  feed [mm/s]  Constraints  s(t)  Optimized feed profile  u(s) w(s)  Displacement [mm]  3. Trajectory generation and Feed Optimization  w  P(u) O(w)  4. 5-axis quintic spline interpolation  Time stamped reference commands in workpiece coordinates  Px Py Pz Inverse Oi Kinematics Oj Ok  u  5. Contour Error Pre-compensation  Machine Tool Drives -  Cont.  Feed Drive  -  Cont.  Feed Drive  -  Cont.  Feed Drive  -  Cont.  Feed Drive  -  Cont.  Feed Drive  Figure 1.2: Overview of the work in this thesis, starting from the CAD/CAM system to the generated reference commands. The dashed boxes highlight the main contributions 5  Chapter 1: Introduction  a) Spline fitting & Parameterization of 5-axis toolpath px py pz  Quintic B-Spline Fitting  oi oj ok  P(u)  Estimate (ui,si) Arc lengths  Transformation to Spherical Co-ordinates  Estimate Arc lengths  Fit Feed Correction Polynomial  Quintic B-Spline Fitting  ( k, k)  (wj,sj)  Fit Orientation Reparameterization Function  P(u)  w(s)  O(w)  u(s)  b) Contour Error Pre-compensation Position Contour Error Estimation  ey,1-  yr zr ar cr  xact,1  ex,1  xr  Tracking Error Prediction  ez,1 ea,1 ec,1  yact,1  -  zact,1  -  aact,1  -  cact,1  Forward Kinematics  Px,1 Py,1 Pz,1 Oi,1 Oj,1 Ok,1  ex,2 ey,2 Tracking Error Prediction  Inverse Kinematics  ez,2 ea,2 ec,2  xcomp  xact,2  -  yact,2  -  zact,2  -  aact,2  -  cact,2  -  Forward Kinematics  Px,2 Py,2 Pz,2 Oi,comp Oj,comp Ok,comp  ycomp Inverse Kinematics  zcomp acomp ccomp  Orientation Contour Error Estimation  Figure 1.3: Overview of the main contributions in this thesis. Figure a) shows the basic overview of the spline interpolation algorithm developed. Figure b) shows the basic overview of the contour error pre-compensation algorithm developed. 6  Chapter 2 Literature Review 2.1 Overview Five-axis computer numerical controlled machine tools are often used to machine complex free-form sculptured surfaces found in dies, molds, biomedical, and aerospace parts. As with most manufacturing processes, the ultimate goal is to produce the highest quality end product in the shortest amount of time. In the context of machining, this means manufacturing a part that maintains the desired dimensional accuracy, while moving the tool as fast as possible. Given a closed loop servo system, the quality of the reference tool position and orientation commands can affect the dimensional accuracy and speed of the process. Reference commands must be smooth to avoid exciting the resonance modes or saturating the physical limits of the drives, thus avoiding excessive contouring errors. Furthermore, smoother reference commands intrinsically have lower torque and torque-rate demands, thus allowing the servo drives to achieve higher feed rates. Parallel to its smoothness, reference commands must also reflect the intended geometry determined by the CAD model. However, given an already smooth and accurate set of reference commands for a 5-axis toolpath, it may still be possible to experience geometric deviations due to the phase lag of the servo drives. Since this phase lag can be modeled, techniques can be developed to manipulate the reference commands to minimize these deviations to an acceptable level. In this chapter, past research relevant to motion control of five-axis machine tools is presented and reviewed. Due to the relative maturity of 3-axis motion control strategies, smooth command generation techniques for 3-axis machines that are present in literature are reviewed first 7  Chapter 2: Three-Axis Spline Interpolation Techniques  CAM Data  Fitting Criterion  Spline Representation  Poor Fitting  p1 p2 Good Fitting  pn  C(u)  Fitting Objectives: Minimize error between spline and points Minimize geometric jerk (oscillations) in spline Minimize geometric acceleration (curvature) in spline  Figure 2.1: Basic methodology of the spline fitting process in Section 2.2. This revision is extended to 5-axis machines in Section 2.3. Section 2.4 focuses on approaches to reduce contour errors for machine tools. The conclusions of the literature survey are presented in Section 2.5.  2.2 Three-Axis Spline Interpolation Techniques The increased demand for the production of complex sculptured surfaces at high speeds has motivated research in spline interpolation techniques. By representing a sculptured surface as a series of splines, it is possible to provide smooth and accurate tracking of the intended geometry. It should be noted that spline interpolation is generally purely geometric. The splines are used only to represent the sculptured surface geometry and possess no time data.  8  Chapter 2: Three-Axis Spline Interpolation Techniques  ds s  pk+1  pk  du  u y  du = ds x Figure 2.2: Discrepancy between geometric parameter (u) and actual arc length (s) As a result, spline interpolation does not directly determine velocity, acceleration, or jerk. In its most basic form, the key step in spline interpolation is spline fitting where a set of discrete CAM data are fit to a function based upon some criterion that must be met as shown in Fig. 2.1. In spline interpolation a geometrically favourable spline with low curvatures, high geometric continuity, and low oscillations are the goal, which result in lower velocity, acceleration, and jerks when feed planning is performed. In literature, the earliest use of splines is shown in interpolating 3-axis toolpaths with polynomials. Wang and Yang [1] compared the use of cubic and quintic polynomial splines, favouring the quintic spline for its smoothness. It should be noted that, with respect to the order of the spline, at minimum, a cubic spline is preferred. With the tool path represented by a geometric cubic spline, C2 continuity can be achieved, eliminating physically impossible instantaneous acceleration changes. As a result, by imposing certain 9  Chapter 2: Three-Axis Spline Interpolation Techniques continuity in the interpolating spline, smoother motions can be generated. However, the main drawback in the use of splines is feed fluctuations. Since the fitted splines are functions of a geometric parameter (u), discrepancy between the spline parameter and travelled displacement (s) can lead to feedrate fluctuations of 5% when the spline is interpolated with constant parameter increment. This discrepancy can be seen in Fig. 2.2. Since feedrate determines tool deflections, these rapid changes in feedrate can leave wavy surfaces on the machined part due to varying tool deflections. Furthermore, since the feed changes rapidly, this results in high accelerations and jerks, which deteriorate the servo tracking performance and induce vibrations on the machine. As a result, given a spline toolpath, a mismatch in the spline parameter and arc displacement can result in unsmooth reference commands. To overcome this problem various methods have been proposed in literature to select polynomial coefficients to minimize this discrepancy. Wang and Yang [1] have fitted a geometric spline to CAM data using nearly arc length parameterization by setting du = ds at the midpoint of each spline segment. The result is an order of magnitude reduction to the feed fluctuations using a quintic tool path of C2 continuity. This was further improved by Wang et. al [2] by imposing an additional third derivative constraint at the knots, resulting in Approximately Arc-Length Parameterized C3 (AAPC3 ) Quintic Splines. The most recent improvement of this approach was proposed by Erkorkmaz and Altintas [3], where the coefficients of a quintic spline are non-linearly optimized with the objective of minimizing the discrepancy between du and ds, resulting in an Optimally Arc-length Parameterized (OAP) Quintic Spline. In [4], a 73% reduction in feed fluctuation is reported when comparing the OAP quintic spline to the AAPC3 quintic spline. However, as shown by Farouki and Sakkalis [5], it is actually mathematically impossible to have a real curve where du = ds. This poses a fundamental limitation on the methods discussed. To overcome this problem, Farouki and Shah [6] used Pythagorean Hodograph (PH) curves instead, which allow the arc length to be analytically computed, thus avoid10  Chapter 2: Three-Axis Spline Interpolation Techniques ing feed fluctuations during interpolation. Given this advantage, Farouki et. al [7] extended the use of PH curves to three-axis free form machining. Due to influences from the CAD community, B-splines and Non-uniform Rational B-splines, (NURBS) are now frequently used for toolpath generation. The general form of a NURBS is as follows:  ∑N i=0 C(u) = ∑ N  Ni,p (u)P i wi  i=0 Ni,p (u)wi  ,  (2.1)  NURBS are rational functions that can be used to represent the shape of a spline. The parameters of a NURBS are control points, knots and weights which can be assigned to optimize the shape. Relative to polynomial splines, B-splines and NURBS have much more complex mathematical formulations. When parameterizing a polynomial spline, only the coefficients need to be selected. Furthermore, the coefficients have an explicit relationship with the higher derivatives of the polynomial spline. In the case of B-splines and NURBS, control points, knots, and weights need to be selected in the process of parameterization. Complicating matters further, the B-spline or NURBS parameters have an implicit relationship with the higher derivatives of the spline. Furthermore, changing one parameter may change the affect another parameter has on the higher derivative of the spline. As a result, trying to minimize the discrepancy between geometric parameter and arc displacement through the selection of spline parameters for NURBS and B-splines is not entirely useful. At best, the selection of NURBS or B-splines parameters should be optimized to fulfill another goal, such as fitting accuracy. An alternative technique to the selection of spline coefficients is scheduling the appropriate geometric parameter, given a desired displacement. Shpitalni et al. [8] proposed the use of a first order Taylor series approximation, where the spline parameter is scheduled based upon the intended feedrate. Lin [9] extended this method, using a second order Taylor series approxima-  11  Chapter 2: Five-Axis Spline Interpolation Techniques tion, resulting in two orders of magnitude reduction for feed fluctuation compared to the first order method. Many other algorithms have been presented in literature using the same iterative principles, with little improvement over the method proposed by Lin. In contrast to the iterative methods, Erkorkmaz and Altintas[3] approximated the non-linear relationship between the spline parameter and displacement with a single 7th order polynomial function, u(s). As a result, given a desired displacement along the toolpath, it is possible to know which geometric parameter the displacement corresponded to with a single function. In [3], feed fluctuation reduction results comparable to those produced by [9] are found with a 95% reduction in computation time. Heng and Erkorkmaz [10] extended this method, using an adaptive Simpsons bisection method for more accurate estimation of displacement. Furthermore, the non-linear relationship is fitted adaptively to a series of 7th order polynomials instead of a single one, allowing for more flexibility and accuracy in the fitting process. Though the feed fluctuation results are similar, the method proposed in [10], allows more complex spline parameter and displacement relationships to be fitted. Since modern CNC systems use NURBS, this approach of scheduling the appropriate spline parameter is adopted in this thesis and extended to a 5axis configuration. A discussion of 5-axis spline parameterization and the application of this interpolation approach to the overall scheme are discussed in the next section.  2.3 Five-Axis Spline Interpolation Techniques At present, the preferred method to manufacture complex sculptured surfaces is 5-axis CNC machining. Since a 5-axis machine tool has the ability to orient the tool, more complex features can be machined with higher productivity. However, the ability to orient the tool introduces additional complexities that have motivated the research in 5-axis spline interpolation techniques. In the research of 5-axis spline interpolation the same criterion applies as the 3-axis case, in that smooth toolpaths with minimal feed fluctuation must be generated.  12  Chapter 2: Five-Axis Spline Interpolation Techniques  Poor Fitting Fitting Criterion  Good Fitting  Spline Representation  CAM Data o1 o2 on  p1 p2  C(u), O(u)  pn  Fitting Objectives: - Minimize error between spline and points - Minimize geometric jerk (oscillations) in position and orientation spline - Minimize geometric acceleration (curvature) in position and orientationspline  Figure 2.3: Basic methodology of the 5-axis spline fitting process  13  Chapter 2: Five-Axis Spline Interpolation Techniques Extending spline interpolation to 5-axis machining presents a host of new problems. In addition to the interpolation of tooltip position, it is necessary to interpolate tool orientation as seen in Fig. 2.3. Fleisig and Spence [11] proposed a decoupled method, where the position and orientation are interpolated with independent C2 quintic splines. To prevent feed fluctuations on the position and orientation, the quintic splines representing position and orientation are optimized with a technique similar to the one proposed in [1]. Since the position and orientation spline may have different lengths, a third spline is required to synchronize the interpolation of the position and orientation spline to a single parameter. The synchronizing spline is generated by assuming the path length as a linear chord, resulting in inaccuracies in orientations along highly curved path positions. Liu et al. [12] proposed a similar method with the synchronizing spline generated based on arc-length, thus increasing accuracy. However, the synchronizing spline is still C2 continuous and can go backwards since there is no proof of monotonicity. Finally the orientation spline is not fitted to spherical coordinates, resulting in orientation magnitudes that are not equal to unity. Since these methods can only achieve C2 continuity, the commanded discontinuous jerk can still excite structural modes of the machine, causing residual vibrations, or saturate the torque limit of servo drives, causing large tracking errors. Alternatively, Langeron et al. [13] proposed the use of dual splines to interpolate position and orientation. By providing a position spline for the tool tip and another position spline on the tool axis, it is possible to interpolate position and orientation. Since the orientation is interpolated with two position splines, the change in orientation is not accurately reflected in this method. Problems occur when there are large orientation changes over small distances. This method has been extended to NURBS [14] and the use of quarternions [15]. However, the fundamental problem of accurately interpolating orientation changes has yet to be solved using this method. Furthermore, 5-axis methods reported in literature have yet to adopt the more sophisticated spline interpolation techniques to minimize feed fluctuations. As mentioned, [11]  14  Chapter 2: Five-Axis Spline Contour Error Pre-compensation makes use of constant parameter interpolation with a nearly arc length parameterized spline. Liu et al. [12] uses the first Taylor approximation, which has been shown to generate inferior results with respect to feed fluctuation when compared to other methods presented in literature [3]. In this thesis, an overall approach is presented to overcome the limitations in the existing 5axis spline interpolation methods. Adopting the decoupled method, the position and orientation are fitted independently, thus avoiding the fitting problems inherent in the dual spline method. However, unlike the existing decoupled methods, the proposed method is C3 continuous. A quintic C3 B-spline is fitted by assigning control points and knots to force the spline to pass through the tool tip position data [16]. To ensure the correct spline parameter is scheduled to yield the desired arc displacement, subsequently minimizing feed fluctuations, the non-linear relationship between the spline parameter and displacement is approximated with a feed correction polynomial. To preserve C3 continuity, the method proposed in [10] has been modified, resulting in an adaptive 9th order polynomial. The tool orientation data is interpolated with a quintic C3 B-spline that is fit to spherical coordinates of the tool orientation data, then mapped back to Cartesian coordinates to avoid infeasible orientations. Like the interpolation of position, the non-linear relationship between the orientation spline parameter and arc displacement must be approximated. In this case, a 7th order B´ezier spline is used to schedule the spline parameter as a function of displacement. Furthermore, given the unique characteristics of the B´ezier, its coefficients are optimized to minimize jerks. The overall scheme results in C3 continuous motion commands with minimal feed fluctuation and minimal jerks.  2.4 Five-Axis Spline Contour Error Pre-compensation The accuracy with which the tooltip can follow the commanded toolpath is one of the major performance metrics of a machine tool. The minimization of contouring errors have been 15  Chapter 2: Five-Axis Spline Contour Error Pre-compensation  G  1. Increase Servo Bandwidth  Hz 3. Modify Tool path +  X-Controller  + +  2. Include Contour Error Control  +  -  Y-Controller  X-Plant  Contour Error Controller  + +  Y-Plant  Figure 2.4: Approaches to reduce geometric deviations in a multi-axis machine studied in several directions in the past [17]. The strategies considered in the minimization of contour errors include the following as shown in Fig. 2.4: 1. Increasing the bandwidth of individual axis in a multi-axis machine 2. Including control law to minimize of actual contour error 3. Modifying the trajectory to pre-compensate for contour errors.  Since contour errors are the geometric sum of tracking errors incurred by all the axes in a multiaxis machine tool, an intuitive way to reduce contour errors would be to increase the bandwidth of all the individual axes, therefore increasing the tracking performance. As a result, signif16  Chapter 2: Five-Axis Spline Contour Error Pre-compensation icant research in developing advanced control laws has been directed towards improving the bandwidth of the feed drives. Tomizuka [18] developed the Zero Phase Error Tracking Control (ZPETC) system which cancels the stable poles of the drive’s closed loop transfer function. This strategy minimizes the phase lag between the reference position input and actual output of the drive, which yields reduced tracking errors. However, the algorithm is sensitive to the changes in the transfer function of the drive that occur during positioning of the machine within the work envelope. Weck and Ye [19] removed the high frequency content of the commands generated by ZPETC, but at the expense of phase distortion. Renton and Elbestawi [20] developed a servo control law that uses the axis performance envelope as well as instantaneous position, velocity, and acceleration information of the target path in the presence of disturbances. Altintas et al. [21] presented an adaptive sliding mode control technique for high speed feed drives. The proposed control system is robust against uncertainties in the drive’s parameters, maximizes the bandwidth within physical limitations, and compensates for external disturbances such as friction and cutting force. Erkorkmaz and Altintas [22] provided a systematic approach for designing a control law which provides a high tracking bandwidth as well as adequate disturbance rejection and parameter variation robustness. Unless it is actively damped, the bandwidth of the drive is still limited by the first natural frequency of the feed drive structure regardless of the control law used in rigid body mode. Kamalzadeh et al. [23] and Okwudire et al. [24] expanded the sliding mode controller to reject the external disturbances while actively damping the torsional, lateral and axial vibrations of the ball screw drives. The active damping expands the bandwidth and reduces the tracking errors of drives. Though improving the tracking performance of individual axes seems like an intuitive way to reduce contouring error, this may not always be the case as described in [25]. As an alternative, methods have been developed focusing solely on the reduction of contouring errors instead of individual axis tracking errors. An early example of this is Koren’s [25] proposed cross17  Chapter 2: Five-Axis Spline Contour Error Pre-compensation coupled controller (CCC) used to minimize the contouring errors in biaxial machines. Later, Koren and Lo [26] introduced a variable gain CCC to adjust the controller as the path curvature changes. Extending the idea of reducing contour errors to a 5-axis configuration, Altintas and Sencer [27] proposed a multi-input, multi-output sliding mode controller that predicts and minimizes the contouring errors along 5-axis tool path. Instead of controlling individual axis, their multi input-multi output controller controls all five drives to minimize the contouring error. However, these controllers all act in real time, and the controller cannot act fast enough to avoid large contouring errors at sharp curvatures. Furthermore, the contour error prediction algorithm breaks down at high speeds and low controller sampling rates. As a solution to this, several authors have proposed modifying the trajectory to pre-compensate for the contour errors. Ernesto and Farouki [28] compensated the inertia and viscous damping of the drives by a priori modifications of the commanded path geometry. Altintas and Khoshdarregi [29] presented a vibration avoidance and contouring error compensation algorithm for feed drives by shaping the trajectory ahead of axis control commands. At present, only tooltip position contour errors are compensated for. In this thesis, the last approach is adopted to reduce contour errors so defined in Section 4.2. Tracking errors are first predicted analytically for the three translational and two rotary drives of the five-axis machine. By generating a time representation for the axis commands and solving the linear ordinary differential equation of the closed loop system, it is possible to obtain the analytic solution of tracking errors for an axis. Using the analytically expressed tracking errors of drives, the tool tip and tool orientation errors are found by comparing the actual tool positions to the reference. The trajectory commands are modified in the feedforward blocks to compensate the predicted contouring errors before sending them to the servo drives. Taking advantage of the non-linear kinematics of the 5-axis machine tool, both position and orientation contour errors are compensated for. 18  Chapter 2: Conclusions 2.5 Conclusions In this chapter, an overview of the literature in spline interpolation for 3-axis and 5-axis machines, and precision control of 5-axis drives has been presented. It has been shown that smooth splines are generally desired for the representation toolpaths. Through the literature review, several issues associated with the use of splines are introduced. Common to all splines, feed fluctuations can occur unless more sophisticated interpolation techniques are used. Specific to 5-axis machining, there are tradeoffs in the level of smoothness and flexibility in fitting for 5axis toolpaths in the presented literature. Though numerous techniques for reducing geometric deviations exist in literature, very few address contour error directly. Through the revision of methods that do in fact address contour error, it is found limitations exist. The contributions in this thesis are intended to overcome the limitations found in this literature review.  19  Chapter 3 Spline Parametrization and Interpolation for 5-Axis Machines 3.1 Overview The ability to provide smooth reference commands is of particular importance in the computer control of machine tools. Smooth reference commands avoid excitation of the natural modes of the servo control system, resulting in better surface finish and less wear on the servo drives of the machine tool. In addition to being smooth, the reference commands must be accurate, reflecting the desired geometry of the part to be machined. Traditionally, contouring tool-paths are comprised of many small linear or circular segments. Given a computer aided design (CAD) model of a part to be machined, the CAM system discretizes the model into a series of points, fine enough to represent the intended geometry of the part. During toolpath generation, these points are interpolated with linear or circular segments, which are known as G-codes. However, this imposes major limitations on the productivity of the process, quality of the part, and longevity of the machine tool. Since the points are essentially geometrically discontinuous for smooth sculptured surfaces, the machine tool must accelerate/decelerate or stop at each consecutive discretized point. As a result, it imposes a limitation on the top speed the machine can reach. In addition to that, the constant fluctuations in acceleration and deceleration create high jerk demands which can cause surface marks and undue wear on the servo drives. To overcome this problem, splines have become a better alternative for NC toolpath generation [30]. Alternative to linearly interpolating the points generated by the CAM system, a continuous spline is used to interpolate these points, thus forcing 20  Chapter 3: Overview  Linear Interpolation  Corner Smoothing  Spline Fitting Smoothed spline  linear interpolation segments  e  Cannot reach feed on linear segment  feed [mm/s]  feed [mm/s]  CAM Data  Desired feed is met in every segment  time [s] Transitions across CAM points are smooth and continuous  Must stop at each CAM Point  Linear interpolated feed profile  time [s]  Smoothed spline feed profile  Figure 3.1: Use of geometrically smooth splines to interpolate CAM data, and the resulting improvement in feed profiling  21  Chapter 3: B-Spline Background the tool to pass through or approximate these points at a desired level of continuity. This approach can be seen in Fig. 3.1. Using spline interpolation, the geometric toolpath is smooth at each CAM data. As a result, when feed planning is used, the tool tip is able to maintain smooth non-zero velocity transitions at these points. However, even when feed planning is used with linear interpolation, the tool must stop at each CAM data, since smooth velocity transitions are impossible at sharp corners. As a result, smooth feed profiles would be impossible in the absence of a smooth geometric toolpath. In this chapter, a methodology is presented for the generation of smooth 5-axis C3 reference commands from discrete tool position and orientation data from a CAM system. First, a brief background is presented for the representation and computation of NURBS in Section 3.2. Next, the decoupled representation of position and orientation for a CNC toolpath is discussed in Section 3.3. Based upon the decoupled representation, in the presented methodology, the position and orientation data from the CAM system are first fitted independently to NURBS in Sections 3.4 and Sections 3.5 respectively. To maintain geometric jerk continuity, the splines are set to be quintic. The orientation spline is fitted in spherical coordinates to ensure feasible orientations are possible at all points of the spline. Following the fitting of the parametric splines, two functions are generated to approximate the non-linear relationship between the spline parameters and displacement in. C3 continuity is maintained in both functions. Furthermore, given the properties of the orientation interpolating function, its properties are optimized to minimize jerk. An overview of the methodology can be seen in Fig. 3.2. The contributions in the chapter are summarized in Section 3.6  3.2 B-Spline Background To overcome the problems inherent in linear and circular interpolation, splines have been used successfully as an alternative to NC toolpath generation. Among the earliest examples are 22  Chapter 3: B-Spline Background  Input: G01 data p = [px,py,pz]T, o = [oi,oj,ok]T  Fit B-spline P(u) to tool tip positions p  Map o to spherical points  Fit B-spline ϴ(w) to spherical points Estimate displacement data s Map ϴ(w) back to unit sphere O(w)  Fit spline u(s) to (sj, uj*)  Fit spline w(s) to (sk, wk)  Feedrate profile s(t)  Time-sampled position P(u(s(t))) and orientation O(w(s(t)))  Inverse kinematics transformation  Output: five-axis position command q = [X,Y,Z,A,C]T  Figure 3.2: Overview of proposed trajectory generation scheme.  23  Chapter 3: B-Spline Background the use of cubic and quintic polynomials [1, 2]. These splines provided continuous kinematic profiles, resulting in a smoother trajectory. But more recently, due to influences from the CAD community, NURBS and B-splines have been adapted into NC toolpath generation in the place of polynomial splines. Though NURBS and B-splines are polynomials by nature, the mathematical formulation introduces several desirable properties that were not previously available in regular polynomials: 1. Intuitive control points 2. Local curve shaping capabilities 3. Implied Continuity at joints For these reasons, NURBS are preferred over polynomials. However, unlike the computation of a polynomial spline, the computation of a NURBS is much more complex. For a polynomial spline, given the geometric parameter u, the solution can be expressed as a single explicit polynomial such as: S(u) = an un + an−1 un−1 + . . . + a0  (3.1)  A NURBS is evaluated by a series of recursive functions, which is typically represented in the following compressed form: ∑N i=0 C(u) = ∑ N  Ni,p (u)P i wi  i=0  Ni,p (u)wi  ,  (3.2)  where P i are control points, Ni,p (u) are basis functions, and wi are weights. The basis functions are defined by a knot vector, U , and the degree of the spline p. As a result, the characteristics of a NURBS are defined by: 1. Control points = P i 24  Chapter 3: B-Spline Background 2. Knot vector = U 3. degree = p 4. weights = wi As it can be seen in Fig. 3.3, control points make up the vertices of the control polygon which define the general shape of the NURBS. In addition to that, the weights of a NURBS controls the ”pull” each control point has on the spline. In this work, as is common in literature for trajectory generation for CNCs [31, 32], the weights of the NURBS control points are set to unity. In this way, the NURBS formulation, as shown in Eq. (3.3) reduces to the B-spline as follows: P (u) =  N ∑  Ni,p (u)P i  (3.3)  i=0  As a result, the formulations are simplified while retaining much of the flexibility made available by the NURBS format. In addition to the weights and control points, the degree determines continuity of the spline, and consequently, the overall smoothness. The knot vector determines the general distribution of the spline within the parameter interval, which is generally normalized so u ∈ [0, 1]. The knot vector is a set of non-decreasing sequence of real numbers that is non-periodic and non-uniform as shown: U = [0, . . . , 0, up+1 , . . . , up+1+n , 1, . . . , 1],  (3.4)  where n + 1 is the number of control points in the NURBS. Each element of the knot vector is called a knot and the consecutive knots on the open interval [uj , uj+1 ) are called knot spans. Typically, the beginning and end of the spline are forced to pass through the initial and end control points, P 0 and P n , by repeating the initial and end knots p + 1 times, as shown in  25  Chapter 3: B-Spline Background  P(1)  PN  N P(u)= Ni,p(u)Pi i=0  P5  P6 P7  Pi = control points P4 Ni,p = basis functions p = degree N+1 = number of control points u = geometric parameter  PN-1  P(u) [0<u<1] P8 P9  P3  ...  PN-2 y  P0  P(0)  x  P1  P2=[Px,2,Py,2,Pz,2 ]  z  Figure 3.3: B-spline curve representation. Eq. 3.4. For example, the knot vector for a cubic (p = 3) b-spline is given as: U = [0, 0, 0, 0, up+1 , . . . , up+1+n , 1, 1, 1, 1]  (3.5)  With the knot vector and degree, it is possible to evaluate the basis functions Ni,p (u). The recursive evaluation of the NURBS begins with the evaluation of the zero degree basis function which is defined as:    1 u ∈ [ui , ui+1 ) Ni,0 (u) = ; u ∈ [0, 1]  0 u∈ / [ui , ui+1 )  (3.6)  Following the evaluation of the zero degree basis function, higher degree basis functions are evaluated as linear combinations of two lower degree basis functions. The linear combination is expressed according to the following recursive scheme: Ni,p (u) =  ui+p+1 − u u − ui Ni,p−1 (u) + Ni+1,p−1 (u) ui+p − ui ui+p+1 − ui+1 26  (3.7)  Chapter 3: B-Spline Background  1  1  dNi,0 du  0.5  Ni,0  p=0  0 0.5 0 0  ui  ui+1 ui+2 ui+3  1  1 0  0.2  0.4  0.6  0.8  1  0.6  0.8  1  0.8  1  Ni,1  1  dNi,1 du  5  p=1  0 5 0 0  ui  1  ui+1 ui+2 ui+3  1  0  0.2  0.4  dNi,2 du  Ni,2 10  p=2  0 10 0 0  ui  ui+1 ui+2 ui+3  1  0  0.2  0.4  0.6  b)  a)  Figure 3.4: Visualization of basis functions and the first derivative of basis functions over the parametric interval [0,1] Higher order basis functions are the product of an increasing number of basis functions blended together. Different orders of basis functions over the interval of [0,1] can be seen in Fig. 3.4(a). Using these basis functions, a position on the B-spline is obtained by the sum of the product of the basis functions and control points: P (u) = N0,p (u) · P 0 + N1,p (u) · P 1 + . . . + Nn−1,p (u) · P n−1 + Nn,p (u) · P n  (3.8)  From Fig. 3.4(a), it can be seen that the smoothness of the basis functions increase as the degree of the basis functions increases. In addition, it can be seen from Eq.(3.8) that the basis functions are involved directly in formulating the spline. As a result, the degree and smoothness of the basis functions has a direct impact on the smoothness of the spline. In order to impose jerk 27  Chapter 3: Decoupled B-spline Polynomial Representation continuity constraints on the toolpath, the derivatives of the spline, up to the third order must also be known for the subsequent algorithms. Since a NURBS is a polynomial, it is possible to find its derivative as a function of the parameter. Similar to the actual NURBS, the derivative of the NURBS is calculated recursively. Since the control points are simply coefficients, the derivative of the NURBS can be found by evaluating the derivatives of the basis functions. The first derivative of a pth degree basis function with respect to the curve parameter u is given as: p dNi,p (u) 1 Ni,p−1 (u) − Ni+1,p−1 (u) = du ui+p − ui ui+p+1 − ui+1  (3.9)  and the k th derivative is given as: k−1 k−1 Ni,p−1 (u) Ni+1,p−1 (u) dk Ni,p (u) = p( − ) k du ui+p − ui ui+p+1 − ui+1  (3.10)  The derivatives of the basis functions can be seen in Fig. 3.4 (b). Knowing the k th derivative of the basis functions, it is possible evaluate the k th derivative of the actual spline at any point. Similar to Eq. (3.8), the derivative of the spline is evaluated as follows, given the derivative of the basis function: dk P (u) dk N0,p (u) dk N1,p (u) dk Nn−1,p (u) dk Nn,p (u) = ·P + ·P +. . .+ ·P + ·P n (3.11) 0 1 n−1 duk duk duk duk duk In the following section, NURBS are used in a decoupled configuration to represent the position and orientation of a 5-axis toolpath.  3.3 Decoupled B-spline Polynomial Representation A 5-axis toolpath generally consists of desired tooltip positions and tool axis orientations. In order to retain this information in the spline format described in Section 3.2, a toolpath based on a format proposed by Fleisig and Spence [11] is introduced. The proposed toolpath consists of two splines, which are dedicated for the following: 28  Chapter 3: Decoupled B-spline Polynomial Representation  Tool axis  z Workpiece  y  Tool tip  x  1  P(u)  O(w)  k  O  0  0  z  P (mm)  0.5  0 40  20  P (mm) y  20 40  0  P (mm)  0.5 1 1  x  20  O  j  Tooltip position  1  0  0 1  1  Oi  Tool axis orientation  Decoupled Representation of Toolpath  Figure 3.5: Decoupled representation for a 5-axis toolpath • The tool tip position is given by a spline, P (u) in the coordinate system of the work piece • the tool orientation is given by a spline, O(w) which is first given as a spline in spherical coordinates, Θ(w), then transformed into the coordinate system of the work piece.  The overall representation of the proposed format is illustrated in Fig. 3.5. The splines of the toolpath, P (u) and Θ(w) are given in B-spline form with the weights set to unity. Unlike the dual spline representation [13, 33], the orientations are represented as an independent spline. Since the two splines are a function of different geometric parameters, u and w for position and orientation respectively, they are considered to be decoupled. This provides considerable 29  Chapter 3: Decoupled B-spline Polynomial Representation  Optimized Feed Profile feed [mm/s]  Constraints  w(s)  w  O(w)  Oi Oj Ok  P(u)  Px Py Pz  s Optimized feed profile  u(s)  Displacement [mm]  u  Figure 3.6: Sequence of functions for reparametrization flexibility when there is a need to modify orientation and position independently. Furthermore, this method of representation allows more accurate fitting of orientation as will be shown in Chapter 5. However, the two splines must be interpolated simultaneously. Since they are a function of different geometric parameters, reparametrization functions must be used to ensure the splines are interpolated correctly. In this thesis, a feed correction polynomial, u(s), and orientation reparametrization spline, w(s), are the reparametrization functions for position and orientation respectively, where s is the displacement along the toolpath. In addition to synchronizing the position and orientation splines as a function of displacement, the reparametrization functions are also optimized to reduce jerk, minimize feed fluctuations, and maintain jerk continuity. The overall interpolation scheme can be seen in Fig. 3.6. In the following sections, the methodology used to generate the splines P (u) and O(w), along with the reparameterization functions u(s) and w(s) using the equations found in Section 3.2 and the format presented in this section is presented.  30  Chapter 3: C3 Tool Tip Position Spline Generation 3.4 C3 Tool Tip Position Spline Generation 3.4.1 Parametric Position Spline Fitting Consider a set of tool tip position vectors pk = [px,k , py,k , pz,k ]T , k = 0, . . . , N , where N + 1 is the total number of discrete tool positions received from the CAM system. The objective in spline fitting is to select the degree p, knot vector U , and control points P i of a parametric B-spline, P (u), so the spline passes through the tool tip position vectors pk at a desired level of continuity. In this work, the method presented by Piegl and Tiller [16] is used. Starting with degree p, since C3 continuity must be preserved, a quintic spline is required, consequently setting p = 5. To solve for the knot vector U , parameter values, u¯k , are first assigned to each position vectors pk , using the centripetal method [34]:    u¯0 = 0 u¯N = 1      N √  ∑  d= pk − pk−1  k=1  √     pk − pk−1    u¯k = u¯k−1 + , k = 1, .., N − 1 d  (3.12)  By assigning the parameter values the result is P (¯ uk ) = pk . As it can be seen from Eq. (3.12), the parameter values are assigned based upon the distribution of the position vector along the toolpath. By using the centripetal method, oscillatory behaviour in the spline between the CAM points is minimized. Using the assigned parameter values from Eq. (3.12), the knot vector is solved by averaging the assigned parameters as follows:    u0 = u1 = ·· = up = 0 ; uN +1 = uN +2 = ·· = uN +p+1 = 1 j+p−1 ∑  u¯k , j = 1, 2, ··, N − p uj+p = p1   (3.13)  k=j  Since the assigned parameters are solved based upon their distribution, the knot vector resembles a similar property. Next, the number of basis functions and control points in Eq. (3.3), is 31  Chapter 3: C3 Tool Tip Position Spline Generation set equal to the number of tool tip positions pk , which allows for a (N + 1) × (N + 1) linear system to be solved for the control points. Since the knot vector U is known from Eq. (3.12) and Eq. (3.13), the basis functions, Ni,p (u), in Eq. (3.7) at any parameter u is known. In addition, since each position vector, pk , has been assigned a parameter value, u¯k , it is possible to solve for the control points P i as follows:   N (¯ u ) ···  0,p 0  .. ..  . .  N0,p (¯ uN ) · · ·      NN,p (¯ u0 ) P T0 pT   0   ..   ..  ..  .  =  .  .     T NN,p (¯ uN ) P N pTN  Φ1  Γ1  (3.14)  Ψ1  The control points are obtained by taking the inverse of Φ1 : Γ1 = Φ−1 1 Ψ1  (3.15)  Once the knot vector U and control points P i have been calculated, it is possible to interpolate the position data with the quintic B-spline P (u) from Eq.(3.3). Further details of interpolation for NURBS are given by Piegl and Tiller [16].  3.4.2 Feed Correction Polynomial The simplest way to interpolate along a given spline toolpath is to use natural spline interpolation as shown in Fig. 3.7(a), where the spline parameter u is scheduled proportionally to the desired displacement: u=  C · s, S  (3.16)  where S is the total length of the toolpath and C is some arbitrary constant. If the original spline is generated with the arc length and parameter sharing a closely linear relationship, this method would yield acceptable results [1, 2, 4, 11]. However, if the relationship between the 32  Chapter 3: C3 Tool Tip Position Spline Generation  (a) Natural Interpolation s(t)  C S  u(t)  Spline Toolpath: n  i=0  Ni,p(u)Pi  x(t) y(t) z(t)  (b) Interpolation with Feed Correction Polynomial s(t) Feed Correction Poly. u(t) Spline 9 8 u=As +Bs +...+J Toolpath  x(t) y(t) z(t)  Figure 3.7: Different methods of interpolating along a given spline toolpath arc length and parameter deviate from a linear relationship, this deviation creates undesired fluctuations in the feed profile. Although natural interpolation allows the boundary conditions between parameter and displacement to be met, u = 0 when s = 0 and u = 1 when s = S, first order boundary conditions between splines is impossible between two spline segments. As Fauroki et al. showed [5], it is mathematically impossible to generate a spline with a linear relationship between displacement and parameter. Though much research has been done in optimizing a spline’s parameters to fulfill this linear relationship [1, 2, 4, 11], two problems exist. First the algorithms are only applicable to polynomial splines. Since NURBS possess a much more complex mathematical form, these algorithms are not appropriate. Second, due to the above mentioned fundamental mathematical limitation, it is not possible to force a free form curve to have a completely linear relationship between the displacement and parameter, unless it is a straight line with no curvatures [5]. As a result, a reparametrization function, based upon methods developed in [3] and [10], is used to schedule the parameter based upon the desired displacement. The proposed reparametrization function is a 9th order feed correction  33  Chapter 3: C3 Tool Tip Position Spline Generation polynomial of the proposed form:   u(s) = A9 s + A8 s + . . . + A0  9  8  (3.17)     where: 0 ≤ s ≤ S  which is fit over the displacement (s) and corresponding spline parameter (u), which can be computed using the following integral: ∫ a ∫ ′ s(a) = ∥P (u)∥du = 0  a   √ ′2 ′2 ′2  Px + Py + Pz du  0  (3.18)     where: 0 ≤ a ≤ 1  Since the integral in Eq. (3.18) is difficult to solve analytically, it is solved numerically instead using Simpson’s rule with an adaptive bisection technique [35]. A more general representation of (3.18) is as follows: ∫ s(b) − s(a) =  b   ∫ b√   Px′2 + Py′2 + Pz′2 du ∥P ′ (u)∥du =  a  a  where: 0 ≤ a < b ≤ 1      (3.19)  which is the displacement of the spline between u = a and u = b. Equation (3.19) can be estimated with Simpson’s rule: [ ] b−a a+b s(b) − s(a) ≈ △s(a, b) := f (a) + 4f ( ) + f (b) 6 2 where f (u) =  √  (3.20)  Px′2 + Py′2 + Pz′2 . Next, the error of the estimate from Eq. (3.20) is checked.  The interval [a, b] is divided into two equal segments [a1 , b1 ] and [a2 , b2 ], and the displacement within the two new intervals, △s(a1 , b1 ) and △s(a2 , b2 ), are approximated again with Eq. (3.20). Given some tolerance εs , the approximation of the displacement over [a, b] is within the tolerance if |△s(a1 , b1 ) + △s(a2 , b2 ) − △s(a, b)| < εs . 34  (3.21)  Chapter 3: C3 Tool Tip Position Spline Generation If Eq. (3.21) is violated, the interval [a, b] is divided in two segments and the approximation procedure is repeated until all segments respect Eq.(3.21). For the purposes of high speed machining it is adequate to assign εs to be smaller than the encoder resolution. The result is a series of parametric intervals [ai , bi ] with corresponding displacements △si . The displacements on intervals, △si , are successively summed resulting in a set of cumulative displacements sj . The corresponding geometric parameter for each cumulative displacement is the end point of each parametric intervals, bi , which is redefined as u∗j , j = 1, . . . , M . This gives a vector of spline parameters, u∗ , with a vector of corresponding arc displacements , s, as shown: u∗ = [0 u∗1 u∗2 . . . u∗M ]T → s = [0 s1 s2 . . . sM ]T  (3.22)  It should be noted that since the parameters are normalized, then u∗M = 1 and sM = S, where S is the total length of the spline, estimated using Eq. (3.18) and Eq. (3.20). Once u∗ and s are computed, a 9th order, feed correction polynomial is fitted to the cumulative displacements and parameters (sj , u∗j ) to approximate this relationship. The 9th order was chosen to approximate the nonlinear relationship between s and u as accurately enough while providing enough degrees of freedom to respect the boundary conditions up to the third order, thus maintaining C3 continuity. This 9th order feed correction polynomial can be used in realtime interpolation to provide an accurate prediction of u to yield the desired arc displacement s. To avoid ill conditioning, Eq.(3.17) is normalized with the total displacement S, resulting in:    uˆ(σ) = a9 σ + a8 σ + . . . + a0  9  8  where: 0 ≤ σ ≤ 1     (3.23)  where σ = s/S, and a9 = S 9 A9 , a8 = S 8 A8 , . . . , a0 = A0 . Similarly, the first, second, and third derivatives of the spline parameter with respect to the displacement (uˆs = dˆ u/ds,  35  Chapter 3: C3 Tool Tip Position Spline Generation uˆss = d2 uˆ/ds2 , uˆsss = d3 uˆ/ds3 ) are also expressed in the normalized formulation as:  1 dˆ u   u ˆ = = (9a9 σ 8 + 8a8 σ 7 + . . . + a1 )  s   ds S   d2 uˆ 1 uˆss = 2 = 2 (72a9 σ 7 + 56a6 σ 6 + . . . + 2a2 )  ds S   3   d u ˆ 1   uˆsss = = (504a9 σ 6 + 336a8 σ 5 + . . . + 6a3 ) ds3 S3  (3.24)  The feed correction polynomial is solved by applying an adaptive least squares fit with error control over the arc displacements and spline parameter values (s and u), while maintaining zero, first, second, and third order boundary conditions at the ends of all spline segments. Given the arc displacements (Eq. (3.22)) from the adaptive bisection technique, a vector of normalized arc displacements can be defined as: σ = [0 σ1 σ2 . . . σM ]T =  1 1 s = [0 s1 s2 . . . sM ]T S S  (3.25)  Substituting the normalized arc displacements into Eq.(3.23), the corresponding spline parameter predictions obtained with the feed correction polynomial can be represented in matrix form:        0 0  0   0    9 8 7  uˆ(σ1 )   σ    1 σ1 σ1      9 8 7 ˆ :=  u  uˆ(σ2 )  =  σ2 σ2 σ2  .   . .. ..  .   . . .  .   .    9 8 7 uˆ(σM ) σM σM σM  ··· ··· ··· .. . ···  Φ    1a9      1 a8      1 a7    ..   ..  .  .    1 a0  (3.26)  α  The estimation error can be defined as: ˆ = u∗ − Φα eu = u∗ − u  36  (3.27)  Chapter 3: C3 Tool Tip Position Spline Generation ˆ are the actual and the estimated, normalized displacement where u∗ = [0, u∗1 , . . . , u∗M ]T and u vectors, respectively. The objective function to be minimized is: 1 1 Je = eTu eu = (u∗ − Φα)T (u∗ − Φα) 2 2  (3.28)  In addition to the minimization of the prediction, the continuity of the interpolating spline up to the third order must be preserved so the actual reference commands will also be C3 . The first, second, and third derivative constraints are as follows:  du ds 1   us = = ( )−1 =   ds du f (u)   ( )′   dus dus 1 1 f ′ (u) uss = = us = =− ds du f (u) f (u) f (u)3    ( )  ′  du du 1 f ′ (u) 3f ′ (u)2 − f ′′ (u)f (u)    usss = ss = us ss = − = ds du f (u) f (u)3 f (u)5 where f (u) and its derivatives are found as follows:  √  ′  f (u) = ∥P (u)∥ = Px′2 (u) + Py′2 (u) + Pz′2 (u)       P ′ (u) · P ′′ (u)  ′ f (u) = √ Px′2 (u) + Py′2 (u) + Pz′2 (u)       ′′ (∥P ′′ (u)∥2 + P ′ (u) · P ′′′ (u))∥P ′ (u)∥ + (P ′ (u) · P ′′ (u))2 /∥P ′ (u)∥   ,  f (u) = ∥P ′ (u)∥2  37  (3.29)  (3.30)  Chapter 3: C3 Tool Tip Position Spline Generation and the higher derivatives of P (u) are found from Eqs. (3.9), (3.10), and (3.11). Setting Eqs.(3.29) to (3.24) at u = 0 and u = 1, the boundary conditions must be met as shown:   a    9       0 0 0 0 0 0 0 0 0 1 a8     0          0  0 0 0 0 0 0 0 1 0 a7   us (0)S          a   u (0)S 2   0 0 0 0 0 0 0 2 0 0    6   ss           3  0 0 0 0 0 0 6 0 0 0 a5  usss (0)S     =   (3.31)           1  1 1 1 1 1 1 1 1 1 1 a4            9    8 7 6 5 4 3 2 1 0  a3   us (1)S         72 56 42 30 20 12 6 2 0 0 a   u (1)S 2     2   ss         usss (1)S 3 504 336 210 120 60 24 6 0 0 0 a1    η Ω a0 As a result, the minimization problem in Eq. 3.28 is augmented to accomodate the boundary conditions imposed by Eq. 3.31: min Je subject to: Ωα = η  (3.32)  which leads to a linear, constrained quadratic minimization problem. The minimization function with the addition of a vector of Lagrange multipliers and constraint conditions results in the new objective function Jf = Je + ΛT (Ωα − η)  (3.33)  To optimize this objective function, the partial derivatives are equated to zero: ∂Jf ∂Jf = 0, = 0, ∂α ∂Λ  38  (3.34)  Chapter 3: C3 Tool Tip Position Spline Generation 1 Initial Iteration Final Iteration  0.9 0.8 0.7  1  u  0.6  3  2  4  (u*j,sj)  0.5 0.4 0.3  5  6  8  7  0.2 0.1 0 0  50  100  150  200  250  300  s [mm]  Figure 3.8: Adaption results of the feed correction polynomial fitting algorithm which result in the following linear equation system       T T T ∗  ΦT u∗ α ΦT Φ ΩT Φ Φα + Ω Λ = Φ u    =  ⇒  η Λ Ω 0 Ωα = η  (3.35)  Since all segment lengths are non-zero the matrix is full rank, and the solution of Eq.(3.35) leads to the normalized coefficients α, which is then used to find the de-normalized coefficients (A9 , A8 , . . . , A0 ) used in predicting u as a function of s from the feed correction polynomial. The process of fitting to (u∗j , sj ) is carried out adaptively for accuracy. The mean squared error (MSE) between the true and predicted spline parameter values (i.e., u∗j and uˆ(sj )) is calculated using MSE =  M ∑ (u∗j − uˆ(sj ))2  M  j=1  39  (3.36)  Chapter 3: C3 Tool Orientation Spline Generation and checked if it is greater than a specified tolerance εM SE . If the tolerance is violated, then the (sj , u∗j ) points are split into two sets of the same size and a spline is fit to each set with the above approach. The division of the point data terminates when all the feed correction polynomials satisfy MSE < εM SE , or when the number of points in the fitting set is equal to the order of the polynomial. Upon convergence, the non-linear relationship between s and u is represented in a C3 9th degree spline u(s). This can be seen in Fig. 3.8. The initial iteration, comprised of a single 9th order polynomial, does not have enough freedom to the data and results in unacceptable errors. Through the adaptive procedure described above, the final iteration converges on a solution comprised of 8 polynomial segments. 3.5 C3 Tool Orientation Spline Generation Besides the tool tip position, a smooth tool C3 orientation spline is also generated successively for tool orientations. 3.5.1 Parametric Orientation Spline Similar to tool tip position, the tool orientation vectors ok = [oi,k , oj,k , ok,k ]T , k = 0, . . . , N , is fitted to a parametric spline O(w). Like the spline fitting for the tooltip position, the objective in fitting the spline for tool orientation is to select the degree, knot vector, W , and control points of the parametric spline. However, since the length of the tool cannot change, the magnitude of the orientation vector must be unity at all times to ensure feasible tool orientations: ∥O(w)∥ = 1, w ∈ [0, 1].  (3.37)  Unlike the fitting of tool tip position data, the tool orientation spline is not fitted directly to the given orientation data. Instead, to ensure that magnitude of the orientation vectors always results in unit magnitude, the tool orientation spline is fitted to spherical coordinates. The 40  Chapter 3: C3 Tool Orientation Spline Generation  Ok  ϕ O  Oj ϕ  O  Figure 3.9: Mappings between spherical coordinates and (θ, ϕ) plane. mapping from the spherical coordinates to a plane (θ, ϕ) is shown in Fig. 3.9 and the following equations: θk = cos−1 (ok,k ) , ϕk = tan−1  oj,k → ϑk = [θk , ϕk ]T , k = 0, . . . , N oi,k  (3.38)  The points on the plane ϑk can be fitted into a B-spline with a similar method as shown in Section 3.4.1. With the knot vector W = [w0 , w1 , . . . , wN +p+1 ] and control points Θi on the (θ, ϕ) plane, the planar B-spline is represented as  Θ(w) =  N ∑ i=0      θ(w)  Ni,p (w)Θi =  ϕ(w)  41  (3.39)  Chapter 3: C3 Tool Orientation Spline Generation where   wi+p+1 − w w − wi   Ni,p−1 (w) − Ni+1,p−1 (w) Ni,p (w) =   wi+p − wi wi+p+1 − wi            1 if wi ≤ w ≤ wi+1 N = i,0       0  otherwise        w ∈ [0, 1]  (3.40)  Since C3 continuity is required for orientation, the degree is set to p = 5. Similar to position interpolation, the knot vector W is solved based on the distribution of the given points. A parameter value w¯k is assigned to each orientation vector ok . The centripetal method [34] is used to assign w¯k , based on the angular change instead of chord length:   w¯0 = 0 w¯N = 1      N  ∑ √  d2 = arccos(ok · ok−1 )  k=1   √    arccos(ok · ok−1 )   w¯k = w ¯k−1 + , k = 1, .., N − 1 d2  (3.41)  Using the assigned parameter values from Eq. 3.41, the knot vector is solved by averaging the assigned parameters as follows:    w = . . . = wp = 0   0  wN +1 = . . . = wN +p+1 = 1  j+p−1 1 ∑   w¯k , j = 1, . . . , N − p   wj+p = p k=j  (3.42)  To solve for the control points Θi in spherical coordinates, the number of basis functions and control points is set equal to the number of tool tip orientations ok . This creates an (N + 1) × (N + 1) linear system to be solved. Since the knot vector W is solved, the basis functions in Eq. (3.39) at any parameter w is known. In addition, since each orientation vector in spherical  42  Chapter 3: C3 Tool Orientation Spline Generation coordinates has been assigned a parameter value w¯k , it is possible to solve for the control points Θi :       N0,n (w ¯0 ) · · · .. ... . N0,n (w ¯N ) · · ·    ΘT0  NN,n (w ¯0 )   .. ..  . .  NN,n (w ¯N ) ΘTN  Φ2    ϑT0         ..  = .     T ϑN  Γ2  Γ2 =    Ψ2  Φ−1 2 Ψ2  (3.43)  The planar B-spline Θ(w) = [θ(w), ϕ(w)]T is obtained from Eq.(3.39). An additional step must be performed to map the planar B-spline to the spherical coordinates. Using the inverse mapping of Eq.(3.38), the tool orientation spline is obtained as       sin(θ(w)) cos(ϕ(w))         O(w) =  Oj (w)  =  sin(θ(w)) sin(ϕ(w))      Ok (w) cos(θ(w)) Oi (w)  (3.44)  3.5.2 Orientation Spline Reparametrization Similar to the tool tip position parameter u, the tool orientation parameter w is to be interpolated as a function of displacement s. However, unlike position spline, there is no explicit relationship relating displacement s to the geometric parameter w, because the orientation of the tool does not affect the displacement of the tool tip. Instead, it is possible to calculate the displacement at each position vector pk , k = 0, . . . , N , using Eqs.(3.19)-(3.21), which corresponds to the displacement at each orientation vector ok and subsequently each parameter w¯k . Using the (sk , w¯k ) data, it is possible to fit a spline that characterizes this non-linear relationship. However, unlike the position spline, the quantity of data is finite, so an alternative fitting 43  Chapter 3: C3 Tool Orientation Spline Generation  w (sk+1,wk+1)  Control coefficients Q0,k+1 ... Q7,k+1  (sk,wk)  Control coefficients Q0,k ... Q7,k  (sk-1,wk-1)  s Figure 3.10: 7th order B´ezier spline and its control coefficients fitted to (sk , w¯k ) data. method is used. Since the arc displacements s are only known at the given tool orientation points, the interpolating spline is fitted so the spline passes through these points. The intervals being interpolated points can be optimized to fulfill monotonicity, C3 continuity and minimize oscillation. A seventh order B´ezier spline approximating the relationship between s and w over the (sk , w¯k ) data, shown in Fig. 3.10, is defined as:  wk (r) =  7 ∑ i=0    7   (1 − r)7−i ri Qi,k , r = s − sk ∈ [0, 1] sk − sk−1 i  (3.45)  which is fitted on each interval [sk−1 , sk ], k = 1, . . . , N . The control coefficients Qi,k are unknown, where i is the index of the coefficients within the segment k. The derivatives of wk (r) are evaluated as: wk′ (r) =  6 ∑ i=0    6 7   (1 − r)6−i ri (Qi+1,k − Qi,k ) i  44  (3.46)  Chapter 3: C3 Tool Orientation Spline Generation   5 wk′′ (r) = 42   (1 − r)5−i ri (Qi+2,k − 2Qi+1,k + Qi,k ) i i=0   4 ∑ 4 wk′′′ (r) = 210   (1 − r)4−i ri (Qi+3,k − 3Qi+2,k + 3Qi+1,k − Qi,k ) i i=0 5 ∑  (3.47)  (3.48)  For the monotonicity condition, the coefficients of wk′ (r) in (3.46) are ensured to be all nonnegative, Q0,k ≤ Q1,k ≤ . . . ≤ Q6,k ≤ Q7,k , k = 1, . . . , N.  (3.49)  and the spline must pass through each (sk , w¯k ). From Eq.(3.45), Q0,k = w ¯k−1 , Q7,k = w ¯k , k = 1, . . . , N. For the C3 continuity condition, from Eqs.(3.46)-(3.48), the constraints are  Q7,k − Q6,k Q1,k+1 − Q0,k+1  =   s −s  sk+1 − sk k k−1    Q − 2Q + Q Q2,k+1 − 2Q1,k+1 + Q0,k+1 7,k 6,k 5,k = (sk − sk−1 )2 (sk+1 − sk )2      Q − 3Q6,k + 3Q5,k − Q4,k Q3,k+1 − 3Q2,k+1 + 3Q1,k+1 − Q0,k+1   7,k = 3 (sk − sk−1 ) (sk+1 − sk )3  (3.50)  (3.51)  for k = 1, . . . , N − 1. Given the constraints in Eq. (3.51), a non-linear minimization problem is formulated to fit the spline. The objective is the minimization of the integral square of jerk of w(s), subjected to constraints in Eqs.(3.49)-(3.51), which fulfill the requirements of monotonicity and continuity up to and including C3 : min JQ = Qi,k  N ∫ ∑ k=1  1  0  45  wk′′′2 dr (sk − sk−1 )6  (3.52)  Chapter 3: C3 Tool Orientation Spline Generation subject to    w¯k−1 ≤ Q1,k ≤ Q2,k . . . ≤ Q6,k ≤ w¯k      Q1,k+1 − w¯k w¯k − Q6,k     sk − sk−1 = sk+1 − sk w¯k − 2Q6,k + Q5,k Q2,k+1 − 2Q1,k+1 + w¯k   =  2  (sk − sk−1 ) (sk+1 − sk )2     Q3,k+1 − 3Q2,k+1 + 3Q1,k+1 − w¯k  w¯k − 3Q6,k + 3Q5,k − Q4,k   = 3 (sk − sk−1 ) (sk+1 − sk )3  (3.53)  In the non-linear optimization problem, the initial values are selected to fulfill the the constraints imposed by Eq.(3.53), which include conditions of monotonicity and C3 continuity.    Q3,k − 3∆k = Q2,k − 2∆k = Q1,k − ∆k = w ¯k−1         Q4,k + 3∆k = Q5,k + 2∆k = Q6,k + ∆k = w ¯k   ∆k = δ(sk − sk−1 )      w¯k − w¯k−1    δ = min 1≤k≤N 7(sk − sk−1 )  (3.54)  Given feasible initial conditions exist, it has been proven that a solution is always possible for this minimization problem. Using the initial values, the minimization problem can be solved using any optimization techniques. In this work, the minimization problem is solved with MATLAB R2011a’s Optimization Toolbox, using the fmincon function with the Interior Point minimization algorithm. Since the spline and constraints have analytic derivatives with respect to the control points to be optimized, it is possible to provide the minimization algorithm with gradients, thus improving the minimization algorithm’s convergence speed dramatically. Expanding upon this fact, it is possible to find an analytic Hessian Matrix, further improving the convergence speed. Once the coefficients Qi,k are found, w is interpolated as a C3 monotonic function of s.  46  Chapter 3: C3 Tool Orientation Spline Generation 0.65  0.6  w  0.55  Converged Solution Initial Guess Actual Data  0.5  0.45  0.4 140  150  160  170  180  190  200  Displacement [mm]  Figure 3.11: Comparison of w(s) with initially guessed control points and converged control points By minimizing the integral square of jerk of w(s), the oscillations in w(s) are minimized. The difference in the initial guess and converged solution can be seen in Fig 3.11. Subsequently, the minimized jerks in w(s) propagate into the jerk of the reference commands as seen in Fig. 3.12. The end result is a smoother profile with lower kinematic demands, allowing for higher feedrates to be achieved  3.5.2.1 Windowing for a High Number of Data In toolpaths with numerous high curvature sections, a large number of G-code points are necessary to capture the geometry. Likewise, long toolpaths will intrinsically have a large number of data. Since the number of spline segments is equal to one less than the number of G-code points, the number of optimization variables grows as the number of G-code points grow. Attempting to optimize the complete spline all at once will prove to be very slow and inefficient due to the large number of optimization variables and constraints that need to be considered (6 × (n − 1) points with 4 constraints). Since the jerk of a spline profile at any region along the toolpath depends primarily on the local and neighboring toolpath geometry, a windowing  47  Chapter 3: C3 Tool Orientation Spline Generation  5  X Axis Jerk [mms]  1  x 10  Converged Solution Initial Guess  0.5  0  −0.5  −1  0  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  4  Y Axis Jerk [mms]  5  x 10  0  −5 0  4  Z Axis Jerk [mms]  5  x 10  0  −5 0  4  A Axis Jerk [mms]  x 10 1 0.5 0 −0.5 −1 0  4  C Axis Jerk [mms]  5  x 10  0  −5 0  Time [s]  Figure 3.12: Comparison of reference jerks with w(s) using initially guessed control points and w(s) using converged control points  48  Chapter 3: C3 Tool Orientation Spline Generation  Optimization Window  w  w  Optimization Window Preserved Continuity  s  s  (a)  (b)  w  w  Preserved Continuity  Optimization Window  Preserved Continuity Optimization Window  s  s (c)  (d)  Figure 3.13: Windowing scheme for generation of Orientation Reparameterization Spline scheme can be used to optimize the jerk of smaller sections in a sequential manner. First, a subset of the (sk , wk ) data is selected and the control points for the spline fitted to the subset is optimized with the objective and constraints described in Section 3.5.2. Following the optimization, another subset which overlaps the previous window is selected. In order to preserve C3 continuity at the start of the optimization window, the first 4 coefficients of the initial splines are left unchanged. This scheme is repeated until the end of the spline is reached and can be seen in Fig. 3.13 If a solution is not found within the present window, the window is expanded to include the previous segment. If the window reaches the beginning of the data set, then the window is expanded forward. The largest window possible incorporates the entire data set, which is guaranteed to have a solution since feasible initial conditions exist. In this thesis, the solution window is started in the forward direction with n = 10 (w, s) data. Upon convergence, the window is moved forward with an overlap of m = 5 from the previous. The first 4 control points  49  Chapter 3: Conclusions of the first overlapped spline are unchanged to preserve continuity between the previously optimized spline and the current window. As the number of data points grows, the improvements in efficiency become more apparent.  3.6 Conclusions In this chapter, a complete spline interpolation methodology is presented for providing smooth reference commands in high speed 5-axis machining. First, the discrete position points generated by the CAM system are fitted to a continuous C3 quintic spline, ensuring jerk continuity. Since the position spline parameter u does not share a linear relationship with displacement s, a function is generated to approximate this function. Expanding on previous work, this approximating function is a 9th order feed correction polynomial that preserves C3 continuity, and is fitted adaptively for accuracy. Similar to fitting of the position spline, the discrete orientation points generated by the CAM system are fitted to a C3 quintic spline. In the case of orientations, the spline is fitted in spherical coordinates to ensure feasible orientations are always achievable. As with the geometric position spline, the orientation spline w does not share a a linear relationship with displacement s and must be approximated. Since orientations do not share an explicit relationship with displacement, an alternative approximating function is necessary. A 7th order B´ezier spline is selected to interpolate known orientations and known displacements. Furthermore, in the fitting process, the jerks in the approximating spline is minimized, thus minimizing actual jerks. The result is an interpolation method that preserves C3 continuity.  50  Chapter 4 Contour Error Pre-compensation 4.1 Overview In addition to providing smooth reference commands, the motion control system must be able to minimize the geometric deviations of the machine tool from the desired toolpath. With respect to 5-axis machining, the three linear drives and two rotary drives must be controlled to minimize geometric deviations from the desired tool position and orientation. The typical approach is to increase the bandwidth of each individual drive, therefore reducing tracking error, and subsequently geometric deviations. However, due to the limited bandwidth and phase lag of feed drives, some error will always exist. In this thesis, a method that minimizes contour errors is proposed In Section 4.2, tool position contour error and tool orientation contour error are defined. Based upon this definition, a methodology for reducing these errors is presented in the rest of the chapter. First, the tracking errors are predicted in Section 4.3. The axis reference position commands are fitted to time splines based upon a predetermined feed profile and application of inverse kinematics since the geometric toolpath presented in Chapter 3 represent the tool orientation and position in 6 degree of freedom Cartesian space. Next, the time splines are provided as an input to the error transfer functions of each axis. An analytical solution is found, providing an accurate model of tracking error for all axes as a function of time. Based upon the tracking error, the position and orientation contour errors are predicted using a numeric method in Section 4.4. This prediction methodology is then used in a two step pre-compensation 51  Chapter 4: Definition of Position and Orientation Contour Errors Reference Toolpath  Pref  Ok  Z  Oact  On  ep o  eo  Pn  Oref  p  Oj  Pact Reference Toolpath  X  Y  Oi  (a)  (b)  Figure 4.1: Tool position and orientation contour errors algorithm in Section 4.5 to eliminate orientation and position contour error in a feed forward fashion.  4.2 Definition of Position and Orientation Contour Errors In the machining process, two types of errors can be defined. The first type is the tracking error, which is defined as the difference between the reference command and the actual position of the tooltip and can be expressed as: e = [eX , eY , eZ , eA , eC ] = q ref −q = [Xref −X, Yref −Y, Zref −Z, Aref −A, Cref −C] (4.1) where q ref = [Xref , Yref , Zref , Aref , Cref ] and q = [X, Y, Z, A, C] are the reference and actual position of the tool respectively. However, tracking error is only relevant to the individual axes and is not a true representation of the actual geometric deviation of the tool from the intended path. In addition to this, the tracking errors for the individual drives in a 5-axis machine may be transformed into very different geometric deviations due to the non-linear relationship 52  Chapter 4: Definition of Position and Orientation Contour Errors between the tooltip and the axis commands. A more useful metric is the contour error, which is defined as the deviation of the actual tool position and orientation from the reference position and orientation. The difference between tracking error and contour error can be seen in Fig. 4.1, where ep and eo are the position and orientation tracking errors respectively. Typically, the position contour error is as illustrated in Fig. 4.1(a) and expressed as: ϵp = [ϵx,p , ϵy,p , ϵz,p ] = P n − P act = [Px,n − Px,act , Py,n − Py,act , Pz,n − Pz,act ]  (4.2)  where P n = [Px,n , Py,n , Pz,n ] is a position on the reference toolpath which is closest to the actual position P act = [Px,act , Py,act , Pz,act ]. Specific to 5-axis machining, the tool may also have geometric deviations from the intended tool orientation. In this thesis, the tool orientation contour error is defined in the same way as shown in [36]. The orientation of the tool can be represented as a trajectory on the unit sphere since |O| = 1. The orientation contour error is shown in Fig. 4.1(b) and can be expressed as: ϵo = arccos (O act · O n )  (4.3)  where O n = [Oi,n , Oj,n , Ok,n ] is an orientation on the reference toolpath which has the closest geodesic distance to the actual orientation, O act = [Oi,act , Oj,act , Ok,act ], on the unit sphere. At present there is no straightforward method to analytically find these contour errors for free form toolpaths. An iterative method proposed by Erkorkmaz et al. [37] could be used to search for the nearest point. However, the method is computationally expensive, does not take advantage of the spline data, and only addresses tooltip position. An analytic method to estimate the contour error for free form five axis toolpaths is proposed by Sencer et al. [38]. Though this method is appropriate for the real-time minimization of contour errors [38], the estimation is prone to errors at high speeds, high curvatures, and low sampling times. In the following  53  Chapter 4: Tracking Error Prediction chapters, a novel method for predicting and compensation of position and orientation contour errors, given a spline toolpath, is presented.  4.3 Tracking Error Prediction Since contour errors are the result of tracking errors, then in order to predict contour error the tracking error must be predicted accurately first. As mentioned, tracking errors are a function of time, and as a result, the input reference commands must first be expressed as a function of time. Following Chapter 3, the toolpath is represented in spline form as a function of displacement s. Using this geometric representation, in conjunction with a time-based displacement profile, s(t), [39–41], tooltip position and orientation can be expressed as a function of time in the workpiece coordinate system (P-system): P (t) = [Px (t), Py (t), Pz (t)]T ,  (4.4)  O(t) = [Oi (t), Oj (t), Ok (t)]T , ∥O∥ = 1.  (4.5)  In order to obtain the corresponding reference commands in the machine coordinate system (M-system), inverse kinematics are applied to the desired tool position and orientation [Px (t), Py (t), Pz (t), Oi (t), Oj (t), Ok (t)]. In this thesis, a 5-axis tilting-table configuration is used as shown in Fig. 5.1 and its kinematic configuration shown in Fig. 4.2. The inverse  54  Chapter 4: Tracking Error Prediction  PͲsystem  Direct kinematics MͲsystem ࢗ ൌ ሾܺǡ ܻǡ ܼǡ ‫ܣ‬ǡ ‫ܥ‬ሿ்  ࡼ ൌ ൣܲ௫ ǡ ܲ௬ ǡ ܲ௭ ൧  ் ்  ࡻ ൌ ൣܱ௜ ǡ ܱ௝ ǡ ܱ௞ ൧  Inverse kinematics  Z Tool  C  ܲ௬  ‫ܮ‬௔௖ǡ௭   ܲ௭  Workpiece  ‫் ܮ‬௬௔ǡ௭  ܲ௫  Table  A X  Y  Figure 4.2: Five-axis machine tool configuration.  a-axis  Lac,z LTya,z  Figure 4.3: Offsets of the rotary table that are included in the kinematic calculations for 5-axis rotary table kinematic configuration 55  Chapter 4: Tracking Error Prediction kinematic of this kinematic configuration is as follows [41]:    A(t) = arccos(Ok (t))        C(t) = arctan(Oi (t)/Oj (t))         X(t) = − cos(C(t))Px (t) − sin(C(t))Py (t)    Y (t) = cos(A(t)) sin(C(t))Px (t) − cos(A(t)) cos(C(t))Py (t) . . .       − sin(A(t))Pz (t) − sin(A(t))Lac,z        Z(t) = sin(A(t)) sin(C(t))Px (t) − sin(A(t)) cos(C(t))Py (t) . . .        + cos(A(t))Pz (t) + cos(A(t))Lac,z + LT ya,z  (4.6)  where X(t), Y (t), Z(t) correspond to the Cartesian axes of the machine, and A(t), C(t) are the commands to the primary and secondary axes of the rotary table, respectively. In Eq. (4.6) Lac,z and LT ya,z are offsets of the rotary table which are identified in Fig. 4.3. Generally, the M-system position commands for the physical feed-drives of the machine tool can be expressed as a vector: q(t) = [X(t), Y (t), Z(t), A(t), C(t)]T .  (4.7)  The displacement profile s(t) is applied to interpolation scheme presented in Chapter 3, followed by inverse kinematics at the sampling time of the servoloop. This yields a series of discrete axis position commands at each control interval (Ts ), i.e. for X-axis: Xref = [X(0), X(1), X(2), . . . , X(Ns )],  (4.8)  where Ns is the number of discrete steps and tf = Ns Ts is the total path travel time. The discrete axis position commands must first be fitted into a continuous analytic form in order to obtain an analytical solution of tracking error on each axis. In this thesis, a C3 quintic spline is  56  Chapter 4: Tracking Error Prediction  Input: axis position commands Xref = [X(0), X(ts), ... , X(Ns)] Spline fitting data: (t0, x0), (t1, x1), ... , (tn, xn) Add the point with maximum error to the spline fitting data  Fit C3 quintic spline to the data with minimum jerk Within the tolerance  ?  No  Yes C3 quintic spline S(t) Solve the differential equation for tracking error Je + (B+Kkd)e + Kkpe + Kkie = JX + BX  Output: analytical tracking error e(t)  Figure 4.4: Tracking error prediction model. used as the fitting spline to maintain jerk continuity imposed by the interpolation algorithm in Chapter 3. The method used for fitting is introduced in the following section.  4.3.1 Fitting a Quintic Time Spline to Axis Position Commands In order to predict the tracking errors analytically, the reference commands must also have an analytic form. The axis position commands within a toolpath segment are first fitted to a C3 quintic spline iteratively within a tolerance ε, i.e., within an encoder resolution. The time stamped position commands from Eq. (4.8) are subdivided into n coarse segments but with equal time length as shown in Fig. 4.5, where each segment may initially contains i.e. 50 reference position commands (n = ⌊Ns /50⌋). The objective is to describe the position commands interpolated at the sampling frequency of the servoloop, by a small number of piecewise, analytical splines, without having to consider all points in the reference trajectory  57  Chapter 4: Tracking Error Prediction (Eq. (4.8)). If n + 1 equally time spaced x-axis positions (x0 , x1 , . . . , xn ) are initially selected from Xref (Eq.(4.8)), the quintic spline for segment (i) can be expressed piecewise as Si (t) = b5,i t5 +b4,i t4 +b3,i t3 +b2,i t2 +b1,i t+b0,i , t ∈ [0, hi ]; S ∈ {SX , SY , SZ , SA , SC } (4.9) where time interval in spline segment i is hi = ti − ti−1 , i = 1, . . . , n and 0 = t0 < t1 < . . . < tn = tf . The coefficients in Eq. (4.9) are to be determined for each segment hi for n number of sub-spline segments. Once the spline coefficients are determined using the method explained below, the error between each reference position point and its corresponding value predicted by the spline is checked. The point with the highest error in the entire trajectory (Eq. (4.8)) is added to the spline fitting data, and the process is iteratively continued until all points are predicted by the spline within the tolerance ε. Depending on the curvature, a trajectory with 2000 points may be represented by a spline fitted to only 80 ∼ 100 points in the set. The spline coefficients are identified by minimizing the integral of square of axis jerk as proposed in [39],  ∫  tf  J=  ... 2 S (t) dt  (4.10)  0  while respecting the continuity of jerk, acceleration and velocity at the transition points of spline segments. The overall jerk objective in Eq. (4.10) can be split into spline segments as: ∫ J= 0  h1  ... 2 S 1 (t) dt + . . . +  ∫  hn 0  58  ... 2 S n (t) dt := J1 + . . . + Jn .  (4.11)  Chapter 4: Tracking Error Prediction The i-th local objective can be derived as: ∫ hi Ji = (60b5,i t2 + 24b4,i t + 6b3,i )2 dt 0  = 720b25,i h5i + 720b5,i b4,i h4i + (240b5,i b3,i + 192b23,i )h3i + 144b4,i b3,i h2i + 36b23,i hi    5 4 3 b 1440hi 720hi 240hi 0 0 0   5,i        720h4i 384h3i 144h2i 0 0 0 b4,i        3 2    1  240hi 144hi 72hi 0 0 0 b3,i  = [b5,i b4,i b3,i b2,i b1,i b0,i ]     b   0 2 0 0 0 0 0    2,i        0 0 0 0 0 b1,i   0    b0,i 0 0 0 0 0 0  (4.12)  1 := β Ti Hi β i . 2 From Eqs. (4.11) and (4.12), the overall jerk objective in entire reference trajectory (Eq. (4.10)) can be evaluated by assembling local objective functions of all spline segments as:    H β  1   1 1 T 1    .  .. J = [β 1 . . . β Tn ]    ..  := β T Hβ. . 2 2    Hn βn  (4.13)  The vector β contains the coefficients of all spline segments S(t) (Eq. (4.9)). The quintic spline has to pass through the reference points used in the fitting process (t0 , x0 ), (t1 , x1 ), . . . , (tn , xn ). For the i-th segment, the following position boundary conditions need to hold, i.e., for x-axis: Si (0) = xi−1 , Si (hi ) = xi , which can be written as     0 0 0 0 0  h5i h4i h3i h2i hi 59    x 1  β i =  i−1  . 1 xi  (4.14)  (4.15)  Chapter 4: Tracking Error Prediction Denoting the matrix on the left hand side of Eq. (4.15) as L0i , and the right hand side as ξ 0i , the knot position constraints from all segments can be written as    L0  1  ..  .      β1 ξ0     1   ..   ..   .  =  . ,     0 Ln βn ξ 0n  (4.16)  L0 β = ξ 0 .  (4.17)  which is denoted as  The velocity, acceleration and jerk continuity constraints at the point (ti , xi ) can be written as:    S˙ i (hi ) − S˙ i+1 (0) = 0,    (4.18) S¨i (hi ) − S¨i+1 (0) = 0,      ... (h ) − ... (0) = 0, S i+1 Si i which can be expanded as   5h4i  4h3i  3h2i     20h3i 12h2i 6hi  60h2i 24hi 6  2hi 2 0     ..   1 0 . 0 0 0 0 −1 0 0    β i   . = 0 . 0 0 .. 0 0 0 −2 0 0      β i+1 . 0 0 0 .. 0 0 −6 0 0 0  (4.19)  Denoting the matrix on the left hand side of Eq. (4.19) as [L1i L∗ ], the derivative boundary condition are grouped together as  1 ∗ L1 L   L12 L∗   ..  .      ..  .  L1n−1       β1  0    β      2   ..  ,   .  = .   ..        0 3(n−1)×1 βn L∗  60  (4.20)  Chapter 4: Tracking Error Prediction X  } Maximum Error x1  x2  S2(t)  xn-2  S1(t)  xn-1 Sn-1(t) xn = X(Ns)  Sn(t) x0 = X(0) 0 = t0  h1  t1  h2  t2  ...  tn-2  hn-1  tn-1  hn  tn  Figure 4.5: Axis position fitting. which is denoted as L1 β = ξ 1 .  (4.21)  Setting the initial velocity, acceleration and jerk to be zero, the following conditions need to hold: ... S˙ 1 (0) = S¨1 (0) = S 1 (0) = 0,  (4.22)       . 0 0 0 0 1 0 .. β 0    1     .    . 0 0 0 2 0 0 .. 03×6(n−1)   ..  = 0 .      .. 0 0 6 0 0 0 . βn 0  (4.23)  L2 β = ξ 2 .  (4.24)  which can be expanded as  Denote Eq. (4.23) as  61  Chapter 4: Tracking Error Prediction Similarly, by setting the final velocity, acceleration and jerk to be zero, the following conditions need to hold: ... S˙ n (hn ) = S¨n (hn ) = S n (hn ) = 0,  (4.25)  which can be expanded as    03×6(n−1)       .. β 0 . 5h4n 4h3n 3h2n 2hn 1 0   1    .    .. . 20h3n 12h2n 6hn 2 0 0  ..  = 0 .     .. . 60h2n 24hn 6 0 0 0 βn 0  (4.26)  Denote Eq. (4.26) as: L3 β = ξ 3 .  (4.27)  By combining all the constrains expressed in Eqs. (4.17), (4.21), (4.24) and (4.27) together in the following form: Lβ = ξ where  (4.28)  [ ]T [ ]T L = L0 L1 L2 L3 , ξ = ξ 0 ξ 1 ξ 2 ξ 3 ,  the minimum jerk optimization problem can now be expressed as 1 min J = β T Hβ subject to: Lβ − ξ = 0. β 2  (4.29)  The above constrained quadratic minimization problem is solved using Lagrange Multiplier method. Introducing the vector of Lagrange Multiplier Λ, the augmented objective function is written as 1 J′ (β, Λ) = β T Hβ + ΛT (Lβ − ξ). 2  62  (4.30)  Chapter 4: Tracking Error Prediction  X  e  u ki kp+ s +kds  ka  i  kt  T  1 Js+B  1 θ rg s  x  Figure 4.6: Block diagram for the PID controller and x-axis drive. Equating ∂J′ /∂β = 0 and ∂J′ /∂Λ = 0 yields the linear equation system      H LT β 0    =  . L 0 Λ ξ  (4.31)  The solution of linear equations (Eq. (4.31)) yields the coefficients β of S(t), which has a third order continuity and minimized jerk. The fitting errors (see Fig. 4.5) from the reference positions Xref to spline S(t) are calculated in each iteration for each axis. If the maximum error is less than the tolerance ε, the fitting process is completed. Otherwise, as shown in Fig. 4.4, the reference point which has the maximum error is inserted to the spline fitting points, and the process is repeated until the errors are within tolerance ε. Finally, a C3 quintic spline for each of the five axes is obtained with m sub-spline segments (Eq. (4.9)).  4.3.2 Analytical Solution of Tracking Error Given the time-based reference commands found in Section 4.3.1, the tracking error can be found analytically for a five-axis machine tool with linear characteristics. In this thesis, three linear and two rotary drives controlled by proportional-derivative-integral (PID) controllers are considered as shown in Fig. 4.6. For the simplicity of the tracking error prediction model, only the rigid body machine dynamics is considered, and the cutting force disturbances are neglected since ball screw drives reduce the effect significantly. To accomodate non-linear fric63  Chapter 4: Tracking Error Prediction tion affects, the Stribeck friction in the drives are identified and compensated in a feed-forward block. As a result, expected non-linear affects are compensated for, leaving a linear model, which is required for the analytical solution of tracking errors to be effective. In Fig. 4.6, the tracking error e = X − x is the difference between the commanded and actual axis positions. The current amplifier has a gain of ka and the torque constant of the motor is kt . The equivalent inertia and viscous damping reflected at the motor shaft are J and B, respectively. The ball screw transmission gain from angular to linear motion is rg . The transfer function between the actual position of the drive (x) and the reference input (X) can be expressed in the Laplace domain as (Fig. 4.6): x(s) K(kd s2 + kp s + ki ) = 3 . X(s) Js + (B + Kkd )s2 + Kkp s + Kki  (4.32)  where K = ka kt rg . The three poles of the transfer function (Eq. (4.32)) are denoted as λ1 , λ2 , and λ3 respectively, which are assumed to be all distinct. The transfer function between the tracking error (e(s) = X(s) − x(s)) can be evaluated from Eq. (4.32) as: e(s) Js3 + Bs2 = 3 . X(s) Js + (B + Kkd )s2 + Kkp s + Kki  (4.33)  which can be expressed as an equivalent differential equation in time domain as: ... ... ¨ J e (t) + (B + Kkd )¨ e(t) + Kkp e(t) ˙ + Kki e(t) = J X (t) + B X(t).  (4.34)  The linear differential equation (Eq. (4.34)) with constant coefficients has homogenous and particular solutions [42]. Since the reference positions X(t) are expressed by piecewise quintic polynomials as shown in Eq. (4.9), the right hand side of Eq. (4.34) is a cubic polynomial which yields to a particular solution in the following form: eˆi (t) = d3,i t3 + d2,i t2 + d1,i t + d0,i 64  (4.35)  Chapter 4: Tracking Error Prediction at each time segment [0, hi ], i = 1, . . . , m. Substituting the undetermined solution (Eq. (4.35)) into Eq. (4.34), and equating the coefficients of terms 1, t, t2 , t3 on each side of the equation, the following needs to hold:      6J  d0,i   2b2,i B + 6b3,i J  Kki Kkp 2(B + Kkd )           0 Kki 2Kkp 6(B + Kkd )  d1,i   6b3,i B + 24b4,i J   ,   =    d  12b B + 60b J   0 0 Kk 3Kk   2,i   4,i  5,i  i p      d3,i 20b5,i B 0 0 0 Kki  (4.36)  which yields to the solution of coefficients (d0,i , d1,i , d2,i , d3,i ). By combining homogenous (µ1,i eλ1 t + µ2,i eλ2 t + µ3,i eλ3 t ) and particular solutions, the general solution of Eq. (4.34) can be expressed at each time interval [0, hi ] as: ei (t) = eˆi (t) + µ1,i eλ1 t + µ2,i eλ2 t + µ3,i eλ3 t , t ∈ [0, hi ],  (4.37)  where µ1,i , µ2,i and µ3,i are undetermined integration constants on i-th time interval. For preserving continuity up to the second derivative of e(t), each two consecutive segments ei (t) and ei+1 (t) need to have the same value at the junctions, as well as their first and second derivatives. Consequently, the following equations should hold for i = 1, . . . , m − 1:     ei (hi ) = ei+1 (0),   e˙ i (hi ) = e˙ i+1 (0),      e¨ (h ) = e¨ (0). i i i+1 Substituting Eq. (4.37) into Eq. (4.38),  −1       eˆi (hi ) − eˆi+1 (0) 1 1 1 µ1,i eλ1 hi µ1,i+1           ˙      λ h 2 ˙ i µ2,i+1  = µ2,i e  + λ1 λ2 λ3  eˆi (hi ) − eˆi+1 (0) ,         2 2 2 λ3 hi ¨ ¨ eˆi (hi ) − eˆi+1 (0) λ1 λ2 λ3 µ3,i e µ3,i+1 65  (4.38)  (4.39)  Chapter 4: Prediction of Contour Errors Reference Toolpath  Reference Toolpath  Pref  Z  Ok  Ocomp + Oact  Oref Oc  Oc Oact  Pn  εp  Ocomp  Oact  On  εo  Pact O  Y X  Ocomp  Oj  Oi  (a)  (b)  O  (c)  Figure 4.7: Tool tip position and orientation contour errors. which holds for the segments i = 1, . . . , m − 1. With the initial conditions e(0) = e(0) ˙ = e¨(0) = 0 on the first time interval [0, h1 ], Eq. (4.37) yields the initial integration constants as:    −1   µ 1 1 1 eˆ (0)  1,1     1      ˙  µ2,1  = − λ1 λ2 λ3  eˆ1 (0) .       2 2 2 ¨ µ3,1 λ1 λ2 λ3 eˆ1 (0)  (4.40)  The integration constants µ1,i , µ2,i and µ3,i at the remaining segments can be obtained recursively from Eq. (4.39) and Eq. (4.40), which give the analytical expression of tracking errors e(t) for each axis (Eq. (4.37)).  4.4 Prediction of Contour Errors As shown in Section 4.2, the contouring error has two components: the tool tip contour error εp and tool orientation error εo . Given the geometric reference tool tip positions and tool orientations, represented by splines P (u) and O(w) respectively, it is possible to predict the contouring errors in five-axis machining using the analytical model of the axis tracking errors from the previous section (Eq. (4.37)).  66  Chapter 4: Prediction of Contour Errors Let the reference and actual tool tip positions be denoted as P ref and P act , respectively, as shown in Fig. 4.7 (a). P n is the point on the reference spline toolpath P (u) which is closest to the actual tool tip position (P act ). The corresponding tool tip contour error vector is defined as P n − P act . Since contour error is defined as the shortest distance between the actual tool position and the reference toolpath, the contour error should be orthogonal to the tangent vector of the reference toolpath,  d P (u), du  at P n . As a result, P n can be found by finding the geometric  paramater u where the dot product of the tangent and the contour error are zero: dP (u) · (P (u) − P act ) = 0, u ∈ [0, 1], du  (4.41)  Eq. (4.41) can be solved numerically by the Newton Raphson iteration method: ui+1 = ui −  f (u) df (u) du  = ui −  dP (u) (P (u) du d2 P (u) du2  − P act  (P (u) − P act ) + | dPdu(u) |2  .  (4.42)  The convergence of Eq. (4.42) is dependent on the initial guess. In this thesis, the initial guess is the geometric parameter at the respective time stamp. To check if Eq. (4.42) has converged the following condition is checked: dP (u) (P (u) − P act ) du | dPdu(u) ||(P (u) − P act )|  ≤ ε1  (4.43)  where ϵ1 is a zero tolerance indicating convergence. In this work, 10−8 is selected as a sufficiently small value for ε1 . Upon convergence of the Newton Raphson equation, u∗ , i.e. P n = P (u∗ ) is found. The tool tip contour error is then evaluated as: εp = ∥P (u∗ ) − P act ∥.  (4.44)  Similarly, the reference and actual tool orientations are denoted as O ref and O act , respectively, as shown in Fig. 4.7(b). O n is the closest point from O act to the reference orientation contour O(w) in spherical coordinates. The corresponding orientation contour error is the arc length 67  Chapter 4: Prediction of Contour Errors ⌢  of O act O n , i.e. the angular change from O act to O n , which is arccos(O act · O n ). Similar to the position contour error, the orientation contour error should be orthogonal to the tangent vector of the reference toolpath. It is possible to adapt the solution of position contour error to the unit sphere, thus solving orientation contour errors. A plane must be found, determined by O act , O n , and the origin O, that is perpendicular to the tangent vector O ′ (w) = the orientation contour at O n . This can be found by solving Eq. (4.45):  dO(w)   · O(w) = 0 dw   dO(w) · O = 0 act dw  d O(w) dw  of  (4.45)  If both equalities are fulfilled, the result is a plane orthogonal to O ′ (w). As a result, the arc distance between O(w) and O act will also be orthogonal to O ′ (w). This is illustrated in Fig. 4.8. Since O(w) is always orthogonal to O ′ (w), a w must be found so that O act is perpendicular to the tangent vector O ′ (w) at O n . The point O n can be found by solving: O ′ (w) · O act = 0, w ∈ [0, 1],  (4.46)  Like the solution of the position contour error, Eq. (4.46) can be solved numerically by the Newton Raphson iteration method. wi+1 = wi −  g(w) dg(w) dw  = wi −  O ′ (w) · O act . O ′′ (w) · O act  (4.47)  Similar to finding position contour error, the initial guess of Eq. (4.47) is the geometric parameter at the respective time stamp. To check if Eq. (4.47) has converged the following condition is checked:  O ′ (w) · O act ≤ ε2 |O ′ (w) · O act |  68  (4.48)  Chapter 4: Compensation of Contour Errors  Ok On  Oact  O'n  O'n  Oj O  Oi Figure 4.8: Orthogonality of On and Oact to O’n where ε2 is a zero tolerance for orientations indicating convergence. In this work, 10−8 is selected as a sufficiently small value for ϵ1 . Convergence yields the corresponding orientation spline parameter w∗ , i.e. O n = O(w∗ ). The tool orientation contour error becomes: εo = arccos(O act · O(w∗ )).  (4.49)  4.5 Compensation of Contour Errors From the above sections, a methodology has been developed to predict position and orientation contour errors based upon predicted tracking errors. Given these predictions, it is possible to modify the original trajectory to compensate for these contour errors. In the proposed strategy, the contour error is simply added to the reference command as shown in Fig. 4.7 . However, the proposed strategy must be extended to account for the non-linear relationship between the M-system and P-system and to accommodate the compensation for spherical coordinates. The result is modified reference commands for each of the servo drives that correct the geometric  69  Chapter 4: Compensation of Contour Errors qref  Tracking error prediction  Tracking error prediction  q1  q2  Direct kinematics  O1  Orientation contour error compensation  Ocomp  Inverse kinematics  Pref  q3 Direct kinematics  P3  Tool tip contour error compensation  Inverse kinematics  qcomp  Pcomp  Figure 4.9: Contouring errors pre-compensation strategy. deviation of the tooltip in position and orientations. Since the reference commands for each servo drive (M-system) is modified to compensate for geometric errors in tooltip position and orientation (P-system), it is important to know how the commanded references affect tooltip position and tool orientation. Similar to inverse kinematics (Eq. (4.6)), corresponding tool tip and tool orientations in the P-system, from axes reference commands in the M-system, can be found through forward kinematics. For the kinematic configuration in this thesis the forward kinematics is as follows [41]:    Oi = sin(A) sin(C)        Oj = sin(A) cos(C)        Ok = cos(A)   Px = − cos(C)X + sin(C) cos(A)Y + sin(A) sin(C)Z − sin(C) sin(A)LT ya,z         Py = − sin(C)X − cos(C) cos(A)Y − sin(A) cos(C)Z + cos(C) sin(A)LT ya,z       P = − sin(A)Y + cos(A)Z − cos(A)L z T ya,z − Lac,z  (4.50)  where Lac,z and LT ya,z are offsets determined by the rotary table as shown in Fig. 4.3. As it can be seen from Eq. (4.50), the tooltip position can be changed by any combination of the three 70  Chapter 4: Compensation of Contour Errors linear axes and two rotary axes. In contrast, the tool orientation can only be changed by the two rotary axes. This is typical for most 5-axis CNC machines. Hence, in the proposed strategy, the reference commands are modified first to compensate for orientation contour errors. The reference commands are then modified again to compensate for position contour errors, thus taking advantage of the decoupled nature of the tool orientation and linear axes. The proposed strategy in compensating tool tip and tool orientation errors is outlined in Fig. 4.9, and detailed below. Starting with the tracking errors of all five drives, they have been analytically modeled in Section 4.3 from the closed loop transfer functions as: e(t) = [ex (t), ey (t), ez (t), ea (t), ec (t)]T .  (4.51)  The actual positions (q 1 ) of the drives can be predicted as: q 1 = q ref − e ← q ref = [Xref , Yref , Zref , Aref , Cref ]T  (4.52)  where q ref is the reference five-axis position command vector. Using the direct kinematics transformation (Eq. (4.50)) for q 1 , the predicted tool orientation is obtained and denoted as O1 :     Oi,1 = sin(A1 ) sin(C1 )    Oj,1 = sin(A1 ) cos(C1 )      O = cos(A ) k,1 1  (4.53)  In Fig. 4.7 (b), O ref is the reference tool orientation; O n is calculated by solving Eq. (4.46); O act = O 1 ; and O comp is the pre-compensated tool orientation that needs to be determined using a “spherical parallelogram”. As shown in Fig. 4.7 (b), O ref , O act , O n , and O comp are  71  Chapter 4: Compensation of Contour Errors four vertexes of the spherical parallelogram, whose center is denoted as O c . The center is ⌢  ⌢  defined as the midpoint of the circle arc O ref O n (and O comp O act ) and obtained from: Oc =  O ref + O n O comp + O act = . ∥O ref + O n ∥ ∥O comp + O act ∥  (4.54)  As shown in Fig. 4.7(c), the length of the projection of O act on O c is ∥O comp +O act ∥/2, which can also be obtained from inner product O act · O c since O act and O c are both unit vectors. The relationships yield to: ∥O comp + O act ∥ = 2(O act · O c ).  (4.55)  From Eqs. (4.54) and (4.55), O comp is obtained as: O comp = ∥O comp + O act ∥O c − O act = 2(O act · O c )O c − O act .  (4.56)  Since the reference commands for all five axes will change due to coupled kinematics after modifying the tool orientations, the tracking error prediction needs to be updated after finding tool tip contour error pre-compensation. Using the inverse kinematics transformation Eq. (4.6) with the reference tool tip position P ref and the pre-compensated tool orientation O comp , the new five-axis reference positions q 2 are obtained:    A2 = arccos(Ok,comp )        C2 = arctan(Oi,comp /Oj,comp )         X2 = − cos(C2 )Px,ref − sin(C2 )Py,ref    Y2 = cos(A2 ) sin(C2 )Px,ref − cos(A2 ) cos(C2 )Py,ref . . .       − sin(A2 )Pz,ref − sin(A2 )Lac,z        Z2 = sin(A2 ) sin(C2 )Px,ref − sin(A2 ) cos(C2 )Py,ref . . .        + cos(A2 )Pz,ref + cos(A2 )Lac,z + LT ya,z 72  (4.57)  Chapter 4: Compensation of Contour Errors Again, taking the modified reference trajectory, q 2 , as the input of the tracking error prediction algorithm, the tracking error using the modified trajectory, e2 , is found. The actual five-axis positions are predicted as q 3 by considering the transfer functions of the drives (Eq. (4.32)). q 3 = q 2 − e2 ← q 2 = [X2 , Y2 , Z2 , A2 , C2 ]T  (4.58)  Applying the direct kinematics transformation (Eq. (4.50)) on q 3 , the re-predicted tool tip position is obtained as P 3 :    Px,3 = − cos(C3 )X3 + sin(C3 ) cos(A3 )Y3 + sin(A3 ) sin(C3 )Z3 − sin(C3 ) sin(A3 )LT ya,z    Py,3 = − sin(C3 )X3 − cos(C3 ) cos(A3 )Y3 − sin(A3 ) cos(C3 )Z3 + cos(C3 ) sin(A3 )LT ya,z      P = − sin(A )Y + cos(A )Z − cos(A )L z,3 3 3 3 3 3 T ya,z − Lac,z (4.59) It should be noted that In Fig. 4.7(a), P ref is the reference tool tip position; P n is calculated from Eq. (4.41); and P act = P 3 . The final pre-compensated tool tip position P comp is determined by adding the contour error vector P n − P act to the reference P ref as: P comp = P ref + P n − P act .  (4.60)  Finally, by applying the inverse kinematics transformation (Eq. (4.6)) on the pre-compensated tool tip position P comp and tool orientation O comp , the pre-compensated five-axis position com-  73  Chapter 4: Conclusions mand q comp is calculated:    Acomp = arccos(Ok,comp )        Ccomp = arctan(Oi,comp /Oj,comp )         Xcomp = − cos(Ccomp )Px,comp − sin(C2 )Py,comp    Ycomp = cos(Acomp ) sin(Ccomp )Px,comp − cos(Acomp ) cos(Ccomp )Py,comp . . .       − sin(Acomp )Pz,comp − sin(Acomp )Lac,z        Zcomp = sin(Acomp ) sin(Ccomp )Px,comp − sin(Acomp ) cos(Ccomp )Py,comp . . .        + cos(Acomp )Pz,comp + cos(Acomp )Lac,z + LT ya,z  (4.61)  Theoretically, using the modified five-axis position command will lead the machine to follow the desired trajectory more closely since the effects of servo drive tracking errors on the path contouring are pre-compensated by modifying the original drive commands.  4.6 Conclusions In this chapter, a methodology is presented for modelling and compensation of contour errors. Due to the phase lag of the servo drives, the tool will deviate from the reference position and orientation. However, given servo drives with linear characteristics and a time based reference commands, it is possible to model these deviations and compensate for them. First, time stamped reference commands are fitted to C3 quintic splines that are a function of time, giving an analytic and continuous representation of the reference commands while preserving the continuity developed in the previous chapter. Using this continuous representation as the input into the servo drive’s transfer function, the linear ordinary differential equation is solved for the modelling of tracking errors. Based upon these tracking errors, the contour errors, both in position and orientation, are solved using an iterative method. Once the contour errors are solved, a two stage algorithm is performed to compensate for orientation and position contour 74  Chapter 4: Conclusions errors. Since orientations are decoupled from the linear axes, the rotary commands are first modified to compensate for orientation contour errors. Next, the positions are compensated, leaving the compensated orientations unaffected.  75  Chapter 5 Simulations and Experiments 5.1 Overview In the following section, the smooth spline interpolation and pre-compensation algorithms presented in this thesis are validated through simulations and experiments. Implementation details, simulation results, and experiment results for each of the proposed methodologies are presented seperately. To verify their efficacy, the results of the proposed algorithms are compared with existing methodologies. This chapter is organized as follows: First, a description of the experimental test platform is given in Section 5.2. Experimental and simulation results of the smooth spline interpolation algorithm and pre-compensation algorithm are presented and discussed in Section 5.3 and Section 5.4 respectively. The chapter concludes with a summary in Section 5.5.  5.2 Experimental Test Bed In this thesis, the algorithms are experimentally verified on a Fadal 2216 Vertical Machining Center (VMC) retrofitted with a Nikken 5AX-130 compact tilting rotary table. The kinematic conguration can be seen in Fig. 4.2, and the transformations from M-system and P-system are described in Chapter 4. Specific to this configuration, the offsets Lac,z and LT ya,z , as shown in Fig. 4.3, are 70mm and 150mm respectively. In order to implement the control law for the axis of the drives an open real-time controller, dSPACE, is used. This allows for rapid implementation of controllers and trajectory generation algorithms. For all experiments, the 76  Chapter 5: Experimental Test Bed  Table 5.1: Plant parameters for Fadal VMC 2216 Parameters  X-axis  Y-axis  Z-axis  A-axis  C-axis  ka [A/V]  6.5723  6.2274  6.4841  1.2700  1.2700  kt [Nm/A]  0.4769  0.4769  0.4769  0.3333  0.3333  rg [mm/rad]  1.5915  1.5915  1.2732  0.0056  0.0111  J [kgm2 ]  7.0028e-3  8.1904e-3  7.6715e-3  8.1068e-5  2.2122e-4  B [kgm2 /s]  0.023569  0.043009  0.032328  0.001100  0.002900  Workstation PC - Read NC-Program - Generate Trajectories - Uncompensated - Pre-compensated PCI Bus (Reference Commands)  dSPACE Real Time Control (1kHz) - Position Control (PID), Feed-forward Friction Compensation - Read ADC - Quadrature Encoder decoding - Write DAC  Encoder Feedback Motor Current Command  Figure 5.1: Experimental setup  77  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation  Non-linear Friction Effects  xref  +  -  PID  Ka  uc  Kt +  -  1 Js+B  1 s  x  Ts  Physical Plant  Digital Control  Figure 5.2: Control Law for 5-Axis Spline Parameterization and Inteprolation Experiments control laws implemented in dSPACE are standard proportional, integral and derivative (PID) controllers at a sampling frequency of 1kHz. The PID gains are configured so all axis have matching dynamics in order to minimize contour errors [25]. The gains in each series of tests are varied for illustrative purposes. Furthermore, for the contour error pre-compensation tests, a feed forward friction compensation control law is implemented to remove non-linear friction affects. The full setup can be seen in Fig. 5.1. Through the modeling and identification procedure presented in [43] and based upon manufacturer’s specifications, the values of the physical parameters of each axis are identified and shown in Tab 5.1.  5.3 Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation The improvements of fitting and smoothness of the proposed spline parametrization and interpolation algorithm are demonstrated in the following simulation and experimental results.  5.3.1 Controller Design  78  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation Table 5.2: PID control parameters for 5-Axis spline parameterization and interpolation tests Parameters  X-axis  Y-axis  Z-axis  A-axis  C-axis  kp [V/mm]  10.000  12.344  13.880  245.55  335.03  ki [V/(mm·s)]  50.000  61.718  69.400  1227.7  1675.1  kd [V/(mm/s)] 0.3000  0.3670  0.4147  7.0147  9.5925  In these series of experiments a PID control law is used, as shown in Fig. 5.2, with the parameters shown in Tab. 5.2 It should be noted that feed-forward friction control can be included to compensate for discontinuous, non-linear frictions. But, due to the discontinuity of feed-foward friction control, which is the result of the discontinuous friction model, it was not included to avoid injecting commands that are less than C3 continuous. In this way, the experimental results will correctly reflect the affect C3 continuity has on the vibrational modes of the machine tool.  5.3.2 Simulation and Experimental Results As mentioned in Chapter 3, the proposed method generates more favourable fitting results than existing dual spline methods, while preserving continuity higher than existing decoupled methods. This is verified using two different reference toolpaths: a straight toolpath with an abrupt orientation change and a smooth fan shaped toolpath as presented in [11]. The fitting characteristics of the proposed method and standard dual spline methods are compared in the first set of simulations. A tool path with an abrupt angular change over a short displacement is simulated with a dual spline interpolating scheme and the proposed C3 interpolating scheme as shown in Fig. 5.3.  79  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation  Tool Orientation  100  Dual Spline - Fitting problems Proposed Method - Improved fitting  Z[mm]  80 60 40 20 0  Upper spline  Tooltip position  0 20 40  X[mm]  60 80 100  10  Y[mm]  0  Figure 5.3: Simulation of Dual Spline and Decoupled Methods As it can be seen, the dual spline interpolating scheme experiences oscillatory problems in the toolpath at the orientation change. In all dual spline interpolating schemes, the orientation and position interpolation are coupled by the change in displacement. As a result, a short change in displacement will not accurately reflect the large change in orientation. On the other hand, the proposed C3 interpolating scheme is able to capture these changes with no problems since the displacement and orientation are interpolated independently. Though this is an extreme example, it shows that the proposed method, and by extension, decoupled methods, can capture orientation and displacement changes more accurately than dual spline methods. However, the existing decoupled methods are limited in their smoothness, only achieving C2 continuity [10– 12]. The proposed method overcomes this limitation and achieves C3 continuity  80  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation  Cutting tool  P [mm]  20  z  10 0 20  0  20  40  Px [mm]  40  60  60  0 20 Py [mm]  Decoupled spline fitting Zones of High Curvature 1  k  O  0  0  z  P (mm)  0.5  0 40  20  20  P (mm) 40 y  0 20  0.5 1 1  P (mm) x  O  j  1  0  0 1  1  O  i  (b) Tooltip orientation spline  (a) Tooltip position spline (c) Translational axes  (d) Rotary axes  Figure 5.4: Test toolpath and parametric spline fitting to tooltip position and orientation. Zones of high curvature are identified  81  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation Next, the smoothness of the proposed C3 interpolation scheme is validated. For these simulations and experiments, the fan toolpath is fitted to a position spline and an orientation spline as shown in Fig. 5.4. The following experiments compare C2 interpolation to the proposed C3 interpolation. The tests were performed on the test bed described in Section 5.2 To ensure the tested interpolation algorithms shared a similar feed profile and to preserve the continuity of the trajectories, a C3 displacement profile, imposed by a cubic acceleration profile is used [4]. A feedrate of 50mm/s is used to ensure that the axis limits were not violated. The resulting position commands and experimental data for all drives are shown in Fig. 5.5. The actual positions of the drives are measured from encoders attached to each drive, and they are in good agreement with the reference position commands. The smoothness of the commanded motion can be seen from the reference jerk. The third derivative of the position commands, the jerk, is found digitally using the following equation: q − 3q i+2 + 3q i+1 − q i d3 q ≈ i+3 3 dl ∆t3  (5.1)  where q = [X, Y, Z, A, C]T and ∆t = 0.001s. The reference jerk for each axis of the C2 trajectory and proposed C3 trajectory are compared as shown in Fig. 5.6. As predicted, the C2 trajectory results in jerk discontinuities with higher amplitudes in all the axes, especially on the constant feed section between 0.0775s and 3.4475s where there is a sharp curvature at the tool path. With the proposed method, the jerk transitions are smoother with lower amplitudes, and the discontinuities do not exist as summarized in Table 5.3. Given these kinematic characteristics, the C2 toolpath should result in higher oscillations when compared to the C3 toolpath. This is validated experimentally. The accelerations of the three  82  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation Axis Reference Commands C2 Reference Commands C2 Experiment  X [mm]  100  C3 Reference Commands C3 Experiment  50  0 0  0.5  1  1.5  2  2.5  3  3.5  4  0.5  1  1.5  2  2.5  3  3.5  4  0.5  1  1.5  2  2.5  3  3.5  4  0.5  1  1.5  2  2.5  3  3.5  4  0.5  1  1.5  2 Time [s]  2.5  3  3.5  4  Y [mm]  40 20 0 −20 0  Z [mm]  40 20 0 0  A [mm]  0 −0.2 −0.4 0  C [mm]  2 1.5 1 0.5 0 0  Figure 5.5: Axis reference commands and encoder position data for experiments 83  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation  Zone of high curvature 4  X Axis Jerk [mm/s3]  x 10 5  C2 Method  0  Proposed C3 Method  5 0  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  0.5  1  1.5  2  2.5  3  3.5  4  Y Axis Jerk [mm/s3]  x 10 5 0 5 0  4  Z Axis Jerk [mm/s3]  x 10 5 0 5  C Axis Jerk [rad/s3]  A Axis Jerk [rad/s3]  0  500 0 500 0  3000 2000 1000 0 1000 0  Time [s]  Figure 5.6: Jerk of axis reference commands for experiments  84  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation FFT of Axis Acceleration  |X’’(f)|  0.15  3  Proposed C Method  0.1 0.05 0 0  |Y’’(f)|  C2 Method  50  100  150  200  250  300  350  400  450  500  50  100  150  200  250  300  350  400  450  500  50  100  150  200  250  300  350  400  450  500  50  100  150  200  250  300  350  400  450  500  50  100  150  200  250 300 Frequency (Hz)  350  400  450  500  0.1 0.05 0 0 0.2  |Z’’(f)|  0.15 0.1 0.05 0 0 4 |A’’(f)|  3 2 1 0 0  |C’(f)|  15 10 5 0 0  Figure 5.7: Fast Fourier Transform of Measured Signals 85  Chapter 5: Simulations and Experiments for 5-Axis Spline Parametrization and Interpolation Table 5.3: Comparison of max./min. jerk values for test tool path at constant feed segment Method  X-axis  Y-axis  Z-axis  A-axis  C-axis  (mm/s3 )  (mm/s3 )  (mm/s3 )  (rad/s3 )  (rad/s3 )  Max. jerk of C2 Interpolation  3.4e4  4.2e4  1.5e4  664  3.0e3  Min. jerk of C2 Interpolation  -2.5e4  -3.7e4  -1.6e4  -614  -1.9e3  Max. jerk of C3 Interpolation  1.5e4  1.5e4  1.4e4  191  927  Min. jerk of C3 Interpolation  -1.5e4  -2.0e4  -1.5e4  -222  -996  Table 5.4: Percentage tracking error Axis  X-axis (%)  Y-axis (%)  Z-axis (%)  A-axis (%)  C-axis (%)  |C 3 Error| |C 2 Error|  84  70  98  87  92  linear drives are measured with the accelerometers attached to the table (x, y) and moving head (z). The accelerations of the two rotary drives are monitored from their encoders which have enough resolution for triple digital differentiation, 4.26e-6 rad/count and 8.52e-6 rad/count for the a and c axis, respectively. The Fast Fourier transforms (FFT) of measured accelerations in the high curvature zone are shown in Fig. 5.7. It can be be seen that C2 interpolation excites the resonance modes of the closed loop system more than C3 interpolation. It should be noted that the acceleration FFT of the Z-axis trajectories are very similar. From Fig. 5.6 it can be seen that the jerk profiles of the Z-axis trajectories are very close, thus explaining the resemblance in the FFT. Nevertheless, it can be seen in Fig. 5.7 that the high frequency structural mode at 150Hz is excited more in the C2 interpolation. In addition to decreasing vibrations, the use of a C3 interpolation scheme showed a slight decrease in tracking error on each axis. In the zone of high curvature of the tool path, the ratio of the mean absolute tracking errors are shown in Tab. 5.4. Though the results vary, there is a consistent decrease in tracking error of drives which are more active at the zone of high 86  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation curvature. As predicted, smoother reference commands resulted in less oscillatory components and lowered tracking errors.  5.4 Simulations and Experiments for 5-Axis Contour Error Pre-compensation The validity of the tracking error prediction algorithm, efficacy of the contour error prediction algorithm, and improvement in the contour error through pre-compensation are demonstrated in the following simulation and experimental results. 5.4.1 Controller Design Since the contour error prediction algorithm is based upon a linear analytic solution for tracking error as discussed in Chapter 4, non-linear components of the experimental setup must be reduced as much as possible to preserve the accuracy of the prediction model. As a result, in addition to the standard PID controller, a feed forward friction controller is implemented to compensate for unwanted non-linear friction affects The feedfoward friction controller is based upon the controller proposed in [22], and has the following form:    + + −ω/Ω+ −ω/Ω+  1 + T 2 ) T e (1 − e  stat coul    − − −ω/Ω− −ω/Ω− Tf (ω) = 1 + T 2 ) T e (1 − e stat coul       0  if ω > 0 if ω < 0  (5.2)  otherwise  where ω is the angular velocity of the servodrive. The control law in Eq. (5.2) is modeled after the Stribeck friction curve. In these series of experiments the control law shown in Fig. 5.8 is used with the PID parameters shown in Tab. 5.5. 87  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  Non-linear Friction Effects  Feedforward Friction Compensation  d dt xref  + -  1 Ka Kt  T(w) PID  ufc  + uc  Ka  +  Kt +  -  1 Js+B  1 s  x  Ts  Physical Plant  Digital Control  Figure 5.8: Control law for 5-axis contour error pre-compensation simulation and experiments  Table 5.5: PID control parameters for 5-Axis contour error pre-compensation tests Parameters  X-axis  Y-axis  Z-axis  A-axis  C-axis  kp [V/mm]  10.000  12.344  13.880  245.55  335.03  ki [V/(mm·s)]  50.000  61.718  69.400  1227.7  1675.1  kd [V/(mm/s)] 0.3000  0.3670  0.4147  7.0147  9.5925  88  Acceleration [mm/s2]  Velocity [mm/s]  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  100 50 0 0  0.5  1  1.5  2  2.5  3  3.5  4  4.5  5  0.5  1  1.5  2  2.5  3  3.5  4  4.5  5  0.5  1  1.5  2  2.5 Time [s]  3  3.5  4  4.5  5  1000 0 1000 0 4  Jerk [mm/s3]  x 10 2 0 2 0  Figure 5.9: Velocity, acceleration, and jerk of tangential feed profile used for simulations and experiments 5.4.2 Simulation and Experimental Results The proposed pre-compensation method includes novel tracking error modeling, contour error modeling, and pre-compensation strategies, which are verified in the following simulations and experiments. The tool path used for the simulations and experiments is the fan toolpath, which is already fitted to a spline format from the previous section. Since contour errors are most apparent at higher feedrates, the feed profile for the splined toolpath is optimized to ensure axis limits are not violated while taking full advantage of the kinematic capabilities of all drives of the machine tool [41]. The tangential kinematic profile used in the simulations and experiments can be seen in Fig. 5.9  89  Z tracking errors [mm]  Y tracking errors [mm]  X tracking errors [mm]  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  0.2  Real Tracking Error Modelled Prediction  0.1 0 −0.1 −0.2 0  0.5  1  1.5  2  2.5  0.5  1  1.5  2  2.5  0.5  1  1.5  2  2.5  0.5  1  1.5  2  2.5  0.5  1  1.5  2  2.5  0.2 0.1 0 −0.1 −0.2 0 0.2 0.1 0 −0.1 −0.2 0  A tracking errors [rad]  −3  4  x 10  2 0 −2 −4 0  C tracking errors [rad]  −3  5  x 10  0  −5 0  Time [s]  Figure 5.10: Comparison of real tracking error and predicted model  90  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation 0.45  Sencer et. al (2009) Erkorkmaz et. al (2009) Proposed  0.4  Contour Error Estimation [mm]  0.35 0.3 0.25 0.2 0.15 0.1 0.05 0 0  0.5  1  1.5  2  Time [s]  Figure 5.11: Comparison of contour error estimation methods Using the tracking error modeling techniques presented in Section 4.3 and the time stamped position commands generated by the feed optimization algorithm [41], the predict tracking errors are obtained and compared with the experimental results as shown in Fig. 5.10. As it can be seen, the tracking error prediction model is relatively accurate. It should be noted that the tracking errors of the rotary axes are not predicted as accurately as the linear axes. Due to the mechanical design of the rotary axes, specifically the worm gear design, a higher number of mechanical interfaces exist and, as a result, more non-linear affects exist. Since the presented tracking error model works best with systems that exhibit mostly linear charactersitics, the rotary axes could not be modelled as accurately as the linear axes resulting in more errors in the tracking error model. Regardless of this, the results still match fairly close, making the tracking error model acceptable for contour error prediction.  91  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation Since the pre-compensation strategy relies on the quality of the prediction of the contour errors, it is fitting to compare the available contour error modeling methods in literature. Using the predicted tracking errors, the contour error is estimated using the method presented in [37], [38], and this thesis. Fig. 5.11 shows a comparison of the contour error modeling methods. As it can been, the results produced by the method proposed in [38] share very little agreement with the other contour error estimation algorithms. Since the method is designed for real-time estimation of contour errors, the accuracy of the method may break down for toolpaths with high curvature, low sampling time, or high feed rates. In this thesis, the same sampling time is used as presented in presented in [38]. However, the path possess much higher curvature sections with twice the feedrate, leading to flaws in the modeling. Though this method is fast enough for real-time processing, the model breaks down at high speed complex toolpaths, making the prediction unacceptable for contour error pre-compensation in high speed machining. When comparing the method proposed in [37] and the proposed method, it can be seen that the results essentially match, thus validating both algorithms. Since the contour error estimation will be used as compensation commands it is necessary to check the continuity of the compensating commands. Geometrically discontinuous compensating commands will demand infinite jerks, thus causing vibrations that the original smooth toolpath was designed to avoid. Upon analyzing the jerks of the axis components of the contour errors, as shown in Fig. 5.12, the undesirable results of the method proposed in [37] can be seen. If the pre-compensation commands generated by the method proposed in [37] are used, infinite acceleration and jerk components would be injected into the previously smooth trajectory, exciting the resonance modes and causing surface marks and undue wear on the servo drives. Since the method proposed in [37] interpolates the reference commands with linear segments, these geometric discontinuities would show themselves in the compensating com92  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  Jerk of X contour errors [mm]  5000  Erkorkmaz et. al (2009) Proposed  0  −5000  0.6  0.8  1  1.2  1.4  1.6  0.6  0.8  1  1.2  1.4  1.6  0.6  0.8  1  1.2  1.4  1.6  Jerk of Y contour errors [mm]  5000  0  −5000  Jerk of Z contour errors [mm]  5000  0  −5000  Time [s]  Figure 5.12: Comparison of contour error estimation methods  93  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation mands, resulting in infinite demands at higher derivatives. In contrast, the axis components of the contour errors generated by the proposed algorithm are smooth to the third derivative since the contour error is calculated based upon a C3 continuous spline. As a result, the contour errors predicted by the proposed method are ideal for pre-compensation with an already jerk continuous toolpath Beyond the continuity of the contour error modeling algorithm, the proposed method also possess a few advantages not present in the method proposed in [37]. First and foremost, the proposed method presented is able to model orientation contour error, which is not possible in the method proposed in [37]. Though the method proposed in [38] can model orientation contour errors, this method breaks down under certain conditions. Comparing the processing time of the proposed method and the method proposed in [37], the computation times are 9.63s and 13.54s, respectively. Though the proposed contour error prediction model has been shown to correctly find the shortest distance from the actual tool position to the reference, the validity of this distance is completely dependent on how well the tracking error can be modeled. Comparison of the experimental contour errors and predict contour errors can be seen in Fig. 5.13 As it can be seen, the model applied can capture the major features of the contour errors. However, due to the mismatches in the rotary axes dynamics shown in the tracking error, the result is elements of the contour error that can not be completely modeled. However, given the relatively good match, the model can still be applied for the pre-compensation strategy. The experimental results can be seen in Fig. 5.14 From these results, it can be seen that the simulated contour errors are reduced close to zero, thus verifying the theoretical application of the pre-compensation algorithm. Experimentally,  94  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  Position Contour Error Estimation [mm]  0.35  Real Contour Error Modelled Contour Error  0.3  0.25  0.2  0.15  0.1  0.05  0 0  0.5  1  0.5  1  1.5  2  2.5  1.5  2  2.5  −3  Orientation Contour Error Estimation [mm]  2.5  x 10  2  1.5  1  0.5  0 0  Time [s]  Figure 5.13: Comparison of simulated and experimental contour errors  95  Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation  Position Contour Error [mm]  0.25  experimental uncompensated 0.2  simulated uncompensated  experimental compensated simulated compensated  0.15  0.1  0.05  0  Orientation Contour Error [mm]  x 10  0.5  1  0.5  1  1.5  2  2.5  1.5  2  2.5  3  2  1.5  1  0.5  0 0  Time [s]  Figure 5.14: Simulation and experimental results for uncompensated and precompensated trajectory  96  Chapter 5: Conclusions an average of 70% reduction in position contour error and 60% reduction in orientation contour can be seen. Compared to the multi-input, multi-output controller proposed in [27], the position contour errors share a similar improvement, while the orientation contour error shows better reduction.  5.5 Conclusions The motion control strategies proposed in this thesis have been validated in this chapter. It is shown that the proposed spline interpolation method can fit orientations more favourably than the dual spline methods. Relative to C2 decoupled interpolation methods, it has been demonstrated experimentally that the proposed method results in lower oscillations at the resonance modes of the servo drive. In addition to the spline interpolation algorithm, the various elements of the proposed contour error pre-compensation scheme is also validated. First, the results of the tracking error prediction algorithm are compared with the experimental tracking errors, showing a relatively good match. Based upon this tracking error model, the contour error is predicted. The prediction is compared to existing contour error modeling methods, showing good agreement with a benchmark method. Furthermore, it was shown that the proposed method results in compensating commands with smoother derivatives. The simulated contour errors, based on the predicted tracking errors are compared to the actual contour, again showing relatively good match. These contour errors are then used in the proposed contour error pre-compensation scheme, resulting in a 70% reduction in tool tip position contour error and 60% reduction in tool orientation contour error.  97  Chapter 6 Conclusions 6.1 Conclusions In this thesis, novel trajectory generation methods have been proposed with the purpose of generating smooth commands and improving contouring accuracy for 5-axis CNC machines. A new 5-axis spline interpolation technique has been developed that yields jerk continuous motion in tool position and orientation for an arbitrary curve toolpath. The interpolation technique also generates minimal feed fluctuation and minimal jerk motion commands. Based upon the novel contour error prediction scheme presented in this thesis, the original trajectory is modified to compensate for the predicted contour error. In addition to compensating tooltip position contour error, the proposed scheme accounts for the non-linear kinematics of a 5-axis machine tool and compensates for tool orientation contour error as well. The contributions are summarized as follows: The proposed decoupled spline toolpath planning algorithm has been shown to provide smoother motion commands for a 5-axis machine tool with better fitting characteristics relative to existing 5-axis spline interpolation methods. The continuity of the feed correction polynomial originally used in [10] has been modified to preserve jerk continuity in the proposed interpolation scheme. This results in jerk continuous motion commands with minimal feed fluctuation. The introduction of a jerk continuous orientation reparameterization spline also preserves the C3 continuity of the whole toolpath. In addition to this, the unique characteristics of the orientation reparameterization spline allows optimization operations that minimize demanded jerks. 98  Chapter 6: Future Research Directions The contour error pre-compensation algorithm has been shown to eliminate tooltip position and tool orientation contour error in simulations. In experiments, the average tooltip position contour error is reduced by 70% and the average tool orientation contour error is reduced by 60%. This discrepancy is due to modeling uncertainties. Regardless, the improvement in error is significant. Taking advantage of the decoupled nature of the Cartesian axes to the orientation of the tool, a two stage pre-compensation algorithm is performed to modify the trajectory so both position and orientation contour error can be pre-compensated.  6.2 Future Research Directions For both trajectory generation topics discussed in this thesis, several directions can be pursued. Though the basic fundamental methodology for the novel spline interpolation technique has been developed, the algorithm can be improved upon. To increase overall smoothness, it is generally desirable to fit a lower number of splines to the CAM data so fewer junctions exist. As a result, the proposed strategy can be extended so the CAM data is approximated adaptively, with the objective of the lowest number of splines while remaining within the user specified error tolerance. With respect to general smooth spline interpolation research, many fundamental challenges still exist. Of paramount importance are the development of strategies to deal with geometric singularities such as sharp corners in position and orientation. Directly relevant to this research, strategies should be developed to smooth sharp corners in the spherical Cartesian plane, while preserving tolerances in the actual orientation of the tool. In the context of the formulation of the mathematical NURBS equation, CNC research has yet to address ways to optimize the knot vector and weights to create geometrically favourable toolpaths. This is a challenge since the assignment of knot vector and weights is non-intuitive and shares a complex, implicit relationship with the geometry of the spline.  99  Chapter 6: Future Research Directions With respect to the contour error pre-compensation technique, several issues can be addressed to improve the proposed algorithm. At present, the proposed strategy only addresses closed loop system with linear characteristics. Extending the proposed algorithm to accommodate non-linear characteristics will allow the trajectory to be modified to compensate for errors in non-linear controllers, such as sliding mode, or errors from non-linear affects such as cutting forces or Coulomb friction. At present, the proposed algorithm generates all pre-compensating commands offline. Given a long enough toolpath, this process can be very time consuming and may be unacceptable for practical use. Look-ahead or real-time strategies should be researched and developed based upon the proposed algorithm. In addition to this, the proposed algorithm employs no feedback signals and is completely based on how good the model of the plant is. It may be possible to use feedback information to tune the plant model, thus improving the compensating commands. Alternatively, feedback information can be used to generate precompensating command in a look-ahead fashion, should a fast enough contour error estimation algorithm be developed  100  Bibliography [1] F.-C. Wang and D. Yang, “Nearly arc-length parameterized quintic-spline interpolation for precision machining,” Computer-Aided Design, vol. 25, pp. 281–288, May 1993. [2] F.-C. Wang, P. K. Wright, B. A. Barsky, and D. C. H. Yang, “Approximately arc-length parametrized c3 quintic interpolatory splines,” Journal of Mechanical Design, vol. 121, no. 3, p. 430, 1999. [3] K. Erkorkmaz and Y. Altintas, “Quintic spline interpolation with minimal feed fluctuation,” Journal of Manufacturing Science and Engineering, vol. 127, no. 2, p. 339, 2005. [4] K. Erkorkmaz, Optimal trajectory generation and precision tracking control for multiaxis machines. PhD thesis, University of British Columbia, 2004. [5] R. T. Farouki and T. Sakkalis, “Real rational curves are not unit speed,” Computer Aided Geometric Design, vol. 8, pp. 151–157, May 1991. [6] R. T. Farouki and S. Shah, “Real-time CNC interpolators for pythagorean-hodograph curves,” Computer Aided Geometric Design, vol. 13, pp. 583–600, Oct. 1996. [7] R. T. Farouki, M. al Kandari, and T. Sakkalis, “Hermite interpolation by rotationinvariant spatial pythagorean-hodograph curves,” Advances in Computational Mathematics, vol. 17, pp. 369–383, Nov. 2002. [8] M. Shpitalni, Y. Koren, and C. Lo, “Realtime curve interpolators,” Computer-Aided Design, vol. 26, pp. 832–838, Nov. 1994.  101  Bibliography [9] R.-S. Lin, “Real-time surface interpolator for 3-d parametric surface machining on 3axis machine tools,” International Journal of Machine Tools and Manufacture, vol. 40, pp. 1513–1526, Aug. 2000. [10] M. Heng and K. Erkorkmaz, “Design of a NURBS interpolator with minimal feed fluctuation and continuous feed modulation capability,” International Journal of Machine Tools and Manufacture, vol. 50, pp. 281–293, Mar. 2010. [11] R. Fleisig and A. Spence, “A constant feed and reduced angular acceleration interpolation algorithm for multi-axis machining,” Computer-Aided Design, vol. 33, pp. 1–15, Jan. 2001. [12] Y. Liu, H. Li, and Y. WANG, “Realization of a 5-axis NURBS interpolation with controlled angular velocity,” Chinese Journal of Aeronautics, vol. 25, pp. 124–130, Feb. 2012. [13] J. M. Langeron, E. Duc, C. Lartigue, and P. Bourdet, “A new format for 5-axis tool path computation, using bspline curves,” Computer-Aided Design, vol. 36, pp. 1219–1229, Oct. 2004. [14] Y. Wang, X. Ma, L. Chen, and Z. Han, “Realization methodology of a 5-axis spline interpolator in an open CNC system,” Chinese Journal of Aeronautics, vol. 20, pp. 362– 369, Aug. 2007. [15] Q. Bi, Y. Wang, L. Zhu, and H. Ding, “An algorithm to generate compact dual NURBS tool path with equal distance for 5-axis NC machining,” in Intelligent Robotics and Applications (H. Liu, H. Ding, Z. Xiong, and X. Zhu, eds.), vol. 6425 of Lecture Notes in Computer Science, pp. 553–564, Springer Berlin / Heidelberg, 2010.  102  Bibliography [16] L. Piegl and W. Tiller, The NURBS book (2nd ed.). New York, NY, USA: Springer-Verlag New York, Inc., 1997. [17] Y. Altintas, A. Verl, C. Brecher, L. Uriarte, and G. Pritschow, “Machine tool feed drives,” CIRP Annals - Manufacturing Technology, vol. 60, no. 2, pp. 779–796, 2011. [18] M. Tomizuka, “Zero phase error tracking algorithm for digital control,” Journal of Dynamic Systems, Measurement, and Control, vol. 109, no. 1, p. 65, 1987. [19] M. Weck and G. Ye, “Sharp corner tracking using the IKF control strategy,” CIRP Annals - Manufacturing Technology, vol. 39, no. 1, pp. 437–441, 1990. [20] D. Renton, “High speed servo control of multi-axis machine tools,” Open Access Dissertations and Theses, Jan. 2000. [21] Y. Altintas, K. Erkorkmaz, and W.-H. Zhu, “Sliding mode controller design for high speed feed drives,” CIRP Annals - Manufacturing Technology, vol. 49, no. 1, pp. 265–270, 2000. [22] K. Erkorkmaz and Y. Altintas, “High speed CNC system design. part III: high speed tracking and contouring control of feed drives,” International Journal of Machine Tools and Manufacture, vol. 41, pp. 1637–1658, Sept. 2001. [23] A. Kamalzadeh and K. Erkorkmaz, “Accurate tracking controller design for high-speed drives,” International Journal of Machine Tools and Manufacture, vol. 47, pp. 1393– 1400, July 2007. [24] C. Okwudire and Y. Altintas, “Minimum tracking error control of flexible ball screw drives using a discrete-time sliding mode controller,” Journal of Dynamic Systems, Measurement, and Control, vol. 131, no. 5, p. 051006, 2009.  103  Bibliography [25] Y. Koren, “Cross-coupled biaxial computer control for manufacturing systems,” Journal of Dynamic Systems, Measurement, and Control, vol. 102, no. 4, p. 265, 1980. [26] Y. Koren and C.-C. Lo, “Variable-gain cross-coupling controller for contouring,” CIRP Annals - Manufacturing Technology, vol. 40, no. 1, pp. 371–374, 1991. [27] Y. Altintas and B. Sencer, “High speed contouring control strategy for five-axis machine tools,” CIRP Annals - Manufacturing Technology, vol. 59, no. 1, pp. 417–420, 2010. [28] C. A. Ernesto and R. T. Farouki, “Solution of inverse dynamics problems for contour error minimization in CNC machines,” The International Journal of Advanced Manufacturing Technology, vol. 49, pp. 589–604, July 2010. [29] Y. Altintas and M. Khoshdarregi, “Contour error control of CNC machine tools with vibration avoidance,” CIRP Annals - Manufacturing Technology, vol. 61, no. 1, pp. 335– 338, 2012. [30] D. C. Yang and T. Kong, “Parametric interpolator versus linear interpolator for precision CNC machining,” Computer-Aided Design, vol. 26, pp. 225–234, Mar. 1994. [31] A. Siu, Real time trajectory generation and interpolation. PhD thesis, University of British Columbia, 2011. Graduate. [32] M. M.-T. Heng, Smooth and Time-Optimal Trajectory Generation for High Speed Machine Tools. PhD thesis, University of Waterloo, May 2008. [33] B. Sencer, Five-axis trajectory generation methods. PhD thesis, University of British Columbia, 2005. [34] E. Lee, “Choosing nodes in parametric curve interpolation,” Computer-Aided Design, vol. 21, pp. 363–370, July 1989. 104  Bibliography [35] W. Lei, M. Sung, L. Lin, and J. Huang, “Fast real-time NURBS path interpolation for CNC machine tools,” International Journal of Machine Tools and Manufacture, vol. 47, pp. 1530–1541, Aug. 2007. [36] B. Sencer, Smooth trajectory generation and precision control of 5-axis CNC machine tools. PhD thesis, University of British Columbia, 2009. [37] K. Erkorkmaz, C.-H. Yeung, and Y. Altintas, “Virtual CNC system. part II. high speed contouring application,” International Journal of Machine Tools and Manufacture, vol. 46, pp. 1124–1138, Aug. 2006. [38] B. Sencer and Y. Altintas, “Modeling and control of contouring errors for five-axis machine ToolsPart II: precision contour controller design,” Journal of Manufacturing Science and Engineering, vol. 131, pp. 031007–031007, May 2009. [39] Y. Altintas and K. Erkorkmaz, “Feedrate optimization for spline interpolation in high speed machine tools,” CIRP Annals - Manufacturing Technology, vol. 52, no. 1, pp. 297– 302, 2003. [40] X. Beudaert, S. Lavernhe, and C. Tournier, “Feedrate interpolation with axis jerk constraints on 5-axis NURBS and g1 tool path,” International Journal of Machine Tools and Manufacture, vol. 57, pp. 73–82, June 2012. [41] B. Sencer, Y. Altintas, and E. Croft, “Feed optimization for five-axis CNC machine tools with drive constraints,” International Journal of Machine Tools and Manufacture, vol. 48, pp. 733–745, June 2008. [42] G. Birkhoff and G.-C. Rota, Ordinary Differential Equations. Wiley, 4 ed., Jan. 1989.  105  Bibliography [43] K. Erkorkmaz and Y. Altintas, “High speed CNC system design. part II: modeling and identification of feed drives,” International Journal of Machine Tools and Manufacture, vol. 41, pp. 1487–1509, Aug. 2001.  106  

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.24.1-0073966/manifest

Comment

Related Items