SPLINE 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 interpolation and contour error pre- compensation algorithms developed for 5-axis machine tools. In the smooth spline interpola- tion 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 respect- ing 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 fit- ting 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 Ma- chine 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 men- tioned 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

Abstract ...... ii

Preface ...... iv

Table of Contents ...... v

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 ...... 12 2.4 Five-Axis Spline Contour Error Pre-compensation ...... 15 2.5 Conclusions ...... 19

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 Representation ...... 28 3.4 C3 Tool Tip Position Spline Generation ...... 31 3.4.1 Parametric Position Spline Fitting ...... 31 3.4.2 Feed Correction Polynomial ...... 32 3.5 C3 Tool Orientation Spline Generation ...... 40 3.5.1 Parametric Orientation Spline ...... 40 3.5.2 Orientation Spline Reparametrization ...... 43 3.5.2.1 Windowing for a High Number of Data ...... 47 3.6 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 Interpola- tion ...... 78

vi Table of Contents

5.3.1 Controller Design ...... 78 5.3.2 Simulation and Experimental Results ...... 79 5.4 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 5.5 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 2 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 contri- butions ...... 5 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

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

th 3.10 7 order Bezier´ 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 78 5.3 Simulation of Dual Spline and Decoupled Methods ...... 80 5.4 Test toolpath and parametric spline fitting to tooltip position and orientation. 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 experi- ments ...... 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 polyno- mial

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

th Ni,p(u) i basis function of a NURBS or B-spline of degree p

th Ni,p(w) i 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

th th Qi,k i control point for the k 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

th Si(t) i 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

Oact Actual tool orientation in workpiece coordinates

Ocomp Compensated orientation reference commands in workpiece coordinates

Oref 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

P 3 Predicted tool tip position in workpiece coordinates after orientation pre-compensation

th P i i control point of a NURBS or B-spline

P n 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

qcomp Compensated axis reference position commands

qref 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

εMSE 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

th b5,i, b4,i, . . . , b0,i Coefficients for the i quintic time spline

d3,i, d2,i, . . . , d0,i Coefficients of the particular solution for tracking error prediction

th hi Time interval for i 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

th ti Ending time for i 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

th wi Weight of i control point

wk(r) Reparameterization function for orientation spline

B-spline Bezier´ 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 teach- ing me how to be an excellent researcher.

I also wish to thank my friends at the Manufacturing Automation Laboratory. Their willing- ness 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 mo- ment. 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 CAN- RIMT).

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 reduc- tion 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 manufac- tured. 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 Reference z 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 fre- quency error components are usually the result of forced vibrations, chatter vibrations, or struc- tural 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 tra- jectory 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 ori- entation. 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 Tooltip position and p p p o o o x y z i j k and reparameterization tool orientation data functions 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

Constraints s(t) u u(s) P(u)

Optimized feed profile feed [mm/s] feed w w(s) O(w) Displacement [mm]

3. Trajectory generation and 4. 5-axis quintic spline Feed Optimization interpolation

Time stamped reference commands in workpiece coordinates Machine Tool Drives Feed Cont. - Drive Px Feed Py Cont. - Drive Pz Inverse 5. Contour Error Feed O Cont. i Kinematics Pre-compensation - Drive Oj Feed Cont. Ok - Drive

Feed Cont. - 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

p x Quintic py P(u) Estimate (ui,si) Fit Feed Correction B-Spline pz Arc lengths Polynomial Fitting

o i Transformation Quintic oj ( k, k) to Spherical B-Spline ok Co-ordinates Fitting

Fit Orientation Estimate (wj,sj) Reparameterization Arc lengths Function

P(u) w(s)O(w) u(s)

b) Contour Error Pre-compensation

Position Contour Error Estimation

x x x xr ex,1 act,1 Px,1 ex,2 act,2 comp - y - y P y yr ey,1 act,1 Py,1 ey,2 act,2 x,2 comp - z P - z Py,2 z zr Tracking e act,1 z,1 Tracking e act,2 comp z,1 Forward Inverse z,2 Forward Inverse Error O Error Pz,2 Prediction - a Kinematics i,1 Kinematics Prediction - a Kinematics Kinematics a ar ea,1 act,1 ea,2 act,2 comp Oj,1 Oi,comp e - c e - c c cr c,1 act,1 O c,2 act,2 Oj,comp comp - k,1 - Ok,comp

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 intrin- sically 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, tech- niques 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 com- mand generation techniques for 3-axis machines that are present in literature are reviewed first

7 Chapter 2: Three-Axis Spline Interpolation Techniques

CAM Fitting Spline Data Criterion Representation Poor Fitting

p1 p2 Good C(u) pn Fitting

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

u du 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 . 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, eliminat- ing 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 displace- ment (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 sur- faces 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 perfor- mance 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% re- duction 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 Hodo- graph (PH) curves instead, which allow the arc length to be analytically computed, thus avoid-

10 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 N (u)P w ∑i=0 i,p i i C(u) = N , (2.1) i=0 Ni,p(u)wi

NURBS are rational functions that can be used to represent the shape of a spline. The parame- ters 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 math- ematical formulations. When parameterizing a polynomial spline, only the coefficients need to be selected. Furthermore, the coefficients have an explicit relationship with the higher deriva- tives 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 parame- ter 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 iter- ative 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 com- putation 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 dis- placement 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 5- axis 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 ad- ditional 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 Good Criterion Fitting

CAM Spline Data Representation

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 ad- dition 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 fluctua- tions 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 inter- polation 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 orien- tations 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 posi- tion 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 so- phisticated 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 5- axis 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 cor- rection 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 posi- tion, the non-linear relationship between the orientation spline parameter and arc displacement must be approximated. In this case, a 7th order Bezier´ spline is used to schedule the spline parameter as a function of displacement. Furthermore, given the unique characteristics of the Bezier,´ its coefficients are optimized to minimize jerks. The overall scheme results in C3 con- tinuous 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

1. Increase Servo Bandwidth G

Hz 3. Modify Tool path + - + X-Controller X-Plant +

2. Include Contour Contour Error Error Control Controller

+ Y-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 multi- axis 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, signif-

16 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] de- veloped 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 distur- bances. 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 exter- nal 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 cross-

17 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 feed- forward 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 ma- chines, 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 5- axis 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 dis- cretizes 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 es- sentially 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 fluctua- tions 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 gen- erated by the CAM system, a continuous spline is used to interpolate these points, thus forcing

20 Chapter 3: Overview

Linear Corner Spline Interpolation Smoothing Fitting linear Smoothed interpolation spline segments e

CAM Data

Cannot reach feed on linear segment Desired feed is met in every segment feed [mm/s]feed feed [mm/s]feed time [s] time [s] Transitions across CAM points Must stop at each CAM Point are smooth and continuous Linear interpolated feed profile 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 ap- proach 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 feasi- ble 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. Further- more, 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

T T Input: G01 data p = [px,py,pz] , o = [oi,oj,ok]

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:

n n−1 S(u) = anu + an−1u + ... + a0 (3.1)

A NURBS is evaluated by a series of recursive functions, which is typically represented in the following compressed form: ∑ N N (u)P w ∑i=0 i,p i i C(u) = N , (3.2) i=0 Ni,p(u)wi where P i are control points, Ni,p(u) are basis functions, and wi are weights. The basis func- tions are defined by a knot vector, U, and the degree of the spline p. As a result, the character- istics 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: ∑N P (u) = Ni,p(u)P i (3.3) i=0

As a result, the formulations are simplified while retaining much of the flexibility made avail- able 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 normal- ized 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) N PN P(u)= Ni,p(u)Pi i=0 P6 P5 PN-1 P7 Pi = control points P(u) [0

P3 P9 ... PN-2 y

P(0) P0 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 ∈ [u , u ) i i+1 ∈ Ni,0(u) =  ; u [0, 1] (3.6) 0 u∈ / [ui, ui+1)

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:

u − ui ui+p+1 − u Ni,p(u) = Ni,p−1(u) + Ni+1,p−1(u) (3.7) ui+p − ui ui+p+1 − ui+1

26 Chapter 3: B-Spline Background

1 1 dNi,0 du Ni,0 0.5 p = 0 0

0.5

0 1 0 ui ui+1 ui+2 ui+3 1 0 0.2 0.4 0.6 0.8 1

N 1 i,1

5 dNi,1 du p = 1 0

5 0 0 ui ui+1 ui+2 ui+3 1 0 0.2 0.4 0.6 0.8 1

dNi,2 1 Ni,2 du 10

p = 2 0

10 0 0 ui ui+1 ui+2 ui+3 1 0 0.2 0.4 0.6 0.8 1 a) b)

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:

dNi,p(u) 1 p = Ni,p−1(u) − Ni+1,p−1(u) (3.9) du ui+p − ui ui+p+1 − ui+1 and the kth derivative is given as:

k N k−1 (u) N k−1 (u) d Ni,p(u) i,p−1 − i+1,p−1 k = p( ) (3.10) du ui+p − ui ui+p+1 − ui+1

The derivatives of the basis functions can be seen in Fig. 3.4 (b). Knowing the kth derivative of the basis functions, it is possible evaluate the kth 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:

k k k k k d P (u) d N0,p(u) d N1,p(u) d Nn−1,p(u) d Nn,p(u) = ·P + ·P +...+ ·P − + ·P (3.11) duk duk 0 duk 1 duk n 1 duk n

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

x Tool tip

P(u) 1 O(w) 0.5

k 0

0 O

(mm)

z

P 0 0.5 40 20 20 1 P (mm) 40 0 1 y P (mm) x 20 0 1 O 0 j O 1 1 i Tooltip position 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 Oi Constraints w w(s) O(w) Oj s Ok Optimized feed profile feed [mm/s] feed u Px Displacement [mm] u(s) P(u) Py Pz

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 synchro- nizing 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 con- tinuity. 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

T Consider a set of tool tip position vectors pk = [px,k, py,k, pz,k] , 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¯ = 0u ¯ = 1  0 N  √  ∑N − d = pk pk−1  (3.12)  k=1 √   −  pk pk−1 u¯ =u ¯ − + , k = 1, .., N − 1 k k 1 d

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 (3.13)  1 ·· − uj+p = p u¯k, j = 1, 2, ,N p k=j

Since the assigned parameters are solved based upon their distribution, the knot vector resem- bles 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:      ··· T T  N0,p (¯u0) NN,p (¯u0) P 0  p0        . .. .  .   .   . . .  .  =  .  (3.14) T T N0,p (¯uN ) ··· NN,p (¯uN ) P p | {z }| {zN } | {zN }

Φ1 Γ1 Ψ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 interpo- lation as shown in Fig. 3.7(a), where the spline parameter u is scheduled proportionally to the desired displacement: C u = · s, (3.16) S 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) u(t) Spline Toolpath: x(t) C n y(t) S Ni,p(u)Pi i=0 z(t)

(b) Interpolation with Feed Correction Polynomial

s(t) Feed Correction Poly. u(t) Spline x(t) 9 8 y(t) u=As +Bs +...+J Toolpath 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:  9 8  u(s) = A9s + A8s + ... + A0  (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 a √  ∥ ′ ∥ ′2 ′2 ′2  s(a) = P (u) du = Px + Py + Pz du 0 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: ∫ ∫  b b √  − ∥ ′ ∥ ′2 ′2 ′2  s(b) s(a) = P (u) du = Px + Py + Pz du a a  (3.19)  where: 0 ≤ a < b ≤ 1 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) (3.20) 6 2 √ ′2 ′2 ′2 where f(u) = Px + Py + Pz . 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. (3.21)

34 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 uj , j = 1,...,M. This gives a vector of spline parameters, u∗, with a vector of corresponding arc displacements , s, as shown:

∗ ∗ ∗ ∗ T → T u = [0 u1 u2 . . . uM ] s = [0 s1 s2 . . . sM ] (3.22)

∗ It should be noted that since the parameters are normalized, then uM = 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

∗ th displacements and parameters (sj, uj ) to approximate this relationship. The 9 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 real- time 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:  9 8  uˆ(σ) = a9σ + a8σ + ... + a0  (3.23) where: 0 ≤ σ ≤ 1 

9 8 where σ = s/S, and a9 = S A9, a8 = S A8, . . . , a0 = A0. Similarly, the first, second, and third derivatives of the spline parameter with respect to the displacement (uˆs = du/dsˆ ,

35 Chapter 3: C3 Tool Tip Position Spline Generation

2 2 3 3 uˆss = d u/dsˆ , uˆsss = d u/dsˆ ) are also expressed in the normalized formulation as:   duˆ 1  8 7  uˆs = = (9a9σ + 8a8σ + ... + a1)  ds S d2uˆ 1 uˆ = = (72a σ7 + 56a σ6 + ... + 2a ) (3.24)  ss ds2 S2 9 6 2   d3uˆ 1  uˆ = = (504a σ6 + 336a σ5 + ... + 6a ) sss ds3 S3 9 8 3

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:

1 1 σ = [0 σ σ . . . σ ]T = s = [0 s s . . . s ]T (3.25) 1 2 M S S 1 2 M

Substituting the normalized arc displacements into Eq.(3.23), the corresponding spline param- eter predictions obtained with the feed correction polynomial can be represented in matrix form:      ···  0   0 0 0 1a9         9 8 7    uˆ(σ1)   σ σ σ ··· 1a8    1 1 1        uˆ :=  uˆ(σ )  =  σ9 σ8 σ7 ··· 1a  (3.26)  2   2 2 2  7  .   . . . . . .   .   ......  .       9 8 7 uˆ(σM ) σ σ σ ··· 1 a0 | M M {zM }| {z } Φ α

The estimation error can be defined as:

∗ ∗ eu = u − uˆ = u − Φα (3.27)

36 Chapter 3: C3 Tool Tip Position Spline Generation

∗ ∗ ∗ T where u = [0, u1, . . . , uM ] and uˆ are the actual and the estimated, normalized displacement vectors, respectively. The objective function to be minimized is:

1 1 J = eT e = (u∗ − Φα)T (u∗ − Φα) (3.28) e 2 u u 2

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  u = = ( ) 1 =  s ds du f(u)  ( )  ′ ′ dus dus 1 1 f (u) uss = = us = = − (3.29)  ds du f(u) f(u) f(u)3  ( )  ′ ′ ′ 2 ′′  duss duss 1 f (u) 3f (u) − f (u)f(u)  u = = u = − = sss ds s du f(u) f(u)3 f(u)5 where f(u) and its derivatives are found as follows:  √   ∥ ′ ∥ ′2 ′2 ′2  f(u) = P (u) = Px (u) + Py (u) + Pz (u)   P ′(u) · P ′′(u) f ′(u) = √  P ′2(u) + P ′2(u) + P ′2(u) (3.30)  x y z  ′′ ′ ′′′ ′ ′′  (∥P (u)∥2 + P (u) · P (u))∥P ′(u)∥ + (P (u) · P (u))2/∥P ′(u)∥  f ′′(u) = , ∥P ′(u)∥2

37 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:     a9        0 0 0 0 0 0 0 0 0 1 a8  0               0 0 0 0 0 0 0 0 1 0 a   u (0)S     7  s         0 0 0 0 0 0 0 2 0 0 a   u (0)S2     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 a4  1               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)S2     2  ss    3 504 336 210 120 60 24 6 0 0 0 a1 usss(1)S | {z }   | {z } Ω 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 func- tion with the addition of a vector of Lagrange multipliers and constraint conditions results in the new objective function

T Jf = Je + Λ (Ωα − η) (3.33)

To optimize this objective function, the partial derivatives are equated to zero:

∂J ∂J f = 0, f = 0, (3.34) ∂α ∂Λ

38 Chapter 3: C3 Tool Tip Position Spline Generation

1

0.9 Initial Iteration Final Iteration 0.8

0.7 1 2 3 4 0.6 (u*j,sj)

u 0.5

0.4

0.3 5 6 7 8 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 u ΦT ΦΩT α ΦT u ⇒        = (3.35) Ωα = η Ω 0 Λ η

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 (uj , sj) is carried out adaptively for accuracy. The mean squared error ∗ (MSE) between the true and predicted spline parameter values (i.e., uj and uˆ(sj)) is calculated using ∑M ∗ 2 (u − uˆ(sj)) MSE = j (3.36) M j=1

39 Chapter 3: C3 Tool Orientation Spline Generation

and checked if it is greater than a specified tolerance εMSE. If the tolerance is violated, then ∗ the (sj, uj ) 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 < εMSE, 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

T Similar to tool tip position, the tool orientation vectors ok = [oi,k, oj,k, ok,k] , 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:

−1 −1 oj,k T θk = cos (ok,k) , ϕk = tan → ϑk = [θk, ϕk] , k = 0,...,N (3.38) oi,k

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   ∑N θ(w) Θ(w) = Ni,p(w)Θi = (3.39) i=0 ϕ(w)

41 Chapter 3: C3 Tool Orientation Spline Generation where   w − wi wi+p+1 − w  N (w) = N − (w) − N − (w)  i,p w − w i,p 1 w − w i+1,p 1   i+p i i+p+1 i     1 if wi ≤ w ≤ wi+1 (3.40)  Ni,0 =     0 otherwise    w ∈ [0, 1]

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 = 0w ¯N = 1   ∑N √ · d2 = arccos(ok ok−1) (3.41)   k=1 √  ·  arccos(ok ok−1) w¯k =w ¯k−1 + , k = 1, .., N − 1 d2

Using the assigned parameter values from Eq. 3.41, the knot vector is solved by averaging the assigned parameters as follows:    w0 = ... = wp = 0 wN+1 = ... = wN+p+1 = 1 j+∑p−1  1 (3.42)  w = w¯ , j = 1,...,N − p  j+p p k k=j

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:      ··· T T  N0,n (w ¯0) NN,n (w ¯0)  Θ0   ϑ0        . .. .  .   .   . . .  .  =  .  T T N0,n (w ¯N ) ··· NN,n (w ¯N ) Θ ϑ | {z }| {zN } | {zN }

Φ2 Γ2 Ψ2 −1 Γ2 = Φ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     Oi(w) sin(θ(w)) cos(ϕ(w))     O(w) =   =   (3.44) Oj(w) sin(θ(w)) sin(ϕ(w))

Ok(w) cos(θ(w))

3.5.2 Orientation Spline Reparametrization

Similar to the tool tip position parameter u, the tool orientation parameter w is to be inter- polated 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 cor- responds 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 relation- ship. 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

(sk,wk) Q0,k+1 ... Q7,k+1

Control coefficients (sk-1,wk-1) Q0,k ... Q7,k s

th Figure 3.10: 7 order Bezier´ 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 Bezier´ spline approximating the relationship between s and w over the (sk, w¯k) data, shown in Fig. 3.10, is defined as:   ∑7 7 −   7−i i s sk wk(r) = (1 − r) r Qi,k, r = ∈ [0, 1] (3.45) s − s − i=0 i k k 1

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:   ∑6 6 ′   − 6−i i − wk(r) = 7 (1 r) r (Qi+1,k Qi,k) (3.46) i=0 i

44 Chapter 3: C3 Tool Orientation Spline Generation   ∑5 5 ′′   − 5−i i − wk(r) = 42 (1 r) r (Qi+2,k 2Qi+1,k + Qi,k) (3.47) i=0 i   ∑4 4 ′′′   − 4−i i − − wk (r) = 210 (1 r) r (Qi+3,k 3Qi+2,k + 3Qi+1,k Qi,k) (3.48) i=0 i

′ For the monotonicity condition, the coefficients of wk(r) in (3.46) are ensured to be all non- negative,

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. (3.50)

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 − s − s  k k 1 k+1 k Q7,k − 2Q6,k + Q5,k Q2,k+1 − 2Q1,k+1 + Q0,k+1 = (3.51)  − 2 − 2  (sk sk−1) (sk+1 sk)  − − − −  Q7,k 3Q6,k + 3Q5,k Q4,k Q3,k+1 3Q2,k+1 + 3Q1,k+1 Q0,k+1 3 = 3 (sk − sk−1) (sk+1 − sk) 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: ∫ ∑N 1 ′′′2 wk min JQ = 6 dr (3.52) Qi,k (sk − sk−1) k=1 0

45 Chapter 3: C3 Tool Orientation Spline Generation subject to    w¯ − ≤ Q ≤ Q ... ≤ Q ≤ w¯  k 1 1,k 2,k 6,k k  − −  w¯k Q6,k Q1,k+1 w¯k  = sk − sk−1 sk+1 − sk  w¯ − 2Q + Q Q − 2Q +w ¯ (3.53)  k 6,k 5,k = 2,k+1 1,k+1 k  − 2 − 2  (sk sk−1) (sk+1 sk)  − − − −  w¯k 3Q6,k + 3Q5,k Q4,k Q3,k+1 3Q2,k+1 + 3Q1,k+1 w¯k 3 = 3 (sk − sk−1) (sk+1 − sk)

In the non-linear optimization problem, the initial values are selected to fulfill the the con- straints 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 (3.54)  −  ∆k = δ(sk sk−1)   w¯ − w¯ −  δ = min k k 1 ≤ ≤ 1 k N 7(sk − sk−1)

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

3 convergence speed. Once the coefficients Qi,k are found, w is interpolated as a C monotonic function of s.

46 Chapter 3: C3 Tool Orientation Spline Generation

0.65 Converged Solution 0.6 Initial Guess Actual Data 0.55 w 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 nec- essary 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. At- tempting 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 10 1 ]

s Converged Solution 0.5 Initial Guess

0

−0.5 X Axis Jerk [mm −1 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 5 ] s

0 Y Axis Jerk [mm −5 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 5 ] s

0 Z Axis Jerk [mm −5 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 1 ] s

0.5

0

−0.5

A Axis Jerk [mm −1 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 5 ] s

0 C Axis Jerk [mm −5 0 0.5 1 1.5 2 2.5 3 3.5 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 Optimization Preserved Window Continuity w w

s s (a) (b)

Preserved Continuity Preserved Continuity w w Optimization Optimization Window Window s s (d) (c)

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 opti- mization, 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 guar- anteed 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 win- dow 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 op- timized 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 gener- ated 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 approx- imating 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 achiev- able. 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 Bezier´ 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 Ok Pref Z On Oact ep o e Pn o p Oref Oj Pact

Reference Y O Toolpath i

X (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 ] = qref q = [Xref X,Yref Y,Zref Z,Aref A, Cref C] (4.1)

where qref = [Xref ,Yref ,Zref ,Aref ,Cref ] and q = [X, Y, Z, A, C] are the reference and ac- tual 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 in- tended 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 (Oact · On) (4.3)

where On = [Oi,n,Oj,n,Ok,n] is an orientation on the reference toolpath which has the closest geodesic distance to the actual orientation, Oact = [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 displace- ment 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):

T P (t) = [Px(t),Py(t),Pz(t)] , (4.4)

T O(t) = [Oi(t),Oj(t),Ok(t)] , ∥O∥ = 1. (4.5)

In order to obtain the corresponding reference commands in the machine coordinate sys- tem (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.

L a-axis ac,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))P (t) − cos(A(t)) cos(C(t))P (t) ... (4.6)  x y   − −  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 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, fol- lowed 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 = NsTs 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 Fit C3 quintic spline to the data with minimum jerk maximum error to the spline fitting data No Within the tolerance ?

Yes

C3 quintic spline S(t)

Solve the differential equation for tracking error Output: analytical

Je + (B+Kkd)e + Kkpe + Kkie = JX + BX 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

5 4 3 2 Si(t) = b5,it +b4,it +b3,it +b2,it +b1,it+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 pro- posed in [39], ∫ tf ... J = S(t)2dt (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: ∫ ∫ h1 hn ... 2 ... 2 J = S 1(t) dt + ... + S n(t) dt := J1 + ... + Jn. (4.11) 0 0

58 Chapter 4: Tracking Error Prediction

The i-th local objective can be derived as: ∫ hi 2 2 Ji = (60b5,it + 24b4,it + 6b3,i) dt 0 2 5 4 2 3 2 2 = 720b5,ihi + 720b5,ib4,ihi + (240b5,ib3,i + 192b3,i)hi + 144b4,ib3,ihi + 36b3,ihi     5 4 3 1440hi 720hi 240hi 0 0 0 b5,i      4 3 2     720hi 384hi 144hi 0 0 0 b4,i      3 2    (4.12) 1  240h 144h 72hi 0 0 0 b3,i  i i    = [b5,i b4,i b3,i b2,i b1,i b0,i]     2  0 0 0 0 0 0 b     2,i          0 0 0 0 0 0 b1,i

0 0 0 0 0 0 b0,i 1 := βT H β . 2 i i i

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:     H1  β1 1 T T  .   .  1 T J = [β ... β ]  ..   .  := β Hβ. (4.13) 2 1 n     2

Hn βn

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, (4.14) which can be written as      0 0 0 0 0 1 xi−1 βi = . (4.15) 5 4 3 2 hi hi hi hi hi 1 xi

59 Chapter 4: Tracking Error Prediction

0 0 Denoting the matrix on the left hand side of Eq. (4.15) as Li , and the right hand side as ξi , the knot position constraints from all segments can be written as       0 0 L1  β1 ξ1        ..   .   .   .   .  =  .  , (4.16) 0 0 Ln βn ξn which is denoted as L0β = ξ0. (4.17)

The velocity, acceleration and jerk continuity constraints at the point (ti, xi) can be written as:   ˙ ˙  Si(hi) − Si+1(0) = 0,  ¨ − ¨  Si(hi) Si+1(0) = 0, (4.18)   ...... S i(hi) − S i+1(0) = 0, which can be expanded as     4 3 2 . −    5hi 4hi 3hi 2hi 1 0 . 0 0 0 0 1 0  0  .  βi    3 2 . −    =   . (4.19)  20hi 12hi 6hi 2 0 0 . 0 0 0 2 0 0  0 βi+1 2 . − 60hi 24hi 6 0 0 0 . 0 0 6 0 0 0 0

1 ∗ Denoting the matrix on the left hand side of Eq. (4.19) as [Li L ], the derivative boundary condition are grouped together as     1 ∗   L1 L  β1     0  1 ∗       L2 L  β2 .     = . , (4.20)  . .   .  .  .. ..   .      0 1 ∗ 3(n−1)×1 Ln−1 L βn

60 Chapter 4: Tracking Error Prediction

X

} Maximum Error

S2(t) x2 x1

xn-1 xn-2 S1(t) Sn-1(t)

Sn(t) xn = X(Ns)

x0 = X(0) h1 h2 hn-1 hn 0 = t0 t1 t2 ... tn-2 tn-1 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: ˙ ¨ ... S1(0) = S1(0) = S 1(0) = 0, (4.22) which can be expanded as       . 0 0 0 0 1 0 .  β1 0  .   .     .   .  =   . (4.23) 0 0 0 2 0 0 . 03×6(n−1)  .  0 . 0 0 6 0 0 0 . βn 0

Denote Eq. (4.23) as L2β = ξ2. (4.24)

61 Chapter 4: Tracking Error Prediction

Similarly, by setting the final velocity, acceleration and jerk to be zero, the following conditions need to hold: ˙ ¨ ... Sn(hn) = Sn(hn) = S n(hn) = 0, (4.25) which can be expanded as       . 4 3 2  . 5hn 4hn 3hn 2hn 1 0 β1 0  .   .     . 3 2   .  =   . (4.26) 03×6(n−1) . 20hn 12hn 6hn 2 0 0  .  0 . 2 . 60hn 24hn 6 0 0 0 βn 0

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β = ξ (4.28) where [ ] [ ] L = L0 L1 L2 L3 T , ξ = ξ0 ξ1 ξ2 ξ3 T , the minimum jerk optimization problem can now be expressed as

1 min J = βT Hβ subject to: Lβ − ξ = 0. (4.29) β 2

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β − ξ). (4.30) 2

62 Chapter 4: Tracking Error Prediction

θ X e k u i T 1 x i k k 1 rg kp+ s +kds a t Js+B s

Figure 4.6: Block diagram for the PID controller and x-axis drive.

Equating ∂J′/∂β = 0 and ∂J′/∂Λ = 0 yields the linear equation system       HLT β 0     =   . (4.31) L 0 Λ ξ

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 fric-

63 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):

2 x(s) K(kds + kps + ki) = 3 2 . (4.32) X(s) Js + (B + Kkd)s + Kkps + Kki

where K = kaktrg. 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 2 . (4.33) X(s) Js + (B + Kkd)s + Kkps + Kki which can be expressed as an equivalent differential equation in time domain as:

...... ¨ J e (t) + (B + Kkd)¨e(t) + Kkpe˙(t) + Kkie(t) = JX(t) + BX(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:

3 2 eˆi(t) = d3,it + d2,it + d1,it + d0,i (4.35)

64 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:      

Kki Kkp 2(B + Kkd) 6J  d0,i  2b2,iB + 6b3,iJ               0 Kki 2Kkp 6(B + Kkd) d1,i  6b3,iB + 24b4,iJ            =   , (4.36)  0 0 Kk 3Kk  d  12b B + 60b J  i p   2,i  4,i 5,i 

0 0 0 Kki d3,i 20b5,iB

which yields to the solution of coefficients (d0,i, d1,i, d2,i, d3,i). By combining homogenous

λ1t λ2t λ3t (µ1,ie + µ2,ie + µ3,ie ) and particular solutions, the general solution of Eq. (4.34) can be expressed at each time interval [0, hi] as:

λ1t λ2t λ3t ei(t) =e ˆi(t) + µ1,ie + µ2,ie + µ3,ie , 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), (4.38)   e¨i(hi) =e ¨i+1(0).

Substituting Eq. (4.37) into Eq. (4.38),      −1   λ1hi − µ1,i+1 µ1,ie   1 1 1  eˆi(hi) eˆi+1(0)           =  λ2hi  +    ˙ − ˙  , (4.39) µ2,i+1 µ2,ie  λ1 λ2 λ3 eˆi(hi) eˆi+1(0)

λ3hi 2 2 2 ¨ − ¨ µ3,i+1 µ3,ie λ1 λ2 λ3 eˆi(hi) eˆi+1(0)

65 Chapter 4: Prediction of Contour Errors

Reference Reference Ocomp + Oact Toolpath Toolpath P O Z ref Ok ref O O c c O comp O Oact comp O Pn act ε On p ε Pact o O O Y Oj X (a)Oi (b) (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 1 1  eˆ1(0)         = −    ˙  . (4.40) µ2,1 λ1 λ2 λ3 eˆ1(0) 2 2 2 ¨ µ3,1 λ1 λ2 λ3 eˆ1(0)

The integration constants µ1,i, µ2,i and µ3,i at the remaining segments can be obtained recur- sively 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 er- ror ε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

d of the reference toolpath, du P (u), 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 ) = 0, u ∈ [0, 1], (4.41) du act

Eq. (4.41) can be solved numerically by the Newton Raphson iteration method: dP (u) − f(u) du (P (u) P act ui+1 = ui − = ui − . (4.42) df(u) d2P (u) − | dP (u) |2 du du2 (P (u) P act) + du

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 ≤ ε (4.43) | dP (u) || − | 1 du (P (u) P act)

−8 where ϵ1 is a zero tolerance indicating convergence. In this work, 10 is selected as a suf- ∗ ficiently 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 Oref and Oact , respectively, as shown in Fig. 4.7(b). On is the closest point from Oact 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 OactOn, i.e. the angular change from Oact to On, which is arccos(Oact · On). 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

′ d Oact, On, and the origin O, that is perpendicular to the tangent vector O (w) = dw O(w) of the orientation contour at On. This can be found by solving Eq. (4.45):   dO(w)  · O(w) = 0 dw (4.45)  dO(w) · O = 0 dw act

If both equalities are fulfilled, the result is a plane orthogonal to O′(w). As a result, the arc ′ distance between O(w) and Oact 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 Oact is perpendicular ′ to the tangent vector O (w) at On. The point On can be found by solving:

′ O (w) · Oact = 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.

′ · − g(w) − O (w) Oact wi+1 = wi dg(w) = wi ′′ . (4.47) O (w) · Oact dw

Similar to finding position contour error, the initial guess of Eq. (4.47) is the geometric param- eter at the respective time stamp. To check if Eq. (4.47) has converged the following condition is checked: ′ O (w) · Oact ′ ≤ ε2 (4.48) |O (w) · Oact|

68 Chapter 4: Compensation of Contour Errors

Ok

Oact On

' ' O n O n

Oj O

Oi

Figure 4.8: Orthogonality of On and Oact to O’n

−8 where ε2 is a zero tolerance for orientations indicating convergence. In this work, 10 is selected as a sufficiently small value for ϵ1. Convergence yields the corresponding orientation ∗ ∗ spline parameter w , i.e. On = O(w ). The tool orientation contour error becomes:

∗ εo = arccos(Oact · 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 q q O ref Tracking error 1 Direct 1 Orientation contour prediction kinematics error compensation

q2 Tracking error Inverse Ocomp prediction kinematics q Inverse comp q Pref 3 kinematics Direct P3 Tool tip contour P kinematics error compensation comp

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)    O = sin(A) cos(C)  j   Ok = cos(A) (4.50)   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   Pz = − sin(A)Y + cos(A)Z − cos(A)LT ya,z − Lac,z

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:

T e(t) = [ex(t), ey(t), ez(t), ea(t), ec(t)] . (4.51)

The actual positions (q1) of the drives can be predicted as:

− ← T q1 = qref e qref = [Xref ,Yref ,Zref ,Aref ,Cref ] (4.52)

where qref is the reference five-axis position command vector. Using the direct kinematics transformation (Eq. (4.50)) for q1, the predicted tool orientation is obtained and denoted as

O1:    Oi,1 = sin(A1) sin(C1)   Oj,1 = sin(A1) cos(C1) (4.53)   Ok,1 = cos(A1)

In Fig. 4.7 (b), Oref is the reference tool orientation; On is calculated by solving Eq. (4.46);

Oact = O1; and Ocomp is the pre-compensated tool orientation that needs to be determined using a “spherical parallelogram”. As shown in Fig. 4.7 (b), Oref , Oact, On, and Ocomp are

71 Chapter 4: Compensation of Contour Errors

four vertexes of the spherical parallelogram, whose center is denoted as Oc. The center is ⌢ ⌢ defined as the midpoint of the circle arc Oref On (and OcompOact) and obtained from:

Oref + On Ocomp + Oact Oc = = . (4.54) ∥Oref + On∥ ∥Ocomp + Oact∥

As shown in Fig. 4.7(c), the length of the projection of Oact on Oc is ∥Ocomp +Oact∥/2, which can also be obtained from inner product Oact · Oc since Oact and Oc are both unit vectors. The relationships yield to:

∥Ocomp + Oact∥ = 2(Oact · Oc). (4.55)

From Eqs. (4.54) and (4.55), Ocomp is obtained as:

Ocomp = ∥Ocomp + Oact∥Oc − Oact = 2(Oact · Oc)Oc − Oact. (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 Ocomp, the new five-axis reference positions q2 are obtained:    A2 = arccos(Ok,comp)     C2 = arctan(Oi,comp/Oj,comp)    X2 = − cos(C2)Px,ref − sin(C2)Py,ref  Y = cos(A ) sin(C )P − cos(A ) cos(C )P ... (4.57)  2 2 2 x,ref 2 2 y,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 Chapter 4: Compensation of Contour Errors

Again, taking the modified reference trajectory, q2, 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 q3 by considering the transfer functions of the drives (Eq. (4.32)).

− ← T q3 = q2 e2 q2 = [X2,Y2,Z2,A2,C2] (4.58)

Applying the direct kinematics transformation (Eq. (4.50)) on q3, 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   Pz,3 = − sin(A3)Y3 + cos(A3)Z3 − cos(A3)LT 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 calcu- lated 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 Ocomp, the pre-compensated five-axis position com-

73 Chapter 4: Conclusions

mand qcomp is calculated:    Acomp = arccos(Ok,comp)     Ccomp = arctan(Oi,comp/Oj,comp)    Xcomp = − cos(Ccomp)Px,comp − sin(C2)Py,comp  Y = cos(A ) sin(C )P − cos(A ) cos(C )P ... (4.61)  comp comp comp x,comp comp comp y,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

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 refer- ence 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, giv- ing 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 pre- sented 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 Sec- tion 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 + - 1 1 x PID Ka Kt + s - uc Js+B

Ts

Digital Control Physical Plant

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 inter- polation 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 param- eters shown in Tab. 5.2

It should be noted that feed-forward friction control can be included to compensate for dis- continuous, 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

100 Tool Orientation Dual Spline - Fitting problems Proposed Method - Improved fitting 80

60 Z[mm] 40

20

0 Tooltip position Upper spline 0 20 40 X[mm] 60 80 10 Y[mm] 100 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

20 Cutting tool

10 [mm] z

P 0 20 0 0 20 20 40 40 P [mm] 60 60 P [mm] x y

Decoupled spline fitting

Zones of High Curvature

1

0.5

k 0

0 O (mm) z

P 0 0.5 40 20  20 1 P (mm) 40 0 1 y P (mm) x 20 0 1 O 0 j O 1 1 i

(a) Tooltip position spline (b) Tooltip orientation 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 simula- tions 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:

d3q q − 3q + 3q − q ≈ i+3 i+2 i+1 i (5.1) dl3 ∆t3 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

100 C2 Reference Commands C2 Experiment 3 50 C Reference Commands 3 X [mm] C Experiment

0 0 0.5 1 1.5 2 2.5 3 3.5 4

40

20

Y [mm] 0

−20 0 0.5 1 1.5 2 2.5 3 3.5 4

40

20

Z [mm] 0

0 0.5 1 1.5 2 2.5 3 3.5 4

0

−0.2 A [mm] −0.4

0 0.5 1 1.5 2 2.5 3 3.5 4

2

1.5

1 C [mm] 0.5

0 0 0.5 1 1.5 2 2.5 3 3.5 4 Time [s]

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 10 2 ] 5 Method 3 C 3 0 Proposed C Method [mm/s

X Axis Jerk Axis X 5 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 5 ] 3 0 [mm/s

Y Axis Jerk Axis Y 5 0 0.5 1 1.5 2 2.5 3 3.5

4 x 10 5 ] 3 0 [mm/s

Z Axis Jerk Axis Z 5 0 0.5 1 1.5 2 2.5 3 3.5

500 ] 3 0 [rad/s

A Axis Jerk Axis A 500 0 0.5 1 1.5 2 2.5 3 3.5

3000

] 2000 3 1000 0 [rad/s 1000 C Axis Jerk Axis C 0 0.5 1 1.5 2 2.5 3 3.5 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 0.15 C2 Method 3 0.1 Proposed C Method

|X’’(f)| 0.05

0 0 50 100 150 200 250 300 350 400 450 500

0.1

|Y’’(f)| 0.05

0 0 50 100 150 200 250 300 350 400 450 500

0.2

0.15

0.1 |Z’’(f)| 0.05

0 0 50 100 150 200 250 300 350 400 450 500

4

3

2 |A’’(f)| 1

0 0 50 100 150 200 250 300 350 400 450 500

15

10

|C’(f)| 5

0 0 50 100 150 200 250 300 350 400 450 500 Frequency (Hz)

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 (%) | 3 | C Error 84 70 98 87 92 |C2 Error| 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 low- ered 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 − ω/Ω2  Tstate + T (1 e ) if ω > 0  coul − − b − −ω/Ω − −ω/Ω Tf (ω) = T e 1 + T (1 − e 2 ) if ω < 0 (5.2)  stat coul   0 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 Feedforward Friction Effects Friction Compensation 1 u d T(w) fc dt Ka Kt xref + + - 1 1 x PID Ka Kt s - uc + + Js+B

Ts

Digital Control Physical Plant

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 Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation

100

50

Velocity [mm/s] Velocity 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 ] 2

1000

0

1000 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Acceleration [mm/s Acceleration

4 x 10 ] 3 2

0

Jerk [mm/s Jerk 2 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Time [s]

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 Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation

0.2 Real Tracking Error 0.1 Modelled Prediction

0

−0.1

X tracking errors [mm] −0.2 0 0.5 1 1.5 2 2.5

0.2

0.1

0

−0.1

Y tracking errors [mm] −0.2 0 0.5 1 1.5 2 2.5

0.2

0.1

0

−0.1

Z tracking errors [mm] −0.2 0 0.5 1 1.5 2 2.5

−3 x 10 4

2

0

−2

A tracking errors [rad] −4 0 0.5 1 1.5 2 2.5

−3 x 10 5

0

C tracking errors [rad] −5 0 0.5 1 1.5 2 2.5 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) 0.4 Proposed

0.35

0.3

0.25

0.2

0.15 Contour Error Estimation [mm] Error Estimation Contour 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, mak- ing 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 compen- sating 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 trajec- tory, 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 com-

92 Chapter 5: Simulations and Experiments for 5-Axis Contour Error Pre-compensation

5000 Erkorkmaz et. al (2009) Proposed

0 Jerk of X contour errors [mm]

−5000 0.6 0.8 1 1.2 1.4 1.6

5000

0 Jerk of Y contour errors [mm] −5000 0.6 0.8 1 1.2 1.4 1.6

5000

0 Jerk of Z contour errors [mm] −5000 0.6 0.8 1 1.2 1.4 1.6 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

0.35 Real Contour Error Modelled Contour Error 0.3

0.25

0.2

0.15

0.1

Position Contour Error Estimation [mm] 0.05

0 0 0.5 1 1.5 2 2.5

−3 x 10 2.5

2

1.5

1

0.5 Orientation Contour Error Estimation [mm]

0 0 0.5 1 1.5 2 2.5 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

0.25 experimental uncompensated simulated uncompensated 0.2 experimental compensated

0.15 simulated compensated

0.1

Position Contour Error [mm] Contour Position 0.05

0 0.5 1 1.5 2 2.5

3 x 10

2

1.5

1

0.5 Orientation Contour Error [mm]Error Contour Orientation

0 0 0.5 1 1.5 2 2.5 Time [s]

Figure 5.14: Simulation and experimental results for uncompensated and precompensated tra- jectory

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 res- onance 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 pro- posed 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 tech- nique 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 exist- ing 5-axis spline interpolation methods. The continuity of the feed correction polynomial orig- inally 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 orienta- tion 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 er- ror 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 Carte- sian 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 pre- compensating 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 fluctua- tion,” Journal of Manufacturing Science and Engineering, vol. 127, no. 2, p. 339, 2005.

[4] K. Erkorkmaz, Optimal trajectory generation and precision tracking control for multi- axis 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 rotation- invariant spatial pythagorean-hodograph curves,” Advances in Computational Mathemat- ics, vol. 17, pp. 369–383, Nov. 2002.

[8] M. Shpitalni, Y. Koren, and C. Lo, “Realtime curve interpolators,” Computer-Aided De- sign, vol. 26, pp. 832–838, Nov. 1994.

101 Bibliography

[9] R.-S. Lin, “Real-time surface interpolator for 3-d parametric surface machining on 3- axis 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 fluctu- ation 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 con- trolled 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 Ap- plications (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 Dy- namic 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 Disser- tations 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, Mea- surement, 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 Ma- chine 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 ma- chine ToolsPart II: precision contour controller design,” Journal of Manufacturing Sci- ence 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 con- straints 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