REAL TIME TRAJECTORY GENERATION AND INTERPOLATION by Anthony Siu B.A.Sc. University of British Columbia, 2009 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 2011 © Anthony Siu, 2011 ii Abstract This thesis presents a continuous tool motion trajectory generation algorithm for high speed free form surface machining. A NURBS toolpath generation algorithm is presented to fit the discrete motion commands generated from free-form CAD-models. By using a NURBS representation of the machine part, the toolpath is interpolated continuously to direct the synchronized motion of the 5-axis CNC machine. The higher continuity of the motion trajectory allowed for tighter machining tolerances and reduced feedrate fluctuations and the undesired acceleration harmonics in the overall feed motion and in each of the motor motions. An optimal and feasible feedrate profile have been used to continuously maneuver the cutting tool with the interpolated reference tool position and tool orientation commands such that the kinematic constraints of the drives are not violated. Commonly used least squares curve fitting of discrete data points forces the curve to weave through the data points and results in a fluctuating toolpath. By making use of the defined basis function distributions of the NURBS control points, a higher smoothness fit has been achieved through a minimization on the chord error and the third derivative of the curve. The feasibility of this toolpath generation algorithm has been extended using the double spline representation to represent both the tool position and the tool orientation with minimal fitting error. The real time interpolation of the fitted NURBS toolpath has also been implemented using the multi-segment Feed Correction Polynomial. This method provides an adaptive mapping between the nonlinear relationship of the NURBS curve parameter and the curve displacement to allow for a consistent feedrate in the cutting motion. Additionally, the kinematic compatibility conditions are considered based on the inverse kinematics of the 5-axis CNC machine. The proposed algorithm ensures that an overall efficient feed constraint is placed such that none of the individual drives are overdriven. The results from experiments and simulations are presented to demonstrate the effectiveness of the developed trajectory generation algorithms. iii Table of Contents Abstract ...................................................................................................................................... ii Table of Contents ....................................................................................................................... iii List of Tables ............................................................................................................................... v List of Figures ............................................................................................................................. vi Nomenclature ............................................................................................................................. x Acknowledgements .................................................................................................................. xiv Chapter 1 Introduction ................................................................................................................ 1 Chapter 2 Literature Review ........................................................................................................ 5 2.1 Introduction/Overview ...................................................................................................... 5 2.2 Tool Path Fitting for Free-form Machining ......................................................................... 5 2.3 Interpolation ..................................................................................................................... 6 2.4 Feed Optimization ............................................................................................................. 8 Chapter 3 NURBS Toolpath Generation ..................................................................................... 10 3.1 Introduction .................................................................................................................... 10 3.2 NURBS Background ......................................................................................................... 10 3.3 Double B-Spline Toolpath Representation ....................................................................... 18 3.4 Global Approximation Fit ................................................................................................. 20 3.4.1 Tolerance Definition and Parameter Correction........................................................ 26 3.4.2 Quadrature Chord Error with Minimization .............................................................. 31 3.4.3 Jerk Minimization ..................................................................................................... 35 3.4.4 Simulation Results .................................................................................................... 37 3.5 Adaptive Quadrature Length ........................................................................................... 50 3.6 Conclusion ...................................................................................................................... 55 Chapter 4 Real Time Interpolation and Feedrate Profiling ......................................................... 57 iv 4.1 Introduction .................................................................................................................... 57 4.2 Interpolation ................................................................................................................... 57 4.2.1 Taylor Expansion ...................................................................................................... 59 4.2.2 Feed Correction Polynomial ..................................................................................... 61 4.3 Inverse Kinematics .......................................................................................................... 67 4.4 5-Axis Constraints Formulations ...................................................................................... 73 4.5 Feedrate Profiling ............................................................................................................ 82 4.7 Implementation and Experimental Results ...................................................................... 91 4.8 Conclusion .................................................................................................................... 110 Chapter 5 Hardware and Controller Implementations of the X-Y Table .................................... 112 5.1 Introduction .................................................................................................................. 112 5.2 System Implementation ................................................................................................ 113 5.3 Controller Designs ......................................................................................................... 114 5.3.1 PID Controller......................................................................................................... 116 5.3.2 Lead Lag Controller ................................................................................................ 118 5.3.3 Loop Shaping Controller ......................................................................................... 120 5.3.4 Pole Placement Controller ...................................................................................... 122 5.3.5 Sliding Mode Controller .......................................................................................... 125 5.4 Implementation Results ................................................................................................ 126 5.4.1 Frequency Response Function ................................................................................ 127 5.4.2 Basic Controller Contouring Evaluations ................................................................. 129 Chapter 6 Conclusion .............................................................................................................. 137 6.1 Conclusion .................................................................................................................... 137 6.2 Future Research Direction ............................................................................................. 139 Bibliography ............................................................................................................................ 141 v List of Tables Table 3.1: Path Length with Varying Adaptive Quadrature Tolerance ........................................ 53 Table 4.1: Interpolation Methods Comparison of Feed Fluctuation and Computation Time ....... 97 Table 4.2: X-Y Table Kinematic Limits ........................................................................................ 97 Table 4.3: X-Y Table Drive Dynamics .......................................................................................... 99 Table 4.4: 5-Axis Drive Limits................................................................................................... 102 Table 4.5: 5-Axis Simulation Drive Dynamics ........................................................................... 105 Table 5.1: Experimentally Determined Equivalent Inertia and Damping................................... 128 Table 5.2: Loop Shaping Controller Parameters ....................................................................... 129 Table 5.3: Pole Placement Controller Parameters .................................................................... 132 Table 5.4: Sliding Mode Controller Parameters ....................................................................... 134 vi List of Figures Figure 1.1: Trajectory Generation Overview ................................................................................ 3 Figure 3.1: NURBS Curve Representation .................................................................................. 11 Figure 3.2: B-Spline Basis Functions and Derivatives .................................................................. 14 Figure 3.3: Knot Insertion .......................................................................................................... 18 Figure 3.4: Double B-Spline Toolpath Representation ................................................................ 19 Figure 3.5: NURBS Global Approximation Fit ............................................................................. 20 Figure 3.6: Basis Function Evaluation at Chord Length Parameterized Values ............................ 22 Figure 3.7: Tolerance Definition ................................................................................................ 26 Figure 3.8: Corresponding Spline Parameter ............................................................................. 27 Figure 3.9: Double Spline Toolpath Fitting Flow Chart ............................................................... 30 Figure 3.10: Chord Error Projection ........................................................................................... 31 Figure 3.11: Chord Error Integration.......................................................................................... 33 Figure 3.12: Basis Function Integration in Region of Immediate Chord ...................................... 35 Figure 3.13: Chord Error Objective Comparison ......................................................................... 40 Figure 3.14: Jerk Objective Comparison..................................................................................... 41 Figure 3.15: Jerk Minimized NURBS Fit ...................................................................................... 42 Figure 3.16: Parametric Ruled Surface Toolpath ........................................................................ 43 Figure 3.17: Five-Axis Toolpath 1 Data ...................................................................................... 44 Figure 3.18: Toolpath 1 Fit ........................................................................................................ 45 Figure 3.19: Toolpath 1 Fit Interpolated Position and Orientation ............................................. 45 Figure 3.20: Toolpath 1 Fitting Errors ........................................................................................ 46 Figure 3.21: Five-Axis Toolpath 2 Data ...................................................................................... 47 Figure 3.22: Toolpath 2 Lower Spline Fit .................................................................................... 48 vii Figure 3.23: Toolpath 2 Fit Interpolated Position and Orientation ............................................. 48 Figure 3.24: Toolpath 2 Fitting Errors ........................................................................................ 49 Figure 3.25: A Cubic NURBS Curve with Extreme Knot Conditions ............................................. 52 Figure 3.26: Basis Functions with Extreme Knot Conditions ....................................................... 53 Figure 3.27: Path Displacement vs. Curve Parameter with Extreme Knot Conditions ................. 55 Figure 4.1: Interpolation ........................................................................................................... 59 Figure 4.2: Feed Correction Polynomial Fit Flowchart ................................................................ 65 Figure 4.3: 5-Axis Machine Tool ................................................................................................ 67 Figure 4.4: 5-Axis Machine Tool Reference Frames .................................................................... 68 Figure 4.5: Interpolated Discrete Reference Position Commands .............................................. 80 Figure 4.6: B-Spline Feed Profile ................................................................................................ 83 Figure 4.7: Limited Jerk Trajectory Profile ................................................................................. 85 Figure 4.8: Multi-Segment Limited Jerk Feed Profile Planning ................................................... 88 Figure 4.9: Required Length for Deceleration ............................................................................ 89 Figure 4.10: High Speed X-Y Table ............................................................................................. 91 Figure 4.11: X-Y Table Implementation Block Diagram .............................................................. 91 Figure 4.12: Fan-Shaped NURBS Toolpath ................................................................................. 92 Figure 4.13: Fan-Shaped NURBS Toolpath Curvature ................................................................. 93 Figure 4.14: Feedrate Fluctuation for Interpolation Algorithms ................................................. 95 Figure 4.15: Nonlinear Curve Parameter and Displacement Relationship................................... 96 Figure 4.16: Feedrate Constraints ............................................................................................. 98 Figure 4.17: Multi-Segment Limited Jerk Feed Profile ................................................................ 98 Figure 4.18: Linear Rigid Body Feed Drive Dynamics Model ....................................................... 99 Figure 4.19: Kinematic and Error Profiles of Fan-Shaped NURBS Contouring ........................... 100 Figure 4.20: 5-Axis Spiral Toolpath .......................................................................................... 101 viii Figure 4.21: 5-Axis Sample Toolpath Feed Profile .................................................................... 103 Figure 4.22: 5-Axis Simulation Block Diagram .......................................................................... 103 Figure 4.23: 5-Axis Simulation: Motor Reference Command Generation ................................. 104 Figure 4.24: Equivalent Feed Drive Dynamics Model ............................................................... 106 Figure 4.25: Simulation – Motor Output Profiles ..................................................................... 108 Figure 4.26: Simulation – Motor Tracking Errors ...................................................................... 108 Figure 4.27: Simulation – Tool Tip Position and Tool Orientation ............................................. 109 Figure 4.28: Simulation – Tool Tip Position and Tool Orientation Tracking Error ...................... 109 Figure 4.29: Simulation – Tool Tip Displacement and Feed Profile ........................................... 110 Figure 5.1: LAMB X-Y Table ..................................................................................................... 112 Figure 5.2: X-Y Table System Overview .................................................................................... 113 Figure 5.3: Torque Mode Open Loop Diagram ......................................................................... 114 Figure 5.4: PID Controller Bode Plot ........................................................................................ 117 Figure 5.5: General Close Loop Control System ....................................................................... 117 Figure 5.6: Lead Compensator Bode Plot ................................................................................. 118 Figure 5.7: Lag Compensator Bode Plot ................................................................................... 119 Figure 5.8: Loop Shaping Controller Bode Plot ......................................................................... 121 Figure 5.9: Pole Placement Controller Block Diagram .............................................................. 122 Figure 5.10: Open Loop Linear Rigid Body Feed Drive Dynamics Model ................................... 125 Figure 5.11: X-Axis FRF Experiment ......................................................................................... 127 Figure 5.12: Y-Axis FRF Experiment ......................................................................................... 128 Figure 5.13: Controller Evaluation: Displacement and Feedrate Profile ................................... 129 Figure 5.14: Loop Shaping Controller Position and Tracking Error ............................................ 130 Figure 5.15: Loop Shaping Controller Contour Error ................................................................ 130 Figure 5.16: Loop Shaping Controller Contouring Performance ............................................... 131 ix Figure 5.17: Pole Placement Controller Position and Tracking Error......................................... 133 Figure 5.18: Pole Placement Controller Contour Error ............................................................. 133 Figure 5.19: Pole Placement Controller Contouring Performance ............................................ 134 Figure 5.20: Sliding Mode Controller Position and Tracking Error ............................................ 135 Figure 5.21: Sliding Mode Controller Contour Error ................................................................. 135 Figure 5.22: Sliding Mode Controller Contouring Performance ................................................ 136 x Nomenclature Acceleration Objective Function coefficient for Jerk Minimization Feed Correction Polynomial Coefficients Mechanical Plant Equivalent Damping Objective Function coefficient for Chord Error Objective Function coefficient for Data Point Error NURBS Lower-Spline Toolpath Equation NURBS Upper-Spline Toolpath Equation CAD Computer-Aided Design CAM Computer-Aided Manufacturing CNC Computer Numerical Control Projection Matrix Maximum Chord Error for Feedrate Limitation Maximum fitting error limit at Data Points Tool tip Position Error between Data Point and Corresponding Spline Location Orientation Error Mean Square Tolerance in Feed Correction Polynomial Fit Tolerance in Quadrature Displacement Calculation Feed Homogeneous Transformation matrix Identity Matrix Jerk Mechanical Plant Equivalent Inertia Objective Function for 3 rd derivative minimization xi Objective Function for fit error minimization at Data Points Objective Function for Chord Error minimization Basis Function 3rd derivative Integration Matrix Curvature of a curve Basis Function Integration Matrix Discrete kth time step Constraint Matrix Required Extra length for desired change in feedrate Minimum Required length for desired change in feedrate Lagrange Multiplier MAL Manufacturing Automation Laboratory MSE Mean Square Error (Variance) Last index of Tool Path Data point data where M + 1 = # of data points Last index in a Knot vector where m + 1 = # of knots NURBS Non-Uniform Rational B-Spline B-Spline Basis Function: is the corresponding control point and is the degree Last index of the B-Spline Control Points where n + 1 = # of Control Points Tool Orientation Control Point of B-Spline Control Point of Upper B-Spline Degree of B-Spline B-Spline Basis Function Matrix Motor Drive Positions in terms of NURBS toolpath curve parameter Motor Drive Positions in terms of Tangential Displacement Normalized Motor Drive velocity with maximum drive velocity xii Normalized Motor Drive velocity, acceleration with maximum drive acceleration Normalized Motor Drive velocity, acceleration, jerk with maximum drive jerk Chord Error Integration Upper Spline Data Points Tool Tip Location Data Points Tool Tip Location Estimate Rotation Matrix Rational B-Spline Basis Function (weights included) Local Curve Radius of Curvature Total Displacement Total Chord length formed by Data Points Arc Displacement Parameter Arc Displacement from Numerical Calculation Arc Displacement Data from Numerical Integration Normalized Displacement parameter for Feed Correction Polynomial Normalized Tool Axis Orientation Vector Knot Vector Node Translation Homogeneous Matrix Sampling Time B-Spline Knot Vector Curve Parameter Curve Parameter estimate using Feed Correction Polynomial Curve Parameter Estimates for corresponding Data Points Knot vector node to be inserted Tangential Feedrate xiii Maximum Tangential Feedrate NURBS weight function Weights of the B-Spline Cartesian Motor Drive Positions Rotary Motor Drive Positions Toolpath Position w.r.t. workpiece Constraints Vector xiv Acknowledgements The time spent at Manufacturing Automation Laboratory has been an invaluable experience to me. I would like to express my sincere gratitude to my research supervisor, Dr. Yusuf Altintas for his guidance and support. He has shown time and time again that having a good understanding of the underlying picture, and an appreciation for good communication can really help in steering away from frustration and focusing on the matters at hand. His instructions were invaluable throughout my studies and I really appreciate it. I wish to thank my colleagues for sharing their knowledge, experience and problems with me. I feel lucky to have had a chance to witness the different personalities, and the different attitudes within the lab. It was always thrilling to talk about research to have the discussion drag on to the more philosophical issues around life. I was especially lucky to have an exceptional friend, Ken, who at many times gave me nothing but trouble and frustrations, but also whom I can always show my immature self and was always able to put me at ease. I would also like to acknowledge Dr. Nagamune who gave me invaluable feedbacks and for his kind answers in responding to question that I posed. This research was sponsored by the Natural Science and Engineering Research Council of Canadian Network for Research and Innovation in Machining Technology (NSERC CANRIMT). Chapter 1. Introduction 1 Chapter 1 Introduction The manufacturing industry today has many interests and applications in precision free- form machined parts, and the demand for high-speed machining (HSM) is ever increasing. Die and mold designs for small-scaled commercial parts, the stamping dies of an automotive body panel, as well as propeller blade designs are typical examples of free-form contour machining. The machining of complex dies, molds, aerospace, automotive and biomedical parts have become a major research focus in the past decades because of the advances seen within the Computer Aided Design (CAD) community to apply smooth spline representations of complex free-form surfaces. Non-uniform rational B-splines (NURBS) are extensively used in CAD today because of their flexibility and precision in handling complex geometries; providing an exact and uniform representation of parametric curves that easily allows for analytical and numerical manipulations. In addition, the wide spread use of robust and high performance five-axis computer-numerically controlled (CNC) machines has allowed the manufacturing industry to take advantage of machining these complex sculptured free-form surfaces. The orientation positioning provided by the additional two axes over traditional three axes CNC machines provide the optimal posture and orientations that are adjusted in real time in response to the varying surface curvatures. The implementation of NURBS interpolation techniques to high performance CNC machines have been a constant focus. Conventional linearized toolpath trajectories composing of numerous straight line segments cannot provide the smooth surface finish that is desired and forces the machine to decelerate and stop at the joint segments. This increases machining time tremendously and denies accurate tool positioning. In addition, for machines with rotary axes that support significant masses during operation, this imposes severe limitations on the motors’ acceleration and torque limits. Furthermore, these abrupt accelerations and decelerations of the tool motion can result in contour error where tangent and curvature continuities are not met at the joint segments. They may also excite the feed drives or the mechanical structures and cause undesired vibrations at the tool tip that cannot be properly tracked with the limited performance of the CNC controllers. By introducing the higher order parametric NURBS scheme into the CNC system, these problems can be reduced and better feedrates, higher accuracies and surface qualities can be achieved. Chapter 1. Introduction 2 The major advantage of NURBS interpolation techniques is the overall smoothness and flexibility of the toolpath. In order to acquire a NURBS toolpath from discretized machine code or toolpath data points that are attained from CAD software, there are numerous fitting algorithms. There are local fitting algorithms where the continuity between individual curve segments is maintained, and there are global methods of using least squares fittings to minimize the error between the NURBS toolpath and the data points. Geometrical and smoothness factors are also considered during the fit. The main problem with using NURBS interpolation techniques is that, unlike traditional linear or circular interpolation techniques where the length of the segment is known analytically, the length of the NURBS toolpath is not. When the curve is interpolated with constant curve parameter increments, the tangential tool travel displacements are not constant and undesired feed fluctuations can occur during real time interpolation. Feed fluctuations can bring about high accelerations and jerks to the motors, leading to the possibilities of feed drive saturations or excitations, thus leaving surface deflects on the part and reducing the overall surface quality. Large contour errors can also result and violate the part tolerances. The methods of Taylor expansion and the Feed Correction Polynomial Interpolation methods are implemented and their effects on feed fluctuations are compared in this thesis. Feedrate profile scheduling is important in the reduction of cycle time. While having high feedrates will inevitably reduce machining time, considerations on drive constraints as well as part geometry can allow for higher tracking performance and increased overall productivity. Drive saturations severely limit the tracking performance of the CNC system. A jerk limited trajectory profile is used to ensure the smoothness of the trajectory profile and a simple method is used to maximize the feedrate to meet the kinematic constraints of the drives and the geometrical constraints imposed on the feedrate. The X-Y Table is a common control platform in CNC machines used to direct a work piece during machining operations. X-Y Tables are built and configured to provide high- performance positioning along multiple axes. They are commonly used for moving a large work piece which requires a greater machining area. Compared to the moving spindle mechanism in CNC machining, the moving X-Y table has a greater tolerance to vibrations with its greater system inertia. An industrial X-Y table is implemented and its performance with various controllers is analyzed. Chapter 1. Introduction 3 Figure 1.1: Trajectory Generation Overview Discrete Tool Tip Contact Data Discrete Tool Orientation Data CAD Model NURBS Toolpath Planning : Lower Position Spline : Upper Spline Numerical Arc- Length Integration data Arc Displacement C u rv e P ar am et er Interpolation Multiple Feed Correction Polynomial Fit: D is p la ce m en t Feed Motion Planning Time Fe ed Time Real Time Interpolation Feed Drive Controller Controller Machine Tool Inverse Kinematics Orientation & Position Reference Motor References Double NURBS Toolpath Feed Constraints Chapter 1. Introduction 4 The overview of the trajectory generation process is illustrated in Figure 1.1. The review of related literatures is presented in Chapter 2. A smooth NURBS based five-axis toolpath generator is presented in Chapter 3 to represent the discretized CAD model data. A numerical integration method is shown to accurately integrate the displacement arc-length along the toolpath. The real time interpolation methods for the NURBS toolpath and the feedrate scheduling algorithms are explored in Chapter 4. The implementation of an industrial X-Y table and the feed drive controller designs are presented in Chapter 5, followed by the conclusion and a discussion of some possible future research directions in Chapter 6. Chapter 2. Literature Review 5 Chapter 2 Literature Review 2.1 Introduction/Overview Toolpath planning and reference command generation play significant roles in the automation of robotics and CNC machine tools. Toolpath planning has to maintain high conformity and ensure the smoothness and geometrical tolerance to the CAD model of the part. In order to properly interpolate the more complex toolpaths of free-form surfaces, more robust and advanced interpolation techniques are required for the tool path. These interpolation techniques have to be capable of being processed in real time as well as complement the feedrate profiles. The feedrate profiles are planned to meet the constraints imposed by the motor limits and the CNC dynamics while maximizing the feedrate to minimize cycle time. This chapter presents a review of the relevant literature involved with NURBS toolpath generation, interpolation methods for the NURBS toolpath, followed by a review of feedrate optimization. 2.2 Tool Path Fitting for Free-form Machining The use of splines and other parametric curve representations for complex parts with smooth surfaces in high speed machining operations have not been hugely popular two decades back. However, incentives of processing and transferring large amounts of geometrical information from the much more advanced CAD software models to the CNC system, as well as the increased demands for higher precision parts within the mold and die, and especially in the aerospace industry, advocated the push for using smoother cubic, quintic, Bezier and B-spline curve representations. To represent a free-form surface with linear segments, a large amount of geometric data points are required which leads to significant reduction in curve accuracy. It has been demonstrated that linear interpolation methods have the following limitations: Velocity discontinuities at the linear joint segments, increased machining time from the deceleration of each segment, poor surface finish, loss of geometric information and lower part accuracies. Rather than using conventional linear and circular segments of representing toolpaths, the fitting of splines and the use of direct spline trajectory generation methods have been demonstrated by researchers such as Koren and Lo [27] that the much smoother and continuous motions can reduce these problems. Chapter 2. Literature Review 6 Earlier works in the 1970s by Pierre Bezier has popularized the use of the Bezier curve in industrial applications and since then, Bezier curves have been widely used in CAD for the modeling of smooth curves. The B-spline curves are a generalization of the Bezier curves, with the use a knot vector and a set of recursive blending functions to allow for local curve modification and for the degree of the curve and the number of control points to be selected independently. The non-uniform rational B-spline (NURBS) curve is a further generalization of the B-spline curve, allowing a non-uniform knot vector and weighted control points. For many computer applications, the use of B-spline representations have been used much earlier in computer vision to smooth out corners in image processing [44] and to give accurate approximations of the original object. Significant data compressions were achieved for using these B-splines representations. Bahr et al. [5] applied a real time cubic parametric curve interpolation scheme to a CNC system and showed that there were low interpolation errors and small variations in jerk. Piegl and Tiller [48] were able to approximate the NURBS curve by using a bi-arc formulation which allowed CNC machines to make use of existing circular interpolations to represent NURBS curves. Erkorkmaz and Altintas [19] proposed the Optimally Arc Length Parameterized quintic splines which optimized the discrepancies between the spline chord length parameter and the travelled arc length in quintic splines. Details involving global and local approximations and exact interpolation fitting algorithms for NURBS curve and surface can be found in Piegl and Tiller [47]. In this thesis, the least squares global approximation method will be implemented. 2.3 Interpolation At every sampling step of the CNC controller, the spline toolpath is interpolated in real time. This provides the reference command for the position tracking loop of the CNC servo system. The desired tangential displacement of the tool tip at the current feed step is interpolated with the spline toolpath to retrieve the curve parameter necessary to acquire the position reference. One of the main motivations of using parametric interpolation is to reduce the amount of geometric information transferred between the CAD and the CNC system [55]. Instead of the CNC machine processing the large amount of broken down linear line segments with the typical CNC linear interpolator, Shpitalni and Koren [55] have shown that for smooth curves where the first derivatives exist, the first order Taylor expansion has been shown to handle both implicit curves as well as curves in parametric forms and that the first order Chapter 2. Literature Review 7 approximation is adequate when sampling time is small and the curve maintains a high radius of curvature. Greenway and Zhang [69] were the first researchers in applying the NURBS interpolation to a six-axis robot with the first order Taylor’s expansion to prove the feasibility of the NURBS interpolator in real time motion. Yeh and Hsu [67] applied a compensatory parameter of reducing the drive speed to improve the curve accuracy for parametric curves. A constant curve speed was used together with acceleration and deceleration sections to interpolate a NURBS curve. Zhiming et al. [70] applied the second order Taylor’s expansion for the NURBS interpolation with a variable feedrate. Using a dependence on the toolpath curvature, the chordal deviation error and the sudden changes to feedrate were minimized. Cheng et al. [7] compared different numerical algorithms for the NURBS motion command generator: 1st order and 2nd order Taylor’s expansion, Runge-Kutta approximation and an iterative corrector- predictor method. While the Runge-Kutta can theoretically outperform the Taylor’s Expansion methods in terms of geometrical accuracy, its long computation time makes it inadequate for real time computations. The corrector-predictor method avoids the computation of the curve derivatives, but instead uses the trend from the previous curve parameter values. It was found that unlike the direct approximation methods, the computation time of the corrector-predictor method was unstable and can vary hugely depending on the toolpath. Tsai et al. [60] later improved the structure of the corrector-predictor model; however, it still suffered from problems such as large feedrate errors where the curve exhibited large curvatures, similar to the Taylor’s Expansion, and unstable computation times. The problems associated with the Taylor’s expansion are the long computation time involved in calculating the curve derivatives, and that variable feedrate methods face problems with the accumulation of numerical errors and round off errors. Erkorkmaz and Altintas [19] introduced the use of a feed correction polynomial. By using a set of numerically calculated arc- lengths at increments of the spline parameter, a 7th order polynomial can be used to approximate and express the arc-length, curve parameter relationship between the increments. Lei, et al. [32] introduced a similar method using cubic Hermite splines and also incorporated the numerically-calculated arc-length increment to the Taylor’s expansion to make it more robust. Heng and Erkorkmaz [22] continued to expand the method by joining multiple polynomials for better fitting results between curve parameter and arc-length. Chapter 2. Literature Review 8 2.4 Feed Optimization In machining applications of molds, dies, aerospace and automotive parts, the minimization of cycle time, and having a continuous and smooth feedrate profile are extremely important factors for increasing productivity. The quality and part surface integrity has to be maintained despite the constant push for using higher feedrates. When a constant feed is specified by the process planner in a cutting operation, the CNC machine tries to match the tangential feed of the cutting tool by controlling the velocity, acceleration, and jerk profiles of all the drives. The trajectory profiles of the drives must maintain continuity in position and derivatives to enable better tracking performance and prevent the excitation of the machine. There are also constraints to avoid saturating the individual actuators. When the velocity, acceleration, and jerk of a drive exceeds its physical limitations, nonlinear effects from the saturation can result in instability, poor part surface quality, and potentially damaging the machine. While using conservative feedrates can prevent drive saturations and ensure machining tolerances, the cycle time of the machining operation may increase significantly. The challenge is to minimize cycle time by maximizing feedrate while considering the constraints imposed on the actuators. One of the main focuses of achieving smooth motion is to limit the jerk of the actuators and the feed motion. Constantinescu and Croft [9] determined the feasibility regions of solving for the velocity, acceleration, and torque rates in a time-optimal problem for robotic manipulators. Erkorkmaz and Altintas [14] presented a jerk-limited trajectory profile by bounding jerk in a piecewise manner. Later Erkorkmaz [18] introduced a cubic jerk trajectory profile that provided continuity between the piecewise jerk bounds. Macfarlane and Croft [9] applied sine waves as the ramps of the trajectory profiles to maintain high continuity and smoothness at the transients. Optimization techniques were later developed to solve for an arbitrary displacement profile that would result in minimum jerk and cycle time. Erkorkmaz and Altintas [19] introduced a quintic displacement profile to iteratively solve for the spine coefficients while being conservative to the drive constraints. This type of feed profile can be scheduled continuously and can be applied to a variety of applications. Rather than using commonly defined profiles, many researchers have also developed algorithms for adaptive feedrate modulations in order to achieve various part tolerances. Yeh et al. [67] has shown the geometrical dependence on feedrate where the curvatures of the toolpath are large and that Chapter 2. Literature Review 9 feedrate can be adapted to reduce feedrate fluctuations. Lin et al. [36] has shown that contour error can be considered when considering feedrate scheduling, however, an iterative approach, as well as a well known system dynamics are required for their method. Using a heuristic method of satisfying the constraints along the different segments of the toolpath, Heng and Erkorkmaz [22] presented a method to search for the possible feedrate by considering the feasible solution regions of the limited jerk feed profile, allowing feedrate to be iteratively solved and modulated. In this work, the limited jerk multi-segment feed profile is applied to modulate between segments of constant feed to meet the local feedrate constraints to keep the motors within their kinematic limits and the part to be within their geometrical tolerances. Chapter 3. NURBS Toolpath Generation 10 Chapter 3 NURBS Toolpath Generation 3.1 Introduction A reference toolpath is a key component in CNC machining. The generated toolpath has to maintain a high geometrical tolerance, as well as ensure a smooth profile that can be successfully tracked by the CNC machine. The kinematic profile of the toolpath is also an important consideration in minimizing machining time, and avoiding excitations of natural modes of the CNC machine tool structure. Traditional CNC toolpaths have always consisted of linear and circular segments. However, to machine parts with complex free form surfaces, the CAD model has to be broken into a large amount of micro linear segments to approximate the original CAD model. The loss of important spline features brings about discontinuities in machining and large surface part errors. A large amount of geometrical information is consequently fed as G codes to the CNC machine to make use of their linear and circular interpolation algorithms to machine the part. This has huge effects on surface finish, part quality and machining time. In order to overcome these challenges, toolpaths are constructed for cubic and quintic curves to provide continuous motion to the CNC machine as a replacement to linear segmentation. Smoother toolpaths with the cubic polynomial splines ensure continuity and allow for continuous acceleration profiles. 3.2 NURBS Background The Non-Uniform Rational B-Spline (NURBS) curve has been widely used in CAD systems due to its many advantages: 1. Intuitive control points 2. Local curve shaping capabilities 3. Curve smoothness The NURBS curve is a generalization of the B-spline curve where all the control points are weighted. A NURBS curve is illustrated in Figure 3.1. The set of control points, and the associated weights, , form the shape of the curve, and the knot vector, , determines the distribution and influence of the control points within the interval Chapter 3. NURBS Toolpath Generation 11 of curve parameter . As shown in Figure 3.1., increasing the weight of a control point pulls the curve towards the control point. Due to the property of local shaping, only the knot range of is affected, where is the degree of the curve. Figure 3.1: NURBS Curve Representation a). NURBS Curve (Blue), Control Points (Green), Knot Spans (Red) b). B-Spline Basis Functions A NURBS curve is defined as: (3.1) Chapter 3. NURBS Toolpath Generation 12 The NURBS curve can also be written as: (3.2) where is known as the rational basis function. The basis function, , and the rational basis function, , are scalar functions of the curve parameter . Some useful properties taken from Piegl [47] regarding the NURBS curve are listed below: Nonnegativity: Partition of unity: Local Support: is infinitely differentiable on the interior of knot spans and is times differentiable at a knot of multiplicity The knot vector U defines the B-Spline basis functions, . The knot vector of NURBS is a set of non-decreasing sequence of real numbers and has the following form of being non-periodic and non-uniform: (3.3) where . Each element within the knot vector is called a knot. The knot vector is non-uniform because there are repeated knots at the beginning and at the end of the knot vector. The purpose of the repeated knots is for the NURBS curve to pass through the first and last control points, and , and define a curve segment. The internal knots are defined by . Consecutive knots form the half-open interval , called the th knot span. The key advantage of the NURBS curve over the Bezier curve is that the knot vector allows the NURBS curve designer to define the degree of the curve and the number of control points separately. The number of control points is , and the degree of the curve is ; together Repetitive p+1 Knots Repetitive p+1 Knots Chapter 3. NURBS Toolpath Generation 13 there are or knots within the knot vector of a curve segment. The relationship of the knot vector size of knots and control points is such that the contribution of every control point is in the range of the knot interval . Outside this range, the influence of the control point is zero, which provides the NURBS curve the property of local shaping. A knot vector can also contain the knots of multiple curve segments. The following is an example of a knot vector for a piecewise cubic (p = 3) NURBS curve: (3.4) The two curve segments are defined in the intervals of and . The curve is separated at , signified by the repeated knots. There are 14 knots in the given knot vector, = # of knots – 1 = 13, and there are – = 10 control points, = # of control points – 1 = 9. The piecewise knot vector can be decomposed into: (3.5) The first curve segment will have 6 control points and the second curve segment will have 5 control points where . The knot vectors determine the influence of each of the B-Spline basis functions and give the NURBS curve the property of being a piecewise rational polynomial and allow local modifications to the curve. (3.6) (3.7) The B-Spline basis functions are recursive as indicated in (3.7) where the zero degree basis functions are step functions as shown in (3.6). Higher order, degree, basis functions are linear combinations of two lower degree, , basis functions. A degree basis function and its derivatives are equal to zero everywhere except on the half-open . Chapter 3. NURBS Toolpath Generation 14 Figure 3.2: B-Spline Basis Functions and Derivatives The derivatives of the B-spline basis functions are also calculated recursively. The first derivative of the degree basis function with respect to the curve parameter u is given as: (3.8) and the derivative is given as: (3.9) Figure 3.2 shows the lower order piecewise basis functions and their first derivatives. For NURBS curves where all the weights are equal, the derivative of the curve is simply: (3.10) 1 0 Deg: spans 0 0 0 1 0 1 0 Deg: spans Deg: spans Chapter 3. NURBS Toolpath Generation 15 When weights are not all equal and are being considered, (3.11) where and are defined respectively as: (3.12) (3.13) This form allows the derivatives of the NURBS curve to be solved as the following: (3.14) (3.15) (3.16) (3.17) Using the above Eqn. (3.17), the derivatives at the end points of the NURBS curve can be found. The following Eqn. (3.19) is an alternative formulation to the derivatives of just the B- spline (with weighted control points) that is expressed in terms of the control points instead of the derivative of the basis function. This allows the control points at the ends of the NURBS curve to be solved if the curve’s boundary conditions are given, i.e. to keep continuity with the previous curve. Chapter 3. NURBS Toolpath Generation 16 (3.18) (3.19) From the first derivative of the NURBS curve, the second control point can be solved as follows: ( can be set to 1 and is equal to the end point of the previous curve segment) (3.20) Similarly the third control point can be found from the second derivative of the NURBS curve, and from the first two control points (giving the curve continuity) and it is found as the following: (3.21) where is the following: (3.22) In addition to the knots of a knot vector, the peak of a basis function is known as a node, , defined as: (3.23) Chapter 3. NURBS Toolpath Generation 17 These nodes are calculated from the average of the knots. Nodes represent the curve parameter values where the influence from a particular control point is at its maximum. When a particular point on the curve needs to be modified and moved to a specified location, it can be achieved with minimum modification by moving the control point with the closest node to . If there are no existing nodes nearby, either the two control points with nodes closest to need to be moved or a node can be placed at A knot can be inserted to the existing knot vector to place a node at . The new node is placed as the index of , where the index is found by the following: (3.24) Then to create the node , the knot is inserted: (3.25) Node insertion will be useful in adding additional freedom to the curve during the toolpath fitting process in between each optimization step since the control points are used as the fitting parameters. The additional control point will have its largest influence at the curve parameter value , which can be used by the optimization algorithm to penalize for the local fitting error. Knot insertion is a fundamental technique in NURBS manipulation where the knot is inserted in the existing knot of to form the new knot vector: (3.26) The weighted set of control points are denoted as and the set of new basis functions found with the new is denoted as , then a new set of weighted control points can be found such that the following is satisfied: Chapter 3. NURBS Toolpath Generation 18 (3.27) The resulting NURBS curve is unchanged, but there is an additional knot and control point that was inserted, which provides an added flexibility for modification. The new weighted set of control points, , can be found as: where (3.28) Figure 3.3 shows an example of knot insertion where the same NURBS Curve is presented with different number of control points. Figure 3.3: Knot Insertion (Same NURBS Curve (Blue), control points (Green), control points (Red)) 3.3 Double B-Spline Toolpath Representation The toolpath in five-axis free-form sculptured machining can be expressed as the motion of the tool tip contact point with the work piece, known as the cutter contact (CC) toolpath and the tool orientation. Every CC toolpath corresponds to one line or curve on the surface. The tool orientations are usually selected to maximize material removal rate and to match the surface curvatures. Tool orientation is also very important in avoiding tool collision and gouging the surface. In order to preserve this desired tool motion, the toolpath format proposed by Chapter 3. NURBS Toolpath Generation 19 Langeron et al. [31] is implemented. Figure 3.4 illustrates this toolpath format consisting of two splines, each being dedicated to the following: The CC tool tip positions is fitted with a spline in part coordinates, i.e. the work piece frame Another point on the tool axis is fitted with a spline Figure 3.4: Double B-Spline Toolpath Representation Both the upper spline and the lower spline can be represented with the NURBS formulation. The upper control points are different from the control points of the lower spline, but their knot vector can be the same. For simplicity, the weights can be set to one. The purpose of this representation is such that for every curve parameter value of , a corresponding tool tip CC position and the tool orientation can simultaneously be obtained from the double splines. (3.29) The difference between the upper and lower splines gives the tool-axis vector , which can be normalized to give the unit orientation vector : Lower Spline Upper Spline Tool Orientation Chapter 3. NURBS Toolpath Generation 20 (3.30) 3.4 Global Approximation Fit From standard CAD/CAM software, the tool tip CC toolpath can be retrieved as discrete data points when the planning process breaks the model down into linear segments. Normally, the tool orientation is normal to the free-form surface, and should also be known at these discrete data points. In 5-axis free-form machining, if the large amount of data is interpolated with local individual curves, it may result in non-smooth motion of the cutting process. The least squares global approximation fit for a NURBS curve is used to limit the number of individual curves and tolerances are assigned to limit the error resulting from the least squares fit. The algorithms for the general global approximation least squares fit are taken from Piegl [47]. Figure 3.5: NURBS Global Approximation Fit Chapter 3. NURBS Toolpath Generation 21 Let the set of tool tip CC positions be denoted as with data points, , and let the resulting predictions of the fit from the least squares spline fit be denoted as for the lower spline, then the objective is to minimize the error between the actual data points and the resulting fit predictions as illustrated in Figure 3.5. is the set of spline parameter values that correspond to the given data points, and they are initially calculated using chord length parameterization as given in Eqn. (3.32). This initial parameterization distributes the data points by considering the Euclidian distance between the data points. This is a very rough estimate of the curve parameters since the arc lengths between the corresponding points of the fitted curve will be quite different from the chord lengths of the data points. In addition, there is also no explicit relationship between the arc length of the curve and the curve’s parameter. The total chord length between all the data points can be found using: (3.31) The initial and final parameter values are set as , and the internal curve parameter values are normalized against the total chord length as shown: (3.32) The initial knot vector, U, is predefined and obtained as described by Piegl [47]. The length of the knot vector is based on the number of control points, , and the degree, , of the curve. There are a total of or knots, and since the initial and final knots are repetitive and are set as zero and one respectively, there are internal knots and – knot spans: (3.33) Chapter 3. NURBS Toolpath Generation 22 To distribute the data points amongst the knot spans, d is defined as a positive real number. (3.34) The – internal knots are found with the follow equations: (3.35) By pre-defining the knot vector and all the weights to be one, Figure 3.6 shows each of the basis functions (color) being evaluated at the chord length parameterized curve values, , (dashed) to form the matrix . Then a system of linear equations can be formed to calculate the position predictions on the B-spline curve for the data points: (3.36) Figure 3.6: Basis Function Evaluation at Chord Length Parameterized Values Chapter 3. NURBS Toolpath Generation 23 The control points, , are the fit parameters. The errors between the actual data points, , and the computed points on the fitted curve at , is given as : (3.37) The least squares objective function becomes the minimization problem of : (3.38) This least squares problem can be solved by setting the derivative of the objective function with respect to the minimization parameter, the control points, to zero. (3.39) This provides the control points for the NURBS curve in the least squares fit. However, since the initial control point is coincident with the initial position of the toolpath, and the second and third control points can be found from the initial first and second derivatives, the first three control points can be found directly using Eqn. (3.20) & (3.21) to achieve continuity. In that case, can be broken down into the known and unknown components: (3.40) where is known and can be lumped with . If this is solved with the minimization function of the Matlab optimization toolbox [42], the new fit parameter can simply replaced by: Chapter 3. NURBS Toolpath Generation 24 (3.41) where is of size and is the fit parameter for the unknown control points, are the known control points and P is now used in the minimization problem of . For simplicity, the minimization will still be denoted as . In addition, to cascading known control points onto the fit parameter, additional positional, tangential, or higher derivative constraints can be included using the method of Lagrange Multiplier to compose the constrained least squares minimization problem. Let specific position constrains be denoted by ,the linear equations are shown as: (3.42) Similarly, the constraints for the tangents, , and the second derivative, , are imposed using the derivatives of the basis functions and are given as and : (3.43) Chapter 3. NURBS Toolpath Generation 25 The constraint matrix is cascaded into , and the constraint vector as . The tangent and higher derivative constraints can either be specified by the designer, or the first and second derivative values at can be estimated with the cubic polynomial derivative estimation method described in Erkorkmaz [14]. Up to the third derivative can be estimated by extending the estimation polynomial to a quintic polynomial. However, due to a lack of extra neighboring points at the beginning and end of the series of estimation polynomial, the derivative estimates at the beginning and end are less accurate and contain undesired noise. With the additional equality constraints, the optimization problem becomes: (3.44) This is a linear quadratic minimization problem, and can be solved using the Lagrange Multipliers, denoted as: , where , the augmented objective function can be written as: (3.45) This minimization can be solved by equating the partial derivative of the two control parameters to zero , which yields the following linear equation system: (3.46) A solution can only be obtained if is positive definite and non-singular. The method of defining the initial knot vector from Eq. (3.34) & (3.35) ensured that every knot interval contains at least one value to satisfy the non-singularity condition of . In addition, provided that the constraints are linearly independent and less than the number of unknowns , an unique solution can be obtained. Chapter 3. NURBS Toolpath Generation 26 For the global fitting of the lower position spline, , the CC discrete toolpath position data, , are used in the minimization algorithm. The fitting of the upper spline takes place after the lower spline is fitted since the purpose of the upper spline is to provide the desired reference orientation vector with the toolpath, which now has a lower spline curve interpolation as . The reference data points for the fitting of the upper spline is updated as an offset to the lower spline in the direction of the reference orientation , by a scalar value of H. The reason for the update is because there is some associated error with the lower spline fitting and the upper spline fitting, and if is not updated, there will be two sources of error contributing to the interpolated orientation. By updating , the first source of error associated with the lower spline can be eliminated. The updated upper spline data points are: (3.47) 3.4.1 Tolerance Definition and Parameter Correction The global approximate least squares algorithm minimized the least squares error with the given initial knot vector, U, at the chord length parameterized curve parameter values of against the set of data points. The problems are that with the flexibility of the limited control points as defined by the size of the knot vector, the desired fitting error limit may not be achievable, and that the curve parameter values may not be a good approximation for the data points. A fitting error limit is defined to control the deviation of the lower spline from the reference data points. Figure 3.7 illustrates how the fitted toolpath is within the allowable tolerance band as given by for all the data points. Figure 3.7: Tolerance Definition Tool 1 2 4 3 6 5 1 Max Allowable Error 2 Contact Location Data Point 3 Lower NURBS Toolpath 4 Allowable Error Band 5 Tool Contact Location 6 Point Error Chapter 3. NURBS Toolpath Generation 27 After the curve fit, the formulation for the curve is now available, making it possible to compute and update the corresponding values on the curve that are closest to the data points. For each of the data points, the closest curve parameter value can be solved using point projection as shown in Figure 3.8. It is known that the minimum distance occurs where the vector is perpendicular to the tangent of the curve at and it can be found using the following dot product: Figure 3.8: Corresponding Spline Parameter (3.48) The roots of can be found using the Newton-Raphson method. (3.49) The convergence of the Newton iteration is highly dependent on the initial guess of and the initial guess of that was computed based on chord length approximation may not necessarily converge. The lower bound of the search should always be , where , since the curve parameter for the NURBS curve is always monotonically increasing. The upper bound for the search is the last value in the knot vector, . This iteration is terminated when either bound is violated. The iteration is considered to have converged, when either the Euclidean distance or the cosine of the distance vector and the curve tangent (i.e. ) or the change in parameter is small as indicated by the following conditions: Chapter 3. NURBS Toolpath Generation 28 The criteria that the current point computed at is already within Euclidean distance tolerance to the data point is the following: (3.50) The criteria that the cosine of the angle or is small and within the specified tolerance of : (3.51) The criteria that the curve parameter does not change significantly during the iteration: (3.52) A value of for is typically more than adequate for basic machining operations to indicate that the data point lies on or very close to the curve at . The cosine angle tolerance, , indicated that is a valid root of and is selected to be less than , such as . In cases where the iteration is terminated without convergence, the initial guess of needs to be adjusted. Another guess can be picked to be within the current knot span: . If convergence is still not achieved after several trials within the current knot span, the next knot span of is searched and this is repeated until either convergence is achieved or until some clipping algorithm determines that the curve is now moving away from the data point. In the case where convergence cannot be achieved, the value where was minimum during the search process is taken. Once is found, the point error is computed as: (3.53) When all the , the lower spline fit is complete. When this is not satisfied, the number of control points used for the fitting process is increased. The goal of the global approximation fit is to satisfy the specified tolerance with the minimum amount of Chapter 3. NURBS Toolpath Generation 29 control point. While having a lower number of control points will result in higher errors at the tool path data points, each control point has its influence on the curve and having more control points would increase the fluctuation along the toolpath. While the initial number of control points required is not defined optimally to adequately capture the overall shape, 5% of the total given toolpath data points, is used as the initial number of control points. Using Eqn. (3.35), the initial knot vector is generated which allows the lower spline to be fitted. Then, are found and updated using Newton-Raphson iteration and the point error condition is checked. If the error condition is not satisfied, the knot value is found using Eqn. (3.25) to add a node at the value where the largest point error occurred, and it is added with Eqn. (3.28). Adding a node at this curve location will reduce the errors at this portion of the curve. The new set of control points can be used as initial conditions for next fitting operation if the Matlab optimization toolbox is used. This process is repeated until the lower spline satisfies the tolerance. While the maximum data point error is a valid characterization for ensuring the geometrical tolerance of the toolpath on the lower spline, orientation error is a more relevant characterization for the upper spline. The orientation is the difference between the upper and lower splines, and the error in orientation is defined as the following: (3.54) After the lower spline is fitted, the same knot vector is taken and used to fit the upper spline. The set of data points is found using the fitted lower spline and the reference orientation vector, . The upper spline is fitted and the orientation error is checked. It is not likely that the fitting of the upper spline has to be iterated too many times, if at all, since the number of control points that are available to use as the fitting parameter has already satisfied the convergence tolerance of the lower spline and the number of data points, are both . The resulting outputs of the fitting process are the control points of the lower spline, Chapter 3. NURBS Toolpath Generation 30 , and the upper spline, as well as the knot vector, . Figure 3.9 illustrates the flow chart of the fitting process. Figure 3.9: Double Spline Toolpath Fitting Flow Chart Inputs: 1. Tool Tip Data Points 2. Orientation Vector Update Add Node Initial Knot Vector U Upper Spline C(u) Optimized Fit – OBJ FCN Subject to: Check: Point Error Initial Guess: Derivative Estimates Arc Length Parameterization No A Boundary Points For Continuity Update yes Lower Spline Optimized Fit – OBJ FCN Subject to: Same Knot Vector U Check: Add Node No Update Update Lower Spline Ctrl Points P yes Outputs: 1. Lower Spline Ctrl Pts: 2. Upper Spline Ctrl Pts: 3. Knot Vector: Upper Spline Data Points: Chapter 3. NURBS Toolpath Generation 31 3.4.2 Quadrature Chord Error with Minimization The linear least squares global approximation method was introduced to minimize the error between the set of discrete data points and the NURBS curve at the estimated curve parameter values of , which were parameterized based on the chord lengths. Due to the nature that only these selected points along the curve are minimized, in between these points, large errors are often observed between the curve and the chord of consecutive data points and . This section will describe a method to quantify these chord errors and attempt to apply a minimization scheme for these errors. At every curve parameter value , there is an associated chord error. Assuming that at the estimated curve parameter values of on the curve, the are valid correspondents to the toolpath data points , then for the region , the immediate chord formed by , is used. The chord error vector is calculated based on the method of vector projection as illustrated in Figure 3.10: Figure 3.10: Chord Error Projection The norm of all the chord error vectors can be integrated over the entire curve segment to represent the total chord error. Since there is a different chord for every consecutive toolpath data point , the scalar-valued total integration is separated into M-1 segments of . Each of the segment has its own projection matrix and its own origin at . (3.55) where is the projection matrix onto Chapter 3. NURBS Toolpath Generation 32 (3.56) is the NURBS curve equation, is the identity matrix. Since the basis functions of the NURBS curve can be expressed analytically, it is possible to solve these integrals analytically. However, it is much more computationally efficient to evaluate the integrals numerically using the 3/8 Simpsons Rule: (3.57) where . The interval of can be bisected into two subintervals, and , where . This forms the composite 3/8 Simpson’s rule where the integral over the region is approximated by: (3.58) By assigning a tolerance of , then satisfying the following condition of: (3.59) would imply that the functional variance over is kept in check. A tolerance value of is generally more than adequate for the solution to converge. The intervals are solved from the left to right. Whenever the tolerance given in Eq. (3.59) is not satisfied, the interval is sub-divided further. With every tier of sub-division, the tolerance used is halved (tighter tolerance). It is important to keep track of the tier of sub-divisions, as some regions of the curve are rather consistent while other parts may have large variances and require further divisions. This proceeds until all the sub-intervals of the region converge to the tolerance. The total sum of all the sub-divisions will give an approximation of the total Chord error in the interval. This is known as the adaptive quadrature method since the step size on the sections of the curve are adjusted based on the consistency of integration function locally. Chapter 3. NURBS Toolpath Generation 33 Figure 3.11: Chord Error Integration Figure 3.11 illustrates the integration of these chord errors. Note that this integration is different from calculating the area between the NURBS curve and the chord lines. For instance, if the norm of the error vector is one throughout the entire path with the knot vector defining the domain as , this integration will result in a value of , while the computed area can be of any positive value. With the Quadrature Chord Error defined, for each chord segment, the chord error can be integrated and expressed as the following: (3.60) This leads to the following minimum chord error objective function: where and = (3.61) Chapter 3. NURBS Toolpath Generation 34 In the global approximation fit, in order to minimize the error at the toolpath data points , the basis function was derived from the given knot vector and the basis function was evaluated at values of . The problem with this is that even though the formulation of the basis functions is known analytically, they are only evaluated at specific locations, effectively neglecting the contribution of intermediate values. The basis functions can be integrated easily using the Composite Simpsons rule (the adaptive method with the integration tolerance is not required since the basis functions are smooth and well-defined) to form the matrix of size : (3.62) A graphical representation of the matrix is shown in Figure 3.12. By having this integration matrix, the contribution of the basis functions within the region is known, which correspondingly provides the contribution of the control points within the region; this provides a much more accurate minimization than just minimizing at specific locations. Note that from the property of the basis function, the sum of all the vectors will yield a single vector which represents the area enclosed by each of the basis functions, and the sum of all these areas will yield . The matrix is providing the contribution of the control points in the regions that are of interest, i.e. to the immediate chord and it is scaled accordingly to the particular basis function. In addition, the is the factor that ensures the control points in the local region are being minimized to the relevant chord. Chapter 3. NURBS Toolpath Generation 35 Figure 3.12: Basis Function Integration in Region of Immediate Chord The previous optimization problem for the least squares fitting was given as: (3.63) and this is modified by adding the minimum chord error objective function: Subject to: (3.64) where and are the weights of the multi-objective minimization problem. is weight for the fitting effect at the tool data points, while is the weight for the fitting effect in between the tool data points. Since the effect from is contributed from the integration of u, and is the effect of discrete u values, generally should be set greater than . The effect of these weight factors will be investigated with simulations. 3.4.3 Jerk Minimization In the least squares fitting process, the curve is fitted based on geometrical error against the set of given discrete toolpath data. If the minimization scheme for the control points were only based on geometrical tolerances, the smoothness of the curve will be neglected and it Chapter 3. NURBS Toolpath Generation 36 would eventually decompose back into having linear segments connecting all the data points, having exactly zero error. In addition, during the fitting process, the knot vector was created based on chord length of the linear segmenting of data points; this will most likely not be the case once a curve is fitted to the points and the segment length along the curve will differ from the original chord lengths. Furthermore, as more knots are being added to the knot vector during the fit, extra control points are added to the curve. While this increases the flexibility of the NURBS curve geometrically, it also means that there is an extra pulling effort. Even though the NURBS curve is infinitely differentiable within the knot spans, it is only times differentiable at the knots of multiplicity . This can possibly lead to impulses embedded within the curve which could cause oscillations within the derivatives of the curve. These effects may excite the natural modes of the CNC system during operation and deteriorate its tracking performance. During machining operations, real time interpolation is applied to the NURBS curve toolpath to get the machine tool motion; excessive jerk is undesired as it leads to excitation of vibrations in the CNC assembly. While the jerk on tool motion is usually defined as the third derivative of tool tip displacement, s, with respect to time, , in this section, the smoothness on the NURBS toolpath is optimized. The jerk component of the geometrical curve is minimized and this will ultimately lower the tool motion jerk of . The tool position is given by . The geometrical jerk is defined as the third derivative of with respect to the curve parameter u, , and its minimization can be defined as the following minimization problem: (3.65) where and is a symmetric matrix, which is the integral of the third derivative of the basis function. This K matrix can be expressed analytically, but as extra knots are continuously being added during the fitting Chapter 3. NURBS Toolpath Generation 37 process, solving it using the Simpsons rule as in the previous section is much more computationally efficient. This jerk minimization is very similar to the chord error minimization except this does not have to be separated into M intervals for the different chords and origins. The purpose of this minimization is to attain the distribution of the third derivative of the basis function and ensure that the combination with the fit parameter, the control points P, is minimized along the path. By adding the minimum jerk objective function, the overall minimization problem becomes: (3.66) where is as defined in Eq. (3.61) and is the weight for the smoothing effect of the jerk minimization. The effects of the weights will be investigated in the subsequent section. The overall objective function along with the constraints result in a nonlinear optimization problem and it is solved using the Matlab optimization toolbox [42]. 3.4.4 Simulation Results The fitting algorithms are tested in simulations. The goal of the simulations is to fit the double NURBS spline toolpath to the given toolpath data points and try to achieve the specified geometrical tolerances and to verify the effects of the minimum chord error and minimum jerk objective functions. The machining tolerance for aeronautical parts is given around ~ 0.025 [mm][1]. The effects of the objective function coefficients are studied through simulations and fitting results on some test toolpaths. The first toolpath is a fan-shaped toolpath with 89 total data points for operating on an X-Y Table. Half of the toolpath was used, providing 45 discrete tool tip CC points and the overall size of the data points are about . The fitting process proceeded until there were 20 control points. The first 3 control points and the last control points were fixed to provide continuity at the start. At every step of the fitting process, a node was added at the value with the largest point error. The values for the objective function coefficients were varied and the results are analyzed. Chapter 3. NURBS Toolpath Generation 38 First the effect of the chord error minimization objective function was investigated by comparing to just the least squares fit. Mean point error is calculated at the data point where the end point errors are zero. The Quadrature Chord error is calculated as described in the previous section where the error was integrated between every data point and the M integration segments were summed. Mean Point Error: (3.67) Figure 3.13a). is the regular least squares fit without the influence of the chord minimizing coefficient and it has the lowest mean point error at the points. The effect of point error minimization is being subsidized for chord error minimization as is increased. It can be seen that when , the mean point error has slightly increased from to , however, the sum integration of chord error has decreased as intended from to . As was further increased to and , the chord error continued to minimize, and the mean point error went down as well. The lengths of these curves were found using numerical integration and as increased, the smaller length is indicating a smooth and less wavy curve. During the fitting process, when the chord error is lower, it is suspected that the search for the data point correspondent had much better results. This effect can be seen at around the X-Y location, . In the regular least squares fit, there is an extra effort forcing the curve to pass through the point, causing large chord error and unnecessary oscillation to the curve. With the effect of chord error minimization in Figure 3.13d)., the curve can be seen to have much lower oscillation and very low chord error. The effect of the chord minimization coefficient can be seen to be able to significantly reduce chord error. Next the effect of the jerk minimization coefficient is analyzed and presented. From Figure 3.14, it can be clearly seen that the mean error at the data points are increasing as the jerk minimization coefficient is increased. There is a significant jump in the data point mean error from to when the coefficient is introduced as and an even larger increase to as is increased to . However, it is also clear that the curves for and are significantly smoother than the curve with just the least squares fit. The oscillation at the beginning of the curve due to incompetent knot distribution has been reduced and almost eliminated. The part of the curve going into the location with large Chapter 3. NURBS Toolpath Generation 39 curvature changes where a lot of the data points gather can be seen to have a much better matching with the chord line. In Figure 3.15, the curvature and the third derivative graphs are shown. The curvature K of a general parametric curve is calculated from the following equation: (3.68) With just the regular least squares fit, , there are sharp curvature peaks seen throughout the entire curve, showing large variations even in regions where the curvature is not very high. When was set to and , the overall variations in curvature decreased and the two peaks with maximum curvatures are also showing lower curvature values. It can be seen that when visually the curve looks a lot smoother and a lot of the curvature variations are reduced, however it does seem that the two curvature peaks have increased in magnitude. While the jerk minimization objective function does not directly target the minimization of curvature, it is really showing an effect in decreasing the influencing of just minimizing at the data points. Focusing on just data point minimization with least squares will ultimately force the curve to artificially pass through the data points, and induce high oscillations to the curve fit geometrically. Chapter 3. NURBS Toolpath Generation 40 Figure 3.13: Chord Error Objective Comparison a). Regular Least Squares, b-d). Optimized Chord Error Minimization Mean Error: 1.107 [mm] Quad Chord Error: 2.125 [mm] Spline Length: a). Mean Error: 1.234 [mm] Quad Chord Error: 1.819 [mm] Spline Length: b). Mean Error: 1.161 [mm] Quad Chord Error: 0.697 [mm] Spline Length: d). Mean Error: 1.222 [mm] Quad Chord Error: 1.127 [mm] Spline Length: c). Optimized Fit Regular Least Squares Fit Data Points a). b). c). d). Chapter 3. NURBS Toolpath Generation 41 Figure 3.14: Jerk Objective Comparison a). Regular Least Squares, b-d). Optimized Jerk Minimization Mean Error: 1.664 [mm] Quad Chord Error: 2.012 [mm] Spline Length: c). Mean Error: 3.458 [mm] Quad Chord Error: 2.55 [mm] Spline Length: d). Optimized Fit Regular Least Squares Fit Data Points Mean Error: 1.107 [mm] Quad Chord Error: 2.125 [mm] Spline Length: a). Mean Error: 1.546 [mm] Quad Chord Error: 2.479 [mm] Spline Length: b). a). b). c). d). Chapter 3. NURBS Toolpath Generation 42 Figure 3.15: Jerk Minimized NURBS Fit a). Curvature, b-c). 3rd derivative in X and Y From the multi-objective simulations of the X-Y toolpath, it was shown that while the regular least squares fit provides good fitting results at the data points, showing the lowest mean point error; focusing at just the data points has an adverse effect of increasing the geometrical fluctuation of the NURBS curve. By adding the effects of chord error minimization and jerk minimization, the focus at just the data points is reduced, and a higher emphasis is placed on the curve as a whole; at the data points and in between the data points. From the figures shown, using a value of and an value of seems to provide decent results and are not in any way too aggressive for the fitting process. The following simulations are done b). a). c). Chapter 3. NURBS Toolpath Generation 43 with three dimensional surfaces to verify the double spline fitting scheme. The following coefficients: , are used for the multi-objective fits. Figure 3.16: Parametric Ruled Surface Toolpath This first test five-axis toolpath was taken and modified from Lo [39]. It is from a simple parametric revoluted surface shown in Figure 3.16 where a single strip was taken at as the toolpath. (3.69) The orientation vector was taken as the normal of the surface: (3.70) 300 discrete CC toolpath data points were taken with natural spacing in the u direction, and the corresponding 300 discrete orientation data vectors were taken as the normal to the surface. These data points are shown in Figure 3.17. The double NURBS representation was used to represent the toolpath and the orientation. The following tolerances were used to terminate the fitting algorithm: at the data points; integration of all the chord error ; the maximum orientation at the data points. Chapter 3. NURBS Toolpath Generation 44 Figure 3.17: Five-Axis Toolpath 1 Data Initially 16 control points were used to fit Toolpath 1 which resulted in a maximum of 0.358 [mm] of error at the data points, and 0.110 [mm] of quadrature chord error summed through the entire path on the lower spline. After 17 iterations, the prescribed tolerances are met and the resulting curve fit ended up with 33 control points as shown in Figure 3.18. From the fit, the interpolated toolpath position and orientation with respect to the curve parameter is shown in Figure 3.19. The errors between the fitted toolpath and the original data were evaluated at each of the data point and shown in Figure 3.20. The mean error was found to be 0.00448 [mm] for the data points with a maximum error of 0.0129 [mm], and 0.00450 [mm] of quadrature chord error was summed through the entire path. A maximum of 0.9001 [mrad] was found for the orientation error. Chapter 3. NURBS Toolpath Generation 45 Figure 3.18: Toolpath 1 Fit Figure 3.19: Toolpath 1 Fit Interpolated Position and Orientation a). Position and b). Orientation a). Toolpath Position [mm] b). Toolpath Orientation [rad] Chapter 3. NURBS Toolpath Generation 46 Figure 3.20: Toolpath 1 Fitting Errors a). Position Local Chord Error, b). Position Point Error, c). Orientation Point Error The reason for the variations seen in the quadrature chord error and the point error graph is due to the influence of the control points locally. It is impossible for a curve with only 33 control points to interpolate for 300 CC data points perfectly, therefore a tolerance scheme was set up to establish a band to keep all the data points relatively close to the curve. It is also notable that at locations with more control points, the general mean point error and chord error is lower and that these two graphs are very similar. For the orientation toolpath orientation, a). Tool Tip Chord Error [μm] b). Tool Tip Point Error [μm] c). Tool Point Orientation Error [rad] Chapter 3. NURBS Toolpath Generation 47 there are notably two local peaks at around , where the orientation in z changes direction. Large orientation error peaks occurring at these locations are expected. Figure 3.21: Five-Axis Toolpath 2 Data The next test five-axis toolpath, as shown in Figure 3.21, is a closed square with rounded corners and a consistent change in orientation. 613 discrete CC toolpath data points were taken along with the corresponding 613 orientation vectors. The toolpath starts at the bottom center of the square and ends at the same location. A notable feature of the toolpath data is that the distributation of data points are the same for the bottom and the top and the same for the right and left sides, with a higher data point density for the right and left sides. By taking 5% of the number of data points as the number of initial control points, the fitting process started with 31 control points. The first 3 control points and the last control points were fixed. The same tolerances and the same multi-objective coefficients are kept the same as the previous test toolpath. From the result of the lower spline fit as shown in Figure 3.22, the distribution of the control points is consistent with the distribution of the data points, with more control points on the left and right sides. In general, the control points are distributed very well with respect to the length of the curve. The right side of Figure 3.22 is the zoomed in view showing how the local influence of the control points result in a wavy toolpath, which is why a lower number of Chapter 3. NURBS Toolpath Generation 48 control point is desired in the global fit. This wavy toolpath is one of the disadvantage of the global fit, as a piecewise fit will easily allow the straight sections to remain straight. However, in general, the piecewise fit will result in a lot more control points throughout the path. Figure 3.22: Toolpath 2 Lower Spline Fit Figure 3.23: Toolpath 2 Fit Interpolated Position and Orientation a). Position and b). Orientation a). Toolpath Position [mm] b). Toolpath Orientation [rad] Chapter 3. NURBS Toolpath Generation 49 Figure 3.24: Toolpath 2 Fitting Errors Figure 3.23 shows the interpolated position and orientation graphs from the toolpath fit. In terms of the fitting errors, there was an initial maximum point error of , a mean point error of and a sum chord error integration of with 31 control points. The tolerances were met with 43 control points and the final maximum point error was as shown in Figure 3.24b)., with the mean point error of and for the chord error integration. The maximum orientation error was near the beginning of the curve as shown in Figure 3.24c). As this toolpath is very consistent, the mean point error and chord error integration are very well matched. The fluctuations within the point error and chord error graphs (Figure 3.24a,b).) are due to the a). Tool Tip Chord Error [μm] b). Tool Tip Point Error [μm] c). Tool Point Orientation Error [rad] Chapter 3. NURBS Toolpath Generation 50 shaping of the control points locally; this can be clearly illustrated from the zoomed portion of right side of the tool path as shown in Figure 3.22. The larger chord error at the center of the curve is due to having less control points. The larger chord and orientation error at the beginning can be attributed to the continuity conditions set at the beginning by the initial control points, otherwise, throughout the curve, orientation error is maintained to be consistently low, since the orientation reference is quite consistent. Although it does seem that there is a slightly higher orientation error closer to the curve corners, this is expected. From the simulation results, it was shown that by including the effects of chord error minimization, and jerk minimization, the overall fitting of the curve is smoother geometrically than just the least squares fitting algorithm where point error is the only minimization objective. It is concluded that by using a higher coefficient for the chord error objective than the point error objective, the overall curve can be minimized based on local chords, . However, the influence of the point error objective cannot be removed completely, as the error at the data points are still very important. It has been shown that when the chord error is minimized, a better parameterization can be found, allowing both the chord error and mean point error to reduce simultaneously. By using the following multi-objective coefficients of , the fitting algorithm is refrained from being too aggressive and can provide results that can achieve tight tolerances. These coefficient values may be dependent on the number of data points used in the fit as that would generally affect the range of curve parameter for the data points. These coefficient values were used for two test five-axis toolpaths using the double spline representation. Both the orientation and tool tip position can be simultaneously represented with a single curve parameter value. 3.5 Adaptive Quadrature Length During the machining operation, the machine tool has to travel along the defined NURBS toolpath with the feedrate specified by the feed scheduler. The feed scheduler has to ensure that the tool travels smoothly within the toolpath, and decelerates to a full stop once the toolpath is complete. Any inaccuracy with the length estimate can result in overshooting or undershooting along the path, causing undesired discontinuities and jerk within the system. Therefore, it is extremely important to find the true path length along the generated NURBS toolpath. While the NURBS curve possesses many advantages in its curve shaping properties, the path length cannot be solved analytically using the NURBS curve’s parameters; numerical Chapter 3. NURBS Toolpath Generation 51 methods have to be used. In general, the displacement function S(u) of a parametric curve C(u) is the summation of the infinitesimally small segments along the curve, where the length of each segment is based on the Pythagorean Theorem. (3.71) The Simpson’s 3/8 Rule can be applied to this to obtain an approximation of the arc length within the region using a tolerance value denoted as as mentioned in previous sections. This value is especially important in bounding the functional variation of the integration function. (3.72) To apply this to the NURBS curve, the internal knot spans are used as the intervals. The intervals are solved from the left to right, whenever the tolerance given in Eq. (3.59) is not satisfied for any interval, the interval is sub-divided further, e.g. and . By accounting for all the knot spans as intervals, this ensures that all the important features on the NURBS curve are considered. Since the knot spans determine which control points are contributing locally, if the integration intervals do not take the knots into account, the influence of some control points may be missed, due to the nature that numerical integrations only evaluate the intervals at specific locations. Extreme knot conditions where several knots are close together can be quite problematic if the knots are not considered. This can be demonstrated in the following example as shown in Figure 3.25: Degree: 3 Control Points: P0(0,0), P1(10,0), P2(20,0), P3(50,0), P4(0,10), P5(0,30), P6(20,50),P7(40,50), P8(50,0), P9(50,30), P10(50,40), P11(50,50) Weights: [1 1 1 5 1 1 1 1 5 1 1 1] Repetitive p+1 Knots Repetitive p+1 Knots Chapter 3. NURBS Toolpath Generation 52 Knot Vector U: [0 0 0 0 0.40001 0.40002 0.40003 0.40004 0.40005 0.40006 0.40007 0.40008 1 1 1 1]; Figure 3.25: A Cubic NURBS Curve with Extreme Knot Conditions Using the adaptive quadrature method that considers the knot intervals, the path displacements across the knot spans are shown: S = [0 49.9996 51.9604 75.9953 111.6196 135.5532 171.1776 195.2125 197.1735 247.1732] is the true path length that was calculated with a tolerance of . The following Table 3.1 shows the path length found with and without knot interval considerations with given tolerance: Tolerance With Knot Consideration Without Knot Consideration Path Length S [mm] Path Length S[mm] 1 247.0847 99.8895 1e-1 247.0829 100.0399 1e-2 247.1751 247.1741 Chapter 3. NURBS Toolpath Generation 53 Tolerance With Knot Consideration Without Knot Consideration 1e-3 247.1739 247.1732 1e-4 247.1733 247.1732 1e-5 247.1732 247.1732 Table 3.1: Path Length with Varying Adaptive Quadrature Tolerance When the tolerance is large, the path length cannot be adequately calculated without knot considerations and a length of roughly is found. This is the sum of the lines at the beginning and end of the NURBS curve, the middle fan portion of the path is completely left out of consideration. The characteristic of the knot vector shows that it is a degree 3 curve, with 4 repeated knots at the front and end with all the internal knots being extremely close together. Due to the property that a control point is only active within the knot range of , only the first 4 control points are relevant in the large range of , while only the last 4 control points are relevant in the large range of , leaving the middle 4 control points only relevant within the confined range of . Figure 3.26 shows the basis functions for this NURBS curve. Figure 3.26: Basis Functions with Extreme Knot Conditions Chapter 3. NURBS Toolpath Generation 54 From Table 3.1, it can be seen that it is possible to calculate the true length even without knot interval considerations by having tighter tolerances. However tolerances cannot be increased indefinitely due to computational constraints. At first glance of the table, it may seem that the lengths found without knot interval consideration converges earlier with lower tolerance than considering the knots, however, this is not true. For instance when , in the case of knot consideration, this tolerance s applied to every knot interval and so on. In comparison to the case of without knot considerations, the tolerance of is applied to , where the tolerance is not met and the interval subdivides into , , , and so on, until . When the division finally reaches , the division has already been subdivided 16 times, which means a times tighter tolerance than the base tolerance. In other words, given the same base tolerance, the tolerance is actually a lot tighter when not considering knot intervals, which in turn means longer computation time. In addition to just computing the total path length of the NURBS Curve using this method, the intermediate subdivisions are also recorded as data of along the path. Figure 3.27 shows the path length of the NURBS curve in terms of the curve parameter u. There is a large jump in path length at due to the extreme knot conditions where all the control points pertaining to the fan are located. The data of will be used later for the Correctional Polynomial interpolation method. Chapter 3. NURBS Toolpath Generation 55 Figure 3.27: Path Displacement vs. Curve Parameter with Extreme Knot Conditions 3.6 Conclusion A smooth and continuous toolpath is essential for producing high quality parts for High Speed Machining. In this chapter, the non-uniform rational B-spline (NURBS) curve was implemented to provide a toolpath fit on a set of discrete toolpath data that is exported from CAD systems. The advantages of the NURBS curve over traditional linear and circular segmentation methods were discussed, and some common techniques for shaping the NURBS curve were presented. The general scheme of using the least squares fit to globally approximate the curve to a set of discrete toolpath data was borrowed from Piegl [47] and was presented. To overcome the irregularities and fluctuations of fitting the curve only to the data points, the chord integration error was introduced to quantify the chord error in between the data points. An objective based on local chord was presented and integrated along with the objective to minimize the overall jerk of the curve fit that was introduced by Sencer [50]. Since the distribution of the B-spline basis functions is known entirely with a given knot vector, using a numerical integration technique to efficiently compute for the overall influence of each of the control points with Chapter 3. NURBS Toolpath Generation 56 respect to the local chord region allows the set up of a multi-objective fitting function that takes full advantage of the known basis function. The effects of the multi-objective function were shown through simulations and were implemented on test five-axis toolpaths. The double spline scheme introduced by Langeron et al. [31] was implemented to simultaneously represent both the tool tip position as well as the tool orientation. The multi-objective fitting algorithm was integrated with this toolpath representation scheme and the simulation results for five-axis toolpaths were presented. The adaptive quadrature length method presented by Lei et al. [32] is integrated in this chapter to find the true length of the NURBS toolpath. Using this method of finding the displacement along the toolpath, provides a set of curve parameter and displacement data points which are essential for the interpolation of the toolpath in real time. Chapter 4. Real Time Interpolation and Feedrate Profiling 57 Chapter 4 Real Time Interpolation and Feedrate Profiling 4.1 Introduction From a set of discrete data point of a CAD model, Chapter 3 demonstrated that a smooth NURBS curve can be fitted and used to accurately represent the toolpath. This chapter presents the process and constraints involved in scheduling a feedrate profile for a five-axis CNC system and the methods available to interpolate the fitted toolpath in real time. In real time interpolation, feed fluctuation is a problem that arises from incorrectly interpolating the curve parameter to match the desired travel displacement for the time step. The “Feed Correction Polynomial method” was developed by Erkorkmaz and Altintas [19] and was implemented on B-spline toolpaths for feed consistent interpolation. Similar concepts were developed by Lei [32], where he applied the adaptive quadrature length method to find the true length of the toolpath and fitted the data with a cubic hermite spline to acquire an inverse length function. These concepts were extended further by Heng and Erkorkmaz [22] to connect multiple segments of the polynomial together in order to express the large changes in curve parameter within small arc displacement changes without the need to increase the order of the polynomial. The “Feed Correction Polynomial method” is implemented and is compared to the widely used “Taylor Series Expansion” interpolation method. A continuous feedrate modulation strategy is applied to the 5-axis CNC machine. The 5- axis machine kinematics is presented and considerations to the axis drive’s kinematic limits such as velocity, acceleration, and jerk, as well as geometrical constraints for the toolpath such as chord error and curvature are included to schedule a smooth feedrate profile. 4.2 Interpolation In real time interpolation, the toolpath is converted into a machine trajectory. For an arc-length parameterized toolpath such as the linear segments used in linear interpolation , where is the arc-length displacement, is the length of the line, and are the starting and ending position respectively, the position given by the linear toolpath is the following: (4.1) Chapter 4. Real Time Interpolation and Feedrate Profiling 58 Let the sampling interval of the CNC control loop be denoted as , then time can be expressed as where is an integer value representing the time step. In trajectory generation, a reference command of is generated at every time step: (4.2) where is the desired arc length increment at the step. For arc-length parameterized toolpaths such as the linear and circular toolpaths, the machine axis increment at every time step can be easily calculated. Toolpaths that are not parameterized by arc-length but rather, parametrically, such as the NURBS curve , requires an additional conversion where the curve parameter needs to be mapped from arc-length displacement to get . The challenge is in the mapping between and to satisfy the desired arc length increment at every time step. This is the process of interpolation as shown in Figure 4.1, where the next curve parameter value of is computed to satisfy . A straight forward approach in computing the curve parameter , where is defined within the knot vector interval of , is the natural interpolation. This is the method of linearly incrementing the curve parameter in proportion to the ratio of arc length increment to the total arc length (4.3) The linear relationship used in natural interpolation is mostly only valid where the spline is arc-length parameterized, and in general, this is not valid for the entire spline toolpath. Using an improperly calculated curve parameter, can cause undesirable feed fluctuations, resulting in higher accelerations and jerk components on the axis drives. While the high frequency components may not be tracked by the limited performance of the CNC control, it can lead to the excitation of the CNC machine tool’s natural modes for the structure or the drives. In addition, having aggressive accelerations for the motor drives can result in motor drive saturations, further increasing the vibrations at the machine tool. All these effects are huge detriments for the proper tracking of the reference path, and will manifest as rough surface finishes, vibration marks, poor geometrical tolerances and reduced overall machine life. Chapter 4. Real Time Interpolation and Feedrate Profiling 59 Figure 4.1: Interpolation 4.2.1 Taylor Expansion The method of Taylor series interpolation was first introduced by Shipitalni, et al. [55] to estimate the next curve parameter at every time step interval with the current curve parameter. It is based on the assumption that when the arc-length increment is small, and that the curve is parametrically smooth, i.e. the first derivative of the curve is defined and continuous, the tangent direction of the curve is sufficient to compute for the incremental value in curve parameter. The toolpath is defined along the lower tool tip spline as and the feedrate profile is denoted as . Since feedrate is defined as the rate of change in tool tip displacement with respect to time, it can be expanded as the following: (4.4) The change in displacement for a parametric curve is the following: (4.5) This gives the 1st order Taylor Expansion as: (4.6) Chapter 4. Real Time Interpolation and Feedrate Profiling 60 When the curvature of the curve is low, the first order Taylor approximation is generally adequate; however, when the curvature is large, then higher order approximation becomes necessary: (4.7) The following is the second order Taylor Expansion: (4.8) In order to apply the Taylor Expansion for real time interpolation, the derivatives of the NURBS curve have to be evaluated at at every time step of the interpolation. Due to the recursive nature of the B-spline basis function, especially in the evaluation of derivatives, the computational load becomes more significant when the degree of the curve, the number of control points and the number of axis are increased. Both the 1st and 2nd order Taylor Expansion methods are widely used. However, this method is not reliable when the feedrate is varying or if there are sharp curvature changes along the toolpath. When the feedrate is varying, such as in a typical kinematic profile consisting of sections of speeding up, maintaining constant feed and then slowing down at the end of the path, the total number of time step is already determined. However, as there is a slight discrepancy between the actual displacement and the desired displacement at every interpolation step, this discrepancy is being accumulated. Towards the end of the curve, when the total number of time steps has been reached, the curve parameter may exceed or fall short of the available knot vector range. In addition, when there are sharp curvature changes along the toolpath, by only computing for the derivatives at the current location, the sharp change that occurs just slightly behind the current location may not be captured by the approximation. Lei et al. [33] presented an improved Taylor expansion method that is more robust against extreme knot distributions where large changes on the curve can occur across very short intervals of the curve parameter. In situations where the knots are close together, important features from local control points can be missed entirely if the computed from Chapter 4. Real Time Interpolation and Feedrate Profiling 61 Taylor expansion passes through the knots and into different knot spans. In order to avoid this, it is necessary to check at the computation cycle whether the new curve parameter value of is still within the same knot interval as . By having the displacement for all the knot spans pre-calculated using the adaptive quadrature length in pre-processing, whenever a knot span is passed through, the remaining path length, , from the previous knot span has to be accurately calculated and subtracted from the total desired displacement of the current step to get a residual desired displacement, If the residual desired displacement is within the path length of the next knot span, , then the new curve parameter, , will be calculated within this knot. If the residual desired displacement is greater than the path length of the next knot span, then the knot span after that is taken, once again updating the residual desired displacement . This knot span search continues until the available path length from a knot span can accommodate the remaining residual desired displacement. While doing a knot for knot check as described will increase the robustness of the Taylor Expansion, it will further increase the computational cost of the method, making it more difficult for real time implementations. 4.2.2 Feed Correction Polynomial From the NURBS toolpath formulation, it is generally not possible for arc-length parameterization. In order to face the challenge of unwanted feedrate fluctuations that is inherent to non-arc-length parameterized parametric curves, the feed correction polynomial interpolation method was introduced by Erkorkmaz and Altintas [19]. Following this work, Heng and Erkorkmaz [22], adopted the adaptive quadrature length method and the multiple inverse length function method as proposed by Lei et al. [33], and convincingly capture the mapping between arc length displacement and curve parameter. The scalar valued function is established as a 7th order polynomial to map the desired arc length displacement, to the curve parameter, . In chapter 3, the adaptive quadrature method was used to find the approximate path length along the toolpath. The method resulted in a set of data, as well as the final path length. The 7 th order polynomial is fitted to approximate the data such that the boundary conditions on point position, and the first and second derivatives at the start and end points can be imposed, which would require at least 5th order. The original reasoning introduced by Erkorkmaz and Altintas [19] for using 7th order is to avoid numerical problems while characterizing the nonlinear Chapter 4. Real Time Interpolation and Feedrate Profiling 62 relationship of the data, however, for each spline toolpath segment, only a single 7 th order polynomial was fitted using least squares. The reasoning used by Heng and Erkorkmaz [22] to have the additional two degrees of freedom to better approximate the data, however, as multiple polynomials are used when a single polynomial fails to capture the data, the additional freedom is not totally necessary. The conditions used in determining whether the polynomial is properly capturing the curve parameter and arc-length relationship are that the polynomial must be monotonically increasing (curve parameter can only increase) and that the mean square error between the data points and the fit must stay below a specified tolerance value. Whenever these conditions fail, the data points are split into two halves to be individually fitted. The splitting continues until all the polynomials meet the two conditions. This adaptive splitting method is preferred over increasing the order of the polynomial. Each curve is fitted using the least squares method to the set of data that was computed using the adaptive quadrature length method. To avoid any ill- conditioning, the parameter range is normalized by total arc length in the given data. (4.9) The feed polynomial and its derivatives in terms of the normalized arc-length parameter and the normalized coefficients are the following: (4.10) where is the curve parameter prediction calculated using feed correction polynomial. A least squares fit is obtained over the normalized arc length displacement and curve parameter values: Chapter 4. Real Time Interpolation and Feedrate Profiling 63 (4.11) and the objective function to minimize is the following: (4.12) where . The first and second derivatives constraints are imposed to the beginning and end of the polynomial and are calculated as the following: (4.13) Then denoting the starting point as , the ending point as , the first and second derivative boundary conditions for each polynomial are , and , , the constraints matrix is written as the following: (4.14) Chapter 4. Real Time Interpolation and Feedrate Profiling 64 The Lagrange multiplier method is applied as was described in the optimization problem described in Chapter 3 to solve the following minimization problem: (4.15) The feed correction polynomial coefficients can then be computed by solving the following system of linear equations: (4.16) Initially, the whole set of data points that were computed using the adaptive quadrature length method are used for the first fit. The mean squared error check is done with the following: (4.17) The other condition is to ensure that the correction polynomial is monotonically increasing. The roots of the 1st derivative are found: (4.18) The real parts of the roots are checked to ensure that there are no local maxima within . If either the root condition or the MSE conditions fail, the set of data points are split into two. Then, the polynomial is once again fitted to the first half of the data, and it will continue to split until the conditions are met, in which case the next segment of data points is fitted. The number of data points being fitted is decreased with every sub-division. The process is terminated when all segments of data points are fitted. In the case where the number of data points has reduced to less than the order of the polynomial, it means that the tolerance, , used in finding the path length was not tight enough and that not enough data points were generated or that the MSE tolerance, , is too tight. Chapter 4. Real Time Interpolation and Feedrate Profiling 65 Figure 4.2: Feed Correction Polynomial Fit Flowchart The feed correctional polynomial fitting process is outlined in Figure 4.2. The outputs are the polynomial coefficients for all the polynomial segments. Suppose there are polynomial segments, this implies that there are sets of polynomial coefficients: (4.19) The endpoints of every feed correctional polynomial segments are also known and denoted as . During real time interpolation, the feed scheduler provides the desired change in the tool tip tangential displacement, at the given time step, . The displacement position of the next step is then: (4.20) The corresponding feed correction polynomial segment has to be used in order to compute for the curve parameter estimate of the next step, . The matching polynomial segment is Input - Lower Spline Control Points: P Knot Vector: U Divide Current Segment Adaptive Quadrature Length Approximation Check: 1. 2. 1 st derivative Root Condition Normalize Arc-Length Data Next Segment No Outputs: Feed Correction Polynomial Coefficients for all segments Correction Polynomial Fit Yes All Segments Done? Total Segment + 1 Yes No Chapter 4. Real Time Interpolation and Feedrate Profiling 66 the maximum segment such that . The next curve parameter estimate is then found as: (4.21) With the next curve parameter estimate of , the equations for the lower and upper splines can be used to retrieve the tool tip position as well as the tool orientation vector. The feed correction polynomial coefficients can be solved in pre-processing on the CNC machine. For real time implementation, the polynomial coefficients and the segment displacement position end points can all be stored within look-up tables and can be easily selected with a comparison operator. This allows the feed correction polynomial interpolation method to be extremely fast for real time computations unlike the Taylor Expansion method where the derivatives of the curve have to be computed in real time. It can also be shown that by minimizing the error for curve parameter estimation, feed fluctuations are also reduced. Given a desired feedrate, , and considering that the position from the NURBS tool path is in parametric form, where the actual curve parameter is approximated by using the correction polynomial . The tool path position and its derivative with respect to time can then be parameterized as and . By substituting this into the expression for actual feedrate: (4.22) Since , it can be seen that if the polynomial can closely approximate to within a mean square tolerance, will approach unity and the fluctuation between the actual feedrate and will be minimized. Chapter 4. Real Time Interpolation and Feedrate Profiling 67 It will be shown within the simulation/experimental section that using tighter tolerances of will reduce the overall feed fluctuation. The downside of using a tighter tolerance is that there will be more segments of the feed correction polynomial, which requires a higher computation time to obtain in pre-processing as well as take up addition CNC memory during run time. In addition, the transitions between connecting polynomials can also induce some transient feedrate fluctuations. 4.3 Inverse Kinematics The feed motion of the CNC machine is defined as the tangent displacement motion of the tool tip contact with respect to the work piece. This trajectory motion throughout the machining operation is described by the toolpath, providing information for both the tool tip contact position as well as the tool orientation. However, for typical servo control systems such as the CNC machine, the reference commands for the position control loop are the individual position of the axis motor drives. Therefore a structural dependent inverse kinematics transformation must be applied to the tool tip position and tool orientation to generate the drive commands for the Cartesian and rotary axis drives. The challenge associated with such a mapping is that five-axis machine tools generally exhibit non-Cartesian and nonlinear kinematics and that the same mapping must also be used in maintaining the physical limits of the drives. Figure 4.3: 5-Axis Machine Tool Typical five-axis machines can be classified as three basic types: (1). Table-tilting, with two rotations on the table, (2). Spindle-tilting, with two rotations on the spindle, and (3) Hybrid, with one rotation on the table and one rotation on the spindle. The table-tilting configuration shown in Figure 4.3 is the most economical type with a major advantage of having fewer loads being imposed on the spindle, i.e. less tool vibrations. The disadvantage is that a large torque is Chapter 4. Real Time Interpolation and Feedrate Profiling 68 required to rotate/tilt the table if there is a large and heavy workpiece. This imposes major limitations on the rotary drives and heavily constrains the tangential feed, whereas the spindle– rotating type does not suffer from this issue. Figure 4.4: 5-Axis Machine Tool Reference Frames The five-axis table tilting configuration kinematics is used and Figure 4.4 illustrates the coordinate systems for the table-tilting 5-axis machine tool. The kinematic algorithms of this configuration are borrowed from Sencer [54]. The transformations between the coordinate frames are expressed using homogeneous transformation matrices expressed as: (4.23) Chapter 4. Real Time Interpolation and Feedrate Profiling 69 where the system in the frame is expressed in the frame. i.e. the coordinate of a point in the frame, denoted as , can be expressed in the frame as the following: (4.24) is the relative distance from the origin to the origin measured in the frame. is the orientation of the frame with respect to the frame where: (4.25) The homogeneous transformation matrix can also be expressed as: (4.26) The following is a list of the coordinate frames: : Base : Workpiece : Tool and : Primary rotary drive A and secondary rotary drive C , , and : Cartesian X,Y,Z drives and : Miscellaneous Offsets/Tilts to workpiece and tool The purpose of the frames and is to allow the offsets and tilts for the miscellaneous fixtures between the table and the workpiece and between the table and the tool to be assigned. Forward kinematics described the motion and orientation of a frame as a function of the motor joint positions, . The workpiece system can be expressed in the base frame with the following series of homogeneous transformations: Chapter 4. Real Time Interpolation and Feedrate Profiling 70 (4.27) Similarly, the cutting tool system can be expressed in the base frame: (4.28) where is the homogeneous basic rotation matrix about the axis by angle . The 3 dimensional basic rotation matrix will be denoted as . The tool tip position and tool orientation are denoted as and in the tool frame and can be expressed in the workpiece frame as and : (4.29) The orientation of the cutting tool within the tool frame is aligned with the z axis: (4.30) Taking only the rotation components in calculating the tool orientation in the workpiece frame, (4.31) Assuming that the frames and are aligned with the previous frames, , this simplifies to: Chapter 4. Real Time Interpolation and Feedrate Profiling 71 (4.32) The orientation toolpath given by the difference between the upper and lower spline is expressed as the tool orientation with respect to the workpiece, which is . The inverse kinematics solution for the rotary axes is then solved as: (4.33) where returns an angle in the range of . The tool tip position in the tool frame is represented by (usually at the origin): (4.34) and this is transformed into the workpiece frame by: (4.35) where can be rewritten as the following to factor out the Cartesian motor joint positions: (4.36) Chapter 4. Real Time Interpolation and Feedrate Profiling 72 (4.37) The tool tip contact position with respect to the workpiece is given by the lower spline and assuming that , this can be simplified into: (4.38) This gives the inverse kinematic solution for the Cartesian drives, as: (4.39) This solution can be simplified with the following expansion: Chapter 4. Real Time Interpolation and Feedrate Profiling 73 (4.40) where (4.41) substituting these expressions back into Eqn. (4.39) and simplifying the constant translation from the table to tool frame: (4.42) It can be seen that the orientation of the cutting tool is only a function of the rotary axis drives, A and C, whereas the tool tip position is dependent on all five of the drives. Given the tool motion data as the tool tip position and tool orientation, from the tool path, , the inverse kinematic solution of Eqn. (4.33) is first used to solve for the joint commands of the rotary drives, and then Eqn. (4.42) is used to solve for the Cartesian axis drive commands, . 4.4 5-Axis Constraints Formulations In 5-axis machining operations, all five drives are simultaneously driven to produce the tangential feeding motion and the proper orientation of the cutting tool. As mentioned in the previous section, for the rotary table 5-Axis CNC configuration, the tool orientation is only dependent on the rotary drives and that the tool tip position is dependent on all five of the drives. Since each drive has its own respective velocity, and torque limits, the resultant feed of the motion is limited by the drive whose limit cannot handle the control effort as demanded by the CNC motion controller. When a drive motor saturates, the nonlinear effect of the saturation can induce undesired vibrations to the CNC system. In addition, the tracking performance for Chapter 4. Real Time Interpolation and Feedrate Profiling 74 the saturated axis will deteriorate whereas the other axes are still performing optimally. This will increase the overall contour error and reduce the quality of the part. Therefore an overall constraint on feed has to be imposed to keep all the axis drives within their operational velocity, acceleration, and jerk limits. In addition, the geometrical machining tolerances are also considered in feed scheduling. The motor drive joint positions are obtained by applying the inverse kinematics transformation using Eq.(4.33) and Eq.(4.42). , . Therefore, in order to impose the axis velocity, acceleration, and jerk profile constraints , the dynamics from the inverse kinematics have to be included. First, the derivatives of the drive axis commands are obtained with respect to the tool tip contact displacement profile as the following: (4.43) where , , and are obtained from the parameterization between the curve parameter and the displacement profile as the following: (4.44) The derivatives of the curve parameter with respect to the displacement position are: (4.45) Chapter 4. Real Time Interpolation and Feedrate Profiling 75 To incorporate the dynamics introduced from the inverse kinematics of the toolpath to the motor joint positions, the following derivates are calculated: (4.46) The rotary A motor axis is only dependent on the z component of the orientation: (4.47) where the derivatives of motor A with respect to the z orientations are: (4.48) The rotary C motor axis is dependent on the x and y components of the orientation: (4.49) Chapter 4. Real Time Interpolation and Feedrate Profiling 76 In order to compute for the orientation component derivatives, the upper spline is subtracted from the lower spline to get the tool axis vector, and the orientation is obtained from normalizing the tool axis: (4.50) The norm of the tool axis is denoted by vector and its derivatives with respect to the spline parameter are computed and denoted as , then the resulting orientation derivatives can be calculated as follows: (4.51) The Cartesian motor axes are dependent on the rotary axes and the lower spline tool contact toolpath. From Eqn. (4.42), the simplified inverse kinematics solution is written in the following form where is the position of the lower spline toolpath and is a constant translation: (4.52) Then the derivatives of the Cartesian motor axes can be found: Chapter 4. Real Time Interpolation and Feedrate Profiling 77 (4.53) where the set of rotation matrices are dependent on both and and their derivatives are shown as: (4.54) The expression for the motor positions in terms of the displacement position, , can be derived by applying the inverse kinematics to the toolpath and then approximating the curve parameter parameterization using the feed correction polynomial as Furthermore, using the sets of derivatives shown above, the first, second, and third motor position derivatives, , ,and can be found. There is now a complete mapping between the upper and lower spline toolpaths, which provide the simultaneous tool position and orientation information, to the motor joint commands of the Cartesian and rotary drives in terms of the toolpath arc-length displacement. Now a relationship can be formed to impose a limit on the feedrate as scheduled by the feed scheduler to ensure that none of the motors Chapter 4. Real Time Interpolation and Feedrate Profiling 78 violate their kinematic constraints. The five axis drive constraints algorithms are taken from Sencer [51]. The set of nonlinear constraints will be formed based on the arc-length parameterized motor axis commands, as various portions of the toolpath are more demanding for some motors, while other portions may be more lenient. Given the velocity saturation limits of the motors to be , travelling along a 5-axis toolpath from , the following constraints equations have to be met: (4.55) Using the normalized partial derivatives of the motor axis commands, the maximum allowable feed is where the maximum partial derivative is equated to the limit, such that none of the drive actually violates the velocity limit condition: (4.56) or expressed as a single velocity inequality as: (4.57) Similar to the velocity constraints, the second path displacement derivatives of the motor positions have to lie within the maximum allowable range of the motor acceleration limits: (4.58) By normalizing the motor axis command derivatives with the maximum acceleration limits, denoted by , : Chapter 4. Real Time Interpolation and Feedrate Profiling 79 (4.59) The following acceleration inequality is formed: There is an inverse relationship between the allowable feed and the allowable acceleration. The characteristics of a typical profile, allows for different operating regimes where either feed or acceleration can be more dominant, such as when the motors are starting from low speeds, a high tangential acceleration can be used to quickly reach the desired feed. As a constant high feed is maintained, the required tangential acceleration is zero. It is possible to optimally determine the combination of feed and acceleration values from the five motors, however, it is more computationally efficient to bound the feasible regions where the maximum feed and accelerations can be found by setting the other to zero: (4.60) Then the feasible acceleration inequality constraint becomes: (4.61) The following set of motor constraints are set for jerk: (4.62) Similar to the acceleration inequality, the jerk constraint is written in the following form: (4.63) where the jerk limited maximum feed can be evalutated by setting acceleration and jerk to zero: Chapter 4. Real Time Interpolation and Feedrate Profiling 80 (4.64) Then similarily the feasible jerk region is defined using the following equality: (4.65) By imposing the axis constraints in terms of velocity, acceleration, and jerk, the kinematic limits of the motors can be kept from saturation and operate within a feasible range. In addition to the motor saturation constraints, researchers such as Xu [66] and Yeh [68] have shown that a geometrical dependence of feedrate can be applied to limit the the contour error that results on the machined part. An inherent source of error in the interpolation process of parametric curves is the error that arises from using discrete reference commands as the input to the servo controller. While the toolpath is a smooth parametric curve, the real time interpolation of the toolpath will generate discrete reference position commands with the desired displacement of the tool tip at every sampling time interval of as shown in Figure 4.5. Figure 4.5: Interpolated Discrete Reference Position Commands is the desired arc-length on the toolpath: (4.66) Feed Scheduler Interpolation NURBS Toolpath Chord error: Desired toolpath arc-length displacement: Actual interpolation displacement: Chapter 4. Real Time Interpolation and Feedrate Profiling 81 However the actual displacement between the discrete reference command is: (4.67) This discrepency leads to two problems: feedrate fluctuation and chord error. While it is not possible to eliminiate these problems completely, it is possible to reduce them by limiting the feedrate. The discrepency between the actual displacement and the desired displacement is highly prevalent at locations of the toolpath where there is a high curvature (low radius of curvature). High feed fluctuations around sharp curves can lead to various vibrations and contour tracking problems. In order to reduce this problem, Zhiming [70] applied a variable feedrate method with dependence on the toolpath curvature. The toolpath curvature is calculated as follows: (4.68) The curvature dependent feedrate is expressed in the following form such that the feedrate approaches (desired feedrate) when the curvature approaches zero. (4.69) where a specific pair of curvature and feedrate values can be used to determine . By reducing the feedrate at locations of high curvature, additional interpolation steps are required to complete the curve, but each of the smaller steps contains a much lower displacement descrepency from the desired displacement. In addition to the feed fluctuation problem, chord error, as defined by the distance from the actual interpolated chord and the toolpath parametric curve is also highly dependent on toolpath curvature. When there is a large local radius of curvature in the toolpath, i.e. the curve is relatively straight, the toolpath can be approximated by the interpolated discrete commands sent to the CNC position controller and the chord error is minimal and high feedrates can be used. For locations with a large curvature, large chord error can occur. By specifying a maximum chord error denoted as , an adaptive feedrate can be applied as follows: Chapter 4. Real Time Interpolation and Feedrate Profiling 82 (4.70) where , is the local radius of curvature and is the inverse of the curve curvature. The curve parameter value can be approximated using the fitted correction polynomial as . The set of feedrate constraints has to be considered by the CNC feed scheduler to properly schedule a feedrate profile that does not violate the velocity, acceleration and jerk limits of the drive, and considers the geometrical machining tolerance of the toolpath. 4.5 Feedrate Profiling The objective of feedrate profiling is to generate a minimum cycle time displacement profile to direct the cutting tool. It is common for the process planner to specify a desired feedrate for the CNC machine to cut the workpiece. However, the entire cutting process will not only consist of the machine tool travelling with a constant feed, as the motor axes have to be accelerated from rest at the beginning of the toolpath and decelerated at the end. In addition, the tangential feed exhibited by the cutting tool is the result of all the motor axes. Travelling at a constant high feedrate throughout the entire toolpath where the demand of each of the motor is varying according to the toolpath is not feasible, as the velocity, acceleration, and jerk constraints of the individual motors may be violated. The geometrical feedrate constraints as presented from the previous section are also important considerations. The most common type of feedrate profile is the trapezoidal velocity profile, where the motors are ramped up in velocity to meet a desired feed and are ramped back down at the end of the toolpath. The jerk limited profiling for a single curve segment was presented by Erkorkmaz and Altintas [14]. It provides a feedrate kinematics profile that bounded the tangential jerk displayed by the cutting tool, allowing for a smooth acceleration and deceleration profile. The resulting profile has significantly lower high frequency content in acceleration as opposed to a trapezoidal feedrate profile. A displacement profile was later introduced [17] using a quintic polynomial as: (4.71) Chapter 4. Real Time Interpolation and Feedrate Profiling 83 It provided a multi-segment displacement profile where the jerk content could be summed in an overall jerk objective function given as: (4.72) Then the jerk minimization problem can be used to solve for the coefficients of the polynomials. In order to optimize the total cycle time, a second cost function is formulated as the sum of the time duration of each polynomial: (4.73) The minimum time feed optimization accounts for the motor constraints by forming an overall constraint equation cascading the feasible motor velocity, acceleration, and jerk constraints given in Eqns. (4.57),(4.61), and (4.65) as: (4.74) where is the lower feed limit to ensure forward motion, and is the process planner specified upper feed limit. Sencer [51] extended this optimization by expressing the feed profile in B-spline form and optimized by maximizing the control points, , of the feed profile as shown in Figure 4.6: (4.75) Figure 4.6: B-Spline Feed Profile The feed profile is solved iteratively by using a forward windowing technique of incremental , to solve for the highest feed control points that will not violate the constraints. The feedrate optimization algorithms are particularly effective in rough milling, or semi-finishing operations, Chapter 4. Real Time Interpolation and Feedrate Profiling 84 where rapid feed alterations are not vital for part tolerances and feedrate fluctuations are more tolerable. While these optimization approaches can minimize the overall jerk content throughout the entire toolpath, as well as greatly increase productivity with minimal cycle time, the algorithms also introduce unnecessary feedrate fluctuations throughout the toolpath. In finishing operations where tangential feedrate must be scheduled smoothly with minimal fluctuations, constant feed sections have to be used where they are connected to each other using smooth acceleration transients. While using constant feedrate sections will result in a sub- optimal solution, it has a lower computational cost and is more robust to a wider variety of applications. Heng and Erkorkmaz [20], [22] have shown that a heuristic approach to applying the limited jerk feed profile can yield favorable results with short cycle time and short computation time. The limited jerk trajectory profile is computationally easy to implement compared to the optimization methods and it has a well-defined profile that can be taken advantage of. By imposing a bounded acceleration, , and a bounded maximum jerk, , on the feed motion, the acceleration and jerk constraints for the motor drives from Eqn. (4.61) and (4.65) where the set of feasible , , feed, acceleration, and jerk values had to be identified iteratively along the tool-path can be simplified as and (4.76) Since is normalized by the individual motor limits, there is an inherent assumption that is less than the individual motor drive acceleration limits, i.e. . (4.77) where the real root from the cubic equation can be taken as the maximum feedrate imposed by jerk. With the set of drive motor constraints and the set of geometrical constraints defined, the constraints equation in terms of is known for the entire tool-path: Chapter 4. Real Time Interpolation and Feedrate Profiling 85 (4.78) The effective feedrate constraint at any particular displacement value is the minimum of all the constraints. The general case of the limited jerk profile is shown in the following Figure 4.7, composing of seven phases: 3 phases for acceleration, 1 for constant feed, and 3 for deceleration. However, this profile can easily be set up with only four sections by having only acceleration, , or only deceleration, . To preserve generality, the signed value for acceleration is used where , indicates an acceleration stage, and , indicates a deceleration stage. The same applies for jerk where or , indicates acceleration and or , indicates deceleration. Figure 4.7: Limited Jerk Trajectory Profile Chapter 4. Real Time Interpolation and Feedrate Profiling 86 The feed and displacement equations for the profile are listed as the following [14]: (4.79) (4.80) By using a specified and , the following expressions can be used where the jerk values and the acceleration / deceleration values are the same: (4.81) Since feed must be attained within the first three phases, the bounded acceleration stage may not exist; in which case, a reachable acceleration is found as: (4.82) Chapter 4. Real Time Interpolation and Feedrate Profiling 87 where and are updated with the reachable acceleration. Similarly, for the deceleration stage: (4.83) The condition of total travel length must be satisfied. If there are excess travel lengths, after the lengths for acceleration and deceleration are accounted for, the constant feed stage will exist, otherwise, the reachable feed for the given length replaces the desired feed, . In order to generate a limited jerk trajectory profile, the inputs are: the length of the path, the maximum bounded jerk, the bounded acceleration, the sampling time, the initial feed, the desired running feed, the end feed, The goal is to maximize the nominal running feed, while not violating the constraints. By assigning a constant bounded acceleration, , and jerk, , for the entire path, the only adjustment parameters are the nominal feedrate, F, and the end feed, . Rather than using constant lengths as incremental steps, a number of minimum peaks are taken from the constraints curve. The starting feed, , is continued from the previous segment, and the end feed, , is set to be just below the next minimum constraint value. The outline of the process is shown in the following Figure 4.8: Chapter 4. Real Time Interpolation and Feedrate Profiling 88 Figure 4.8: Multi-Segment Limited Jerk Feed Profile Planning A major advantage of applying the multi-segmenting method to a well-defined trajectory profile is that the feasible search region is known based on the current feedrate. Initially, the feed can be set as high as possible with the ending feed meeting the first minimum constraint. The nominal feed can be lowered if the constraints are violated midway. In the case that the next constraint is lower than the current constraint, i.e. deceleration, the end feed boundary condition needs to be met with the available length between the two constraints. If this is not possible, as shown in Figure 4.8b), the previously chosen feed segment has to be backtracked. Fe ed ra te [ m m /s ec ] Displacement [mm] a). Initial Forward Planning Maximize feed b).Constraint Violation c). Backtrack Previous Feed Segment e). Forward Planning Acc + Dec f). End, Stop Feed Displacement [mm] Fe ed ra te [ m m /s ec ] Chapter 4. Real Time Interpolation and Feedrate Profiling 89 Figure 4.9: Required Length for Deceleration In the case of deceleration as shown in Figure 4.9, the nominal feed is the same as the starting feed, then the length travelled by the deceleration portion of the profile is the following: (4.84) where time period for the constant deceleration stage can be expressed as: (4.85) If , the maximum deceleration value is reduced and the new length becomes: (4.86) Given the current feedrate of, , and the change in feedrate, , required to meet the next constraint, the minimum length required to satisfy this is given as: (4.87) Denoting the available length for the current step as , as the minimum to realize the desired transition, then the amount to back track into the previously chosen feed is: Chapter 4. Real Time Interpolation and Feedrate Profiling 90 (4.88) This leaves a shorter working length for the previous segment to satisfy its own transitions. If the previous segment had been a deceleration, that had barely made its end boundary constraint, backtracking might be required again. (4.89) Note that Eqn. (4.87) can also be written for the minimum length required to accelerate to a desired feed as: (4.90) where (4.91) These two expressions can also be rewritten as (4.92) where the roots of the quadratic and cubic can be used to solve for the maximum reachable feed given the available length, , and the current feed, . For Eqn. (4.92), the positive root is taken from the quadratic equation and the real root is taken from the cubic equation. is then calculated from each feed value to determine which one is valid. This provides a limit to the search space when searching for a feed for acceleration forward planning. During acceleration planning, there is no problem if the desired end feed cannot be reached as a lower feed can guarantee that the constraints will not be violated. At the end of the profile planning process, the end constraint has to ensure that feed comes to a complete stop at the end of the toolpath, . The length of the entire toolpath had been previously found using the Quadrature length integration method. The for the deceleration, Eqn. (4.87), can be solved to check whether Chapter 4. Real Time Interpolation and Feedrate Profiling 91 it is possible to decelerate to zero end feed given the current length left till the end of the path and the current feed value; is set to and is zero. Backtracking may be required. By using a multi-segment limited jerk profile, a smooth feedrate profile can be planned without unnecessary fluctuations from an optimization algorithm. Even though the cycle time will be increased, the computational time and the part quality will be improved. 4.7 Implementation and Experimental Results The real time implementation of the NURBS interpolation algorithms was conducted on a high speed X-Y table as shown in Figure 4.10. The two axis router is driven by two linear DC motors. Position feedback is obtained from the incremental position encoders, with a resolution of . The workspace consists of of stroke in both the X and Y directions. Figure 4.10: High Speed X-Y Table The presented real time interpolation algorithms are developed using Matlab/Simulink and are implemented using the real time dSPACE hardware system. The general system block diagram used for the X-Y table implementation is shown in Figure 4.11: Figure 4.11: X-Y Table Implementation Block Diagram The displacement profile is generated from feed scheduler and is used as the input. The interpolator translates the displacement into the curve parameter using one of the presented interpolation algorithms. Then the curve parameter is passed into the NURBS toolpath block Chapter 4. Real Time Interpolation and Feedrate Profiling 92 where the NURBS equation is evaluated to extract the tool position. A Simulink S-function is used for the computation of the NURBS equation, allowing for customized C code to be written. The curve parameter value is compared to the knot vector to determine the non-zero B-spline basis functions to evaluate and avoid unnecessary computations. When there are multiple curves, the control points and the knot vectors for the particular curve are also selected. Following the NURBS toolpath evaluation, the tool position reference command is sent into the position control loop which is used to control the motors using the analog output ports of the dSPACE board. The sampling time for the interpolation and the position control loop is . The test toolpath was generated from 89 fan-shaped data points that were scaled to an overall size of as shown in Figure 4.12. A quintic NURBS toolpath was fitted with 55 control points, using the fitting algorithm outlined in Chapter 3, with the following multi-objective fitting coefficients: . The total path length was found to be . From the curvature graph shown in Figure 4.13, there are 4 sharper curves along the toolpath. Figure 4.12: Fan-Shaped NURBS Toolpath Chapter 4. Real Time Interpolation and Feedrate Profiling 93 Figure 4.13: Fan-Shaped NURBS Toolpath Curvature In order to compare the performance of the interpolation methods in terms of feedrate consistency, and fluctuations, a constant feedrate of profile is generated using limited jerk. The maximum acceleration and jerk for the toolpath were set at and . To calculate and compare the feed of the tool reference command, the derivatives are calculated numerically over two sample points. The derivative of the and positions are estimated using: (4.93) where is the sample index, denoting the time and is the total number of samples. The same numerical calculation is then used to estimate the feedrate , acceleration , and jerk of the toolpath as: (4.94) Chapter 4. Real Time Interpolation and Feedrate Profiling 94 The feedrate at the reference to the position control loop is shown in the following Figure 4.14: a) Natural Interpolation b) 1st Order Taylor Expansion c) 2nd Order Taylor Expansion d) Feed Correction Polynomial Chapter 4. Real Time Interpolation and Feedrate Profiling 95 e) Feed Correction Polynomial f) Feed Correction Polynomial Figure 4.14: Feedrate Fluctuation for Interpolation Algorithms With natural interpolation, the feedrate at the position reference can be seen to reach as high as , and as low as , showing a maximum fluctuation of about 35 and a mean fluctuation of about . Since the natural interpolation method increments the curve parameter in portion to the arc length, fluctuations occur due to the nonlinearity between the curve parameter and the curve displacement. A plot of the curve parameter and displacement relationship shown in Figure 4.15 between the multi-segment correctional polynomial with a mean square error fit of on the data from the numerical adaptive integration and a linear line shows that the difference between them is as large as . This difference shows that it has very similar shape as the feed fluctuations as seen in Figure 4.14a) above. Chapter 4. Real Time Interpolation and Feedrate Profiling 96 Figure 4.15: Nonlinear Curve Parameter and Displacement Relationship For the 1st order Taylor interpolation method in Figure 4.14b)., it shows decent feedrate integrity along the toolpath except for the four sharp locations. This is expected as the slope is very volatile at locations of high curvature and cannot be accurately used to predict the curve parameter and displacement relationship. It shows good results with only a maximum fluctuation of . The 2nd order Taylor interpolation in Figure 4.14c). shows huge improvement in terms of feed fluctuation, with a maximum fluctuation of , however, the maximum fluctuations are also occurring at the high curvature peaks. In addition, the computation time of the 2nd order Taylor method has increased over the 1st order method as a higher order computation was required. The correctional polynomial with a mean square fitting error of shown in Figure 4.14d). shows comparable feed fluctuation results as the 1st order Taylor method, with a maximum fluctuation of . However, the computation time for the feed correction polynomial methods are only about , since a series of pre-fitted polynomial coefficients are already stored in look-up tables. This short computation time is ideal for real time implementations. A summary of the feed fluctuations and computation times are listed in Table 4.1. Feed fluctuation gets better when using a tighter mean square error tolerance to fit the correction polynomials. At , in Figure 4.14e)., feed fluctuation is a lot better at a maximum of and is comparable to the 2nd order Taylor method, while have very low computation time. Chapter 4. Real Time Interpolation and Feedrate Profiling 97 Interpolation Type Feed Fluctuation (Max) Feed Fluctuation (Average) Computation Time Natural Interpolation 35 10 0.0128 1st Order Taylor 0.24 0.049 6.786 2nd Order Taylor 0.00285 0.000158 7.116 Correction Polynomial: 0.358 0.0253 0.0204 Correction Polynomial: 0.183 0.0120 0.0212 Correction Polynomial: 0.00480 0.000810 0.0202 Table 4.1: Interpolation Methods Comparison of Feed Fluctuation and Computation Time To validate the feasibility of the presented multi-segmenting method of the limited jerk feed profile, the fan-shaped toolpath is tested with respect to the kinematic constraints of the X-Y table. The velocity, acceleration, and jerk limits of the linear drives are given in the following Table 4.2: X-Y Table Limits Velocity Limits Acceleration Limits Jerk Limits X Linear Drive Y Linear Drive Table 4.2: X-Y Table Kinematic Limits The maximum feedrate limit was set at , with acceleration and jerk bounded at and . The maximum allowable chord error was set at and the feedrate is limited to half of the maximum feedrate when the curvature gets to - . The feedrate generation process took to generate the constraints curve, and the feasible multi-segment feed profile; a 2.16 GHz Pentium Dual-Core laptop computer with 3 GB of RAM was used running MATLAB. In Figure 4.16, the constraints curve is seen to be dominated by the kinematic jerk constraints of the and drives. Chapter 4. Real Time Interpolation and Feedrate Profiling 98 Figure 4.16: Feedrate Constraints Figure 4.17: Multi-Segment Limited Jerk Feed Profile A multi-segment limited jerk feed profile is scheduled as described in Section 4.5. The resulting feed profile is seen in Figure 4.17 to be quite adaptive to the shape of the fan, as there are four low feedrate segments for the sharp curves along the toolpath, followed by straighter segments, which lead to a smaller curve. At the sharp regions, the feedrate is . The total motion duration for this profile is , for a travelling displacement of Chapter 4. Real Time Interpolation and Feedrate Profiling 99 , while a constant feedrate at through the entire toolpath would require and a constant feedrate at would require . In addition, with a constant feedrate at , the kinematic jerk constraints of the linear drives will be violated at the four sharp locations. The linear drives were controlled using a loop shaping controller with a bandwidth of . The following Table 4.3 shows the experimentally identified drive dynamics of the X-Y table: Figure 4.18: Linear Rigid Body Feed Drive Dynamics Model X-Axis Y-Axis Amplifier Gain: 0.28568 0.2802 Motor Force Constant: 99.5447 135.1173 Encoder Gain: 1000 1000 Mass: 5.447 31.482 Friction: 18.0928 124.9376 Table 4.3: X-Y Table Drive Dynamics The Feed Correction Polynomial with a mean square error of was used with data that was generated with an integration tolerance of . The results can be summarized by the kinematic profiles of the resulting tool motion as shown: u Control Signal Current Amplifier i Motor Inertia and Viscous Damping Disturbance Encoder Chapter 4. Real Time Interpolation and Feedrate Profiling 100 Figure 4.19: Kinematic and Error Profiles of Fan-Shaped NURBS Contouring From the kinematic profiles in Figure 4.19, none of the axes exceeded the specified kinematic velocity, acceleration and jerk limits. The maximum recorded tracking error is for the axis and for the axis. Contour error is calculated as: Axis Tracking Error [mm] Contour Error [mm] Kinematic Profiles Chapter 4. Real Time Interpolation and Feedrate Profiling 101 (4.95) where is the angle between the tangent of the tool path command with the axis and and are the and tracking errors and a maximum of of contour error was recorded. From the results, the multi-segmenting method of feed profiling shows its feasibility in computation time and in cycle time. While the tool travelled at a high speed, the large size sample toolpath showed decent contouring capabilities and none of the kinematic limitations for the motors were violated. Figure 4.20: 5-Axis Spiral Toolpath Next, in order to validate the feasibility of using the double spline, as well as the inclusion of the five-axis kinematics of the CNC machine into feedrate scheduling, a sample 5- axis toolpath as shown in Figure 4.20 is tested through simulation. A uniform spiral toolpath is used where the tool position with respect to the workpiece and the rotary motor axes are given by the following equations: Chapter 4. Real Time Interpolation and Feedrate Profiling 102 rad rad (4.96) 100 data points are extracted from Eqn. (4.96) linearly in terms of the parameter to get the orientation and the tool position information, and 21 control points were used to fit these data points using the presented algorithms toolpath generation algorithms. The motor drive constraints used to form the feedrate constraints are listed in Table 4.5. The acceleration and jerk values for the tangential feed are bounded at and . The resulting feed profile is shown in Figure 4.21 where the maximum feed is at and the total tool motion duration is . Drives Velocity [unit/sec] Acceleration [unit/sec2] Jerk [unit/sec3] X [mm] 250 2000 30000 Y [mm] 250 2000 30000 Z [mm] 250 2000 30000 A [rad] 2.897 34.907 200 C [rad] 5.061 43.633 250 Table 4.4: 5-Axis Drive Limits Chapter 4. Real Time Interpolation and Feedrate Profiling 103 Figure 4.21: 5-Axis Sample Toolpath Feed Profile This was tested in simulation using the block diagram shown in Figure 4.22. A tolerance of was used to generate the data points from the numerical adaptive integration of the toolpath length, leading to a total tool path length of . A mean square error of was used to fit the relationship between the curve parameter and toolpath displacement relationship and it resulted in 16 segments of the Feed Correction polynomial. Figure 4.22: 5-Axis Simulation Block Diagram Chapter 4. Real Time Interpolation and Feedrate Profiling 104 Figure 4.23: 5-Axis Simulation: Motor Reference Command Generation NURBS Toolpath Inverse Kinematics from Inverse Kinematics from and AC Interpolation Chapter 4. Real Time Interpolation and Feedrate Profiling 105 Figure 4.23 shows the graphs for the motor reference generation process. From the feed scheduler, the displacement profile is interpolated at every sampling time using the correctional polynomial. The valid correction polynomial segment is selected based on the current displacement. The current displacement is then normalized based on the displacement range of the polynomial where the estimate of the curve parameter is obtained from the normalized displacement and the coefficients of the polynomial. The curve parameter estimate is then used to obtain the positions of both the upper and lower splines. The lower spline position is subtracted from the upper spline and normalized to obtain the reference orientation given by the double spline. Using the obtained orientation, the position reference of the Rotary drives AC can be obtained, then along with the tool tip reference of the lower spline, the Cartesian Motor drives XYZ references are also obtained through inverse kinematics. The following Table 4.5 shows the drive dynamics used for the simulation: X-axis Y-axis Z-axis A-axis C-axis 0.00162 0.00174 0.00296 0.00682 0.00054 0.00681 0.00863 0.01518 0.01964 0.00368 Table 4.5: 5-Axis Simulation Drive Dynamics The feed drive dynamics are simplified as shown in Figure 4.24 and are written in a matrix form: (4.97) where , , is the motor joint position, is the controller control effort, and is the disturbance. For the simulation, the disturbance used is zero. This allows the feed drive dynamics diagram to be redrawn as the following: Chapter 4. Real Time Interpolation and Feedrate Profiling 106 Figure 4.24: Equivalent Feed Drive Dynamics Model The simulation was carried out using a sampling time of , with five independent loop shaping controllers designed at a bandwidth of , for each of the position loops of the five motor axes. The resulting motor output profile graphs are shown in Figure 4.25. The velocity and acceleration of both the Cartesian motors and the Rotary motors are within their specified drive limits. However, the jerk limitation is violated at several locations. Since the inverse kinematics of the CNC structures have shown that the Cartesian drive axes are dependent on the Rotary drives AC, violations in A and C drives have also led to violations in the X drive along several locations on the path and the Z drive at the end of the path. The performance of the position controller is also an important consideration. Even if the motor reference commands are totally within the kinematic constraints, the actual motor position is a result of position tracking. In addition, the jerk components in the reference toolpath are also inducing a transient response in the motor jerk trajectory. Figure 4.26 shows the simulated motor tracking errors. It can be clearly seen that tracking error is largest when the jerk limits of the motors were violated. In the actual CNC structure, the 5 motor positions will result in the position and orientation change of the tool. To simulate this, the motor positions are translated into the tool tip position with respect to the workpiece and into the tool orientation through forward kinematics; this is shown in Figure 4.27. Figure 4.28 shows the tracking error between the output tool tip position and tool orientation against the reference tool position and orientation from the double spline interpolation. The tool tip position tracking error reached as high as where the A rotary motor was first violated at . The resulting tool tip displacement and feed profile is calculated off the numerical derivatives of the tool tip position and is shown in Figure 4.29. The largest differences between the initial desired displacement profile and the simulated displacement occur at the transitions between the u Control Signal Equivalent Inertia Equivalent Damping Disturbance Chapter 4. Real Time Interpolation and Feedrate Profiling 107 segments of constant feed where limited jerk was used to induce the change in the feed modulation. The transient responses that occur at these locations are leading to the large fluctuation in feedrate at these points. At the segments of constant feedrate, the resulting feed fluctuations is seen to be less than . Due to the cumulative contributions of tracking error, the resulting toolpath displacement is which overshot the desired tool tip displacement by . However, it should be noted that this resulting toolpath displacement also includes the transient fluctuations that occur throughout the entire toolpath, which manifests into the additional displacement exhibited by the tool. Chapter 4. Real Time Interpolation and Feedrate Profiling 108 Figure 4.25: Simulation – Motor Output Profiles Figure 4.26: Simulation – Motor Tracking Errors XYZ-Limit XYZ-Limit A-Limit C-Limit XYZ-Limit XYZ-Limit XYZ-Limit XYZ-Limit A-Limit C-Limit A-Limit C-Limit A-Limit C-Limit A-Limit C-Limit A-Limit C-Limit Chapter 4. Real Time Interpolation and Feedrate Profiling 109 Figure 4.27: Simulation – Tool Tip Position and Tool Orientation Figure 4.28: Simulation – Tool Tip Position and Tool Orientation Tracking Error Chapter 4. Real Time Interpolation and Feedrate Profiling 110 Figure 4.29: Simulation – Tool Tip Displacement and Feed Profile 4.8 Conclusion In this chapter, the real time interpolation methods of Taylor Expansion [55] and Feed Correction Polynomial [22] were presented. Feed fluctuation is a real challenge when the relationship between the curve parameter and the displacement of the NURBS toolpath cannot be accurately represented. The 1st Order Taylor expansion has been shown to provide a decent mapping for smooth toolpaths; however, inaccuracies in the mapping where the toolpath has a large curvature can lead to undesired feedrate fluctuations. While the 2nd order Taylor Expansion showed considerable improvement in terms of feed fluctuations, the disadvantage of the Taylor Expansion in accommodating for variable feedrate and the long computation time can be problematic for real time implementations. The Feed Correction Polynomial method utilizes the highly accurate data from the adaptive quadrature integration of the toolpath length, and fits the data using multiple 7th order polynomials to capture the nonlinear relationship. It was shown that using a tighter tolerance for the fit would require additional segments of the polynomial and improve the overall feed fluctuation. While the fitting process takes increasingly more time using a tight tolerance, it can be done in pre-processing; allowing for a more practical computation time for real time implementation. Chapter 4. Real Time Interpolation and Feedrate Profiling 111 For a 5-axis CNC machine, the feed motion of the cutting tool is a combination of the 5 motor axes. In order to properly schedule the feedrate, inverse kinematics has to be applied to the reference toolpath and the reference orientation to obtain the motor reference that will realize the tool motion. The kinematics algorithms for the 5-axis rotary table CNC configuration are borrowed from Sencer [54] and a series of relationships were presented to incorporate this kinematics into feed scheduling. In order to prevent any of the motors from violating their own respective velocity, acceleration, and jerk limits, the reference toolpath and the reference orientations were mapped into the motor joint positions expressed as functions of the tool displacement. This ultimately allowed a limitation to be placed on the overall feedrate. As different portions of the toolpath have varying demands on each of the motors, a modulating feedrate is effective in dictating the tool motion and decreasing the overall cycle time. By using a multi-segment bounded jerk feedrate profile inspired by Heng [20], the feedrate can remain constant depending on the local constraints and be modulated to a different feedrate to heuristically satisfy the feedrate limitations along the entire toolpath. Since the bounded jerk profile introduced by Erkorkmaz [14] is a well-defined profile, the computation is relatively simple as opposed to an objective function optimization approach. The presented interpolation algorithms were implemented and tested in real time on the high speed X-Y table with a sample NURBS toolpath that was generated from the toolpath fitting algorithm presented in Chapter 3 and a comparison between feedrate fluctuation and computation time was made. A variable feedrate profile was applied with the correction polynomial where the tool motion slowed down along the sharp regions of the toolpath, and travelled with high speed everywhere else. The kinematic profiles of the resulting motor motion were presented. To show the feasibility of the 5-axis toolpath using the double spline representation, and to incorporate the 5-axis dynamics into feed scheduling as well as motor reference generation, a simple and well-defined toolpath was used. A feedrate was scheduled based on the constraints imposed by the individual motor’s velocity, acceleration, and jerk limitations. The results of the simulation were presented and it was found that the output motor jerk motion violated the jerk limitations for the rotary motors which also lead to the violations for the Cartesian motors. This can be attributed to the transient effects of the position control loop induced by the jerk pulses that are used to modulate the feedrate. This suggests that a smoother feedrate profile such as the cubic acceleration or the cubic jerk profile may improve on the contouring results. Chapter 5. Hardware and Controller Implementations of the X-Y Table 112 Chapter 5 Hardware and Controller Implementations of the X-Y Table 5.1 Introduction The next stage after generating the motor axis commands with feed scheduling and the interpolation of the toolpath is to realize the tool motion on the CNC machine through the proper tracking of the motors. The performance of the CNC motor controller is crucial especially in 5-axis tool motions, as the performance in one motor axis, especially for the rotary drives, directly affects the performance of every axis in the motion of the cutting tool with respect to the workpiece. In addition, in the actual cutting operation, undesired vibrations with the tool motion is particularly damaging to the overall quality of the workpiece. This chapter presents the implementation of an industrial X-Y Table using a real time control system. The X-Y Table is an integral set-up to almost every CNC systems. This particular setup as shown in Figure 5.1 has an overall dimension of with a stroke distance of along the X-axis and in the Y-axis. It is a combination of two linear stages using a ball-screw mechanism with a motor drive mounted on each axis. The control algorithms are designed with MATLAB Simulink and the commands are processed through dSPACE to control the Siemens SIMODRIVE611U motor driver. A number of different control algorithms were implemented and their performances were analyzed. Figure 5.1: LAMB X-Y Table Chapter 5. Hardware and Controller Implementations of the X-Y Table 113 5.2 System Implementation Figure 5.2: X-Y Table System Overview This section will provide an overview of the system setup and a brief description of each of the components. A master external PC is setup to develop the control algorithms using Matlab Simulink. The control algorithms are uploaded onto the real time platform of the dSPACE DS1103 control board. Using the real time code that is compiled and uploaded on the DS1103, an analog voltage signal (-10 V to + 10 V) from the digit to analog (D/A) output of the DS1103 is sent to the SIMODRIVE 611 Universal (611U) motor driver/control board module. The SIMODRIVE 611 Universal (611U) is a control board module providing a communication interface with the motors and encoder systems. It is a 2-axis board that provides two independent drive controls capable of driving the motors in speed, torque or position mode. The 611U can be used independently with Siemens’ internal control algorithms, but it can also be used as a standard motor driver by operating in torque mode where the analog voltage signal from the DS1103 becomes the torque command for the motor. This allows custom control algorithms to be implemented. The encoder signal is fed back to both the 611U (required to operate the motor – temperature checks, etc.) and to the DS1103 to complete the control loop. The open loop diagram of torque mode operation is given in Figure 5.3 where the 611U acts as a standard motor driver and takes care of the current amplifier loop. The 611U has built-in information on the standard Siemens motors. The motors used were the three-phase Siemens Servomotors, 1FT6084. External PC 611U DS1103 Motor Encoder Chapter 5. Hardware and Controller Implementations of the X-Y Table 114 Figure 5.3: Torque Mode Open Loop Diagram The transfer function of the current amplifier loop can be written as the following: (5.1) Since the bandwidth of the electrical current loop is several orders higher than the mechanical system’s bandwidth, the current loop can be approximated with a constant gain in the operational range of the X-Y Table. The transfer function of the mechanical system and the reduced open loop transfer function are given as: (5.2) (5.3) Since the range of the voltage input and the desired torque from the motor can be adjusted within the settings of the 611U, essentially, is an adjustable value. 5.3 Controller Designs This section discusses the different control algorithms that were implemented on the two-axis X-Y table and notes some of the expected observations and results. The open loop transfer functions are not identical for the X and Y axis due to their physical differences such as the X axis table being heavier than the Y axis table (Y on top of X). The goals used for the controller designs are: b). Mechanical System a). Current Amplifier Loop Chapter 5. Hardware and Controller Implementations of the X-Y Table 115 To maximize bandwidth/response speed To ensure stability with at least 60 deg of phase margin To eliminates steady-state error To minimizes overshoot The general procedure of controller design is to model the transfer function of the machine plant, , in the s-domain and apply the zero-order hold (ZOH) equivalent to the plant. After which, the controllers will be designed in the discrete Z-domain, . Including the amplifier, motor constants, the mechanical plant and the encoder gain, the open loop transfer function of the system from input voltage to position in the domain is: (5.4) where and . Since this system has to be controlled by a digital discrete control system with a sampling time of , to compute for the equivalent system in the discrete Z-domain, the zero order hold is applied: – – (5.5) The Euler approximation is used where . The Bode plot of the system transfer function in the continuous s-domain and discrete Z-domain can be plotted and compared. The expected Chapter 5. Hardware and Controller Implementations of the X-Y Table 116 difference is that in the Z-domain, the dynamics of the zero order hold is included which provides additional phase from the time delay. The systems will end up with different phase and gain margins. However, this difference is minimized with a smaller sampling time. 5.3.1 PID Controller The PID (Proportional Integral Derivative) controller is one of the simplest and most robust controllers and it is widely used in industry. With a proportional controller gain, , the closed loop transfer function is the following: – – (5.6) Given a desired damping ratio and natural frequency, there would be corresponding poles on the characteristic equation of this transfer function which will determine the value to use. These desired poles have to be designed such that their magnitude is less than one. In the s- domain, can be chosen to shift the magnitude plot of the loop transfer function up to cross the 0 dB line at the desired frequency – desired crossover frequency, . The PID controller has a transfer function with the following form: (5.7) The general rule in tuning these three gain parameters is the following: Add to increase bandwidth decrease time constant improve rise time Add to decrease tracking error and improve overshoot Add to remove steady state error Chapter 5. Hardware and Controller Implementations of the X-Y Table 117 Figure 5.4: PID Controller Bode Plot , , Since the whole PID controller is the sum of the proportional (flat line), integral (negative slope), and the derivative (positive slope), in the magnitude plot of the controller, the largest of the three dominates at a given frequency, as shown in Figure 5.4 above. Consider a general control system shown in Figure 5.5 below, the error transfer function is given by: Figure 5.5: General Close Loop Control System (5.8) The error transfer function suggests that a large loop gain will minimize the tracking error. Moreover, as suggested by the Initial Value Theorem: (5.9) and the Final Value Theorem: Chapter 5. Hardware and Controller Implementations of the X-Y Table 118 (5.10) The behavior of the frequency response is describing the inverse behavior of the time domain. Since the integral portion of the controller keeps the magnitude high at low frequencies (large time), its effect is apparent with steady state error and since the derivative portion keeps the magnitude high at high frequencies, it improves tracking error and overshoot. Given some desired performance, these three parameters can be tuned to satisfy the design requirements. 5.3.2 Lead Lag Controller The lead-lag controller is a lead compensator cascaded with a lag compensator to introduce a pole-zero pair into the open loop transfer function. Lead compensation, shown in Figure 5.6, is a conventional frequency-domain design approach, which uses the derivative to improve stability by directly increasing the phase margin. Lead compensation is used to compensate for the phase delay of the plant, allowing for a higher system bandwidth and faster response speed. The system bandwidth can be increased further by increasing the DC gain of the control loop, which also improves the steady state tracking. Figure 5.6: Lead Compensator Bode Plot Lag compensator, shown in Figure 5.7, can be used to simultaneously improve both the steady- state accuracy and the stability of the system. Since the lag compensator adds a phase lag to the system, it actually has a destabilizing effect. But since the crossing frequency is reduced by the lag compensator, the phase lag will be lower in the neighborhood of the new crossing Chapter 5. Hardware and Controller Implementations of the X-Y Table 119 frequency, thereby increasing the phase margin and improving system stability. The lag compensator inherently improves the low-frequency behavior, steady-state accuracy in particular, of the system. Furthermore, since a lag compensator is essentially a low-pass filter, it has the added advantage of filtering out high-frequency noise. Figure 5.7: Lag Compensator Bode Plot An integrator can also be added to eliminate steady state error. In Laplace domain, the Lead Lag compensator with integrator transfer function is written as: (5.11) The design goals for the lead lag controller are the desired cross over frequency, , and the phase margin, . Phase margin is defined as the difference between the phase at the cross over frequency and degrees. The integrator can be lumped with the plant using the calculation where a common value of the integrator constant is picked to be . Then the phase contribution by the lead lag controller is given as: Chapter 5. Hardware and Controller Implementations of the X-Y Table 120 (5.12) where (5.13) In order for the resulting phase at to be , the total phase of the loop transfer function at the cross over frequency is expressed, where can be solved: (5.14) The gain, , is added to ensure the loop transfer function passes through the desired cross over frequency at or a gain of one. (5.15) Using the Euler approximation, the lead lag controller can be written in the discrete Z-domain as: (5.16) 5.3.3 Loop Shaping Controller Loop shaping is a control method to improve the system performance and maintain the system stability by tuning the controller to shape the negative loop transmission (NLT) to achieve the desired characteristics. Depending on the frequency response function of the plant, it is common to shape the to cross over at the desired crossover frequency, . Since the closed loop transfer function is given as , this would place the drop to occur near . A design requirement is to ensure that the NLT has a positive phase margin at and it is desirable to reduce the NLT gain for and increase NLT gain for . At high frequencies, , it is desirable to minimize the control output and not amplify the noise. At low frequencies, , a higher NLT gain can improve the tracking Chapter 5. Hardware and Controller Implementations of the X-Y Table 121 performance. The loop shaping controller is very similar to the lead-lag controller and is shown as follows: (5.17) In the Z-domain, this is given as: (5.18) For a second order system, , a proportional controller will always have a zero phase margin with a -2 slope crossing on the magnitude plot. An integrator controller is worse with a -3 slope (-270 degrees phase). The idea of the loop shaping controller is to shape the NLT to cross with a higher phase than 180 degrees to have a positive phase margin. In the case of a 2nd order plant, the controller needs to provide a positive slope at to increase the phase at . The loop shaping controller is shown in Figure 5.8. A positive slope is only necessary around . Figure 5.8: Loop Shaping Controller Bode Plot The Bode plot of the loop shaping (green) is shown with and . A low value should be chosen to satisfy the phase margin requirement as it would provide a higher Chapter 5. Hardware and Controller Implementations of the X-Y Table 122 NLT gain for and improve the tracking performance. To remove the steady state error, an integrator is introduced to increase the NLT gain at low frequencies. 5.3.4 Pole Placement Controller The pole placement controller block diagram is shown in Figure 5.9 and its control strategy [4] is to assign the desired poles to the closed loop transfer function of the system to define the system characteristic. Figure 5.9: Pole Placement Controller Block Diagram The plant’s transfer function is written in the form of and it has a delay of sampling intervals with the following open loop polynomials: (5.19) The polynomials , and represent the feedback, feed-forward and error regulators respectively, and form the control law. (5.20) The closed loop transfer function of the control system is given by: (5.21) If the plant has a stable zero inside the unit circle, can be partitioned into two parts: where has the stable and has the unstable zeros. Stable zeros ( ) can be Chapter 5. Hardware and Controller Implementations of the X-Y Table 123 cancelled by selecting the control polynomial , which leads to the following transfer function: (5.22) (5.23) where the stable zeros are cancelled out, leaving the unstable zeros. The goal of the pole placement design is for the closed loop transfer function to obey the following desired model dynamics: (5.24) where is the desired characteristic equation of the closed loop system which is designed to the desired transient response characteristics. A second order dynamic model represents the desired response with a damping ratio of and natural frequency of , (5.25) The desired poles can be mapped to the Z-domain by, (5.26) A damping ratio of is desirable. The acceleration is determined by the maximum acceleration that the motors provide without going over the torque limit. The peak torque is for accelerating the inertia , then the maximum acceleration becomes: Chapter 5. Hardware and Controller Implementations of the X-Y Table 124 (5.27) If the drive maximum velocity is , is the rise time. The natural frequency [rad/sec] is approximated with the following equation: (5.28) With this approximation, the discrete closed loop transfer function with a unit gain is: (5.29) The order of the desired characteristic equation ( ) must be equal to the order of plant’s poles . The following equation must hold in order for the system to behave like the desired model. (5.30) The highest powers of are and , and their powers are equal to obtain number of equations. The number of unknowns in control polynomials in and is which must be equal to the number of simultaneous equations. The degree of control polynomials are found as: (5.31) The numerators must have a balanced power as well, (5.32) By separating the unknowns in a matrix form, the identification of control parameters are reduced to a least square problem. Chapter 5. Hardware and Controller Implementations of the X-Y Table 125 5.3.5 Sliding Mode Controller Sliding mode control [3] is a nonlinear control technique with high robustness against hysteresis, nonlinearity, and disturbance while having a high frequency bandwidth. It makes use of a sliding surface that is being tracked, which in turn dictates how the positions are being tracked. An energy function is formed to slide the system onto the surface, with considerations to the disturbance. Figure 5.10: Open Loop Linear Rigid Body Feed Drive Dynamics Model The system equation for the feed drive model shown in Figure 5.10 can be written as: (5.33) where , is the output position, is the control input, and is the system disturbance. The fundamental steps in designing a sliding mode controller are the selections of a sliding surface and a Lyapunov function. For accurate tracking of position and velocity, the sliding surface, is selected as: (5.34) where is the desired but achievable bandwidth of the drive, is the reference position command, and and are the respective velocities. The and are upper and lower disturbance limits measured on the machine. The external disturbance can be tracked by the following simple observer, (5.35) u Control Signal Current Amplifier i Motor Inertia and Viscous Damping Disturbance Encoder Chapter 5. Hardware and Controller Implementations of the X-Y Table 126 where is the control period, is the control interval counter in discrete time domain, is parameter adaptation gain ( ) and is the coefficient for the integral control of the disturbance as, (5.36) The second step in sliding mode controller design is to select a Lyapunov function which is used to obtain a stable control law for a nonlinear system. The Lyapunov function is as follows: (5.37) which resembles the summation of kinetic energy and the square of disturbance prediction error. For asymptotic stability of nonlinear systems, the derivative of the Lyapunov function must be negative or zero, meaning that the rate of change in the energy and prediction error must decrease. (5.38) where is the control gain to be selected. Therefore, the control law is obtained as the following: (5.39) 5.4 Implementation Results With the desired reference X and Y positions given from trajectory generation, an important measure of performance is the contour error. While the axis tracking error applies only for the particular motor axis, the contour error requires a high tracking performance from both axes. The frequency response of the open loop plant system was taken and it provides an accurate representation to design the controllers. The results of the contouring experiment with the implemented controllers are presented. The feedforward controller was also used in Chapter 5. Hardware and Controller Implementations of the X-Y Table 127 conjunction with the presented controllers using the experimentally determined plant system dynamics. It helps to reduce the control effort that is required by the test controller. 5.4.1 Frequency Response Function The experimental open loop frequency response is taken to assess the performance of the actual system. It allows the controllers to be designed more accurately based on the actual behavior of the system. For the FRF experiment, different frequencies (sinusoidal) of voltage commands were applied with constant voltage offsets to the open loop of each drive axis. The offset voltage ensures that the drive is constantly moving in one direction to avoid introducing unnecessary static friction when the drive changes directions. For each frequency, the magnitude ratio of the angular velocity and the input voltage, and their phase differences are measured. The FRF is given as the output position in millimeters over the input voltage. The results are plotted in Figure 5.11 and 5.12 as the measured frequency response function for each drive. Figure 5.11: X-Axis FRF Experiment Chapter 5. Hardware and Controller Implementations of the X-Y Table 128 Figure 5.12: Y-Axis FRF Experiment The experimental FRF are plotted against the theoretical model that was obtained from the 2nd order feed drive dynamics Eqn. (5.4) using the experimentally determined inertia equivalent, , and the experimentally determined viscous damping equivalent, . These values were identified using open-loop experimentations and are given in the following Table 5.1: X-axis 0.030 0.0253 Y-axis 0.022 0.0237 Table 5.1: Experimentally Determined Equivalent Inertia and Damping The experimental results are very similar to the theoretical results. It is important to pick a feasible cross over frequency to design the controllers. Since the actual system is a high order system with a lot of coupled modes, it is desirable to select a cut off frequency that is relatively consistent in terms of both magnitude and phase. A basic requirement for stability is for the magnitude plot of the loop function to only cross unity gain at one frequency. In addition the limits of the controllers are also considered. For instance, it may not be possible for the controllers to have really high gains due to power limitations and there are also limits to the Chapter 5. Hardware and Controller Implementations of the X-Y Table 129 amount of phase compensation that can be provided by the controller. The desired cross over frequencies of 20 for X axis and 15 for Y axis are selected as the design targets of the controllers. 5.4.2 Basic Controller Contouring Evaluations A sample NURBS tool path trajectory is used to test the maneuverability of the large- sized X-Y table. The sample toolpath was interpolated with the 1st order Taylor’s expansion; the contouring performance of the loop shaping, pole placement and the sliding mode controllers were evaluated. For simplicity, a trapezoidal feedrate profile was used. The axis commands were generated with a sampling time of . The total length of the tool path is and the displacement and feedrate profile used are shown as Figure 5.13: Figure 5.13: Controller Evaluation: Displacement and Feedrate Profile The loop shaping controller was tested with the parameters listed in Table 5.2 – the design is based on designing the cross over frequencies of 20 for X axis and 15 for Y axis, with a phase compensation to increase the phase margin to . Controller Parameters X axis Y axis 2.883 1.969 2.000 1.500 4 4 Cutoff frequency 20 15 Table 5.2: Loop Shaping Controller Parameters Chapter 5. Hardware and Controller Implementations of the X-Y Table 130 Figure 5.14: Loop Shaping Controller Position and Tracking Error Figure 5.15: Loop Shaping Controller Contour Error Chapter 5. Hardware and Controller Implementations of the X-Y Table 131 Figure 5.16: Loop Shaping Controller Contouring Performance For the loop shaping controller, as shown in Figure 5.14, the largest tracking error for the axis is occurring at the start and the end of the toolpath, as well as in the middle of the tool path where the direction is flipped. When the toolpath starts, there is some delay between the reference and the actual position since the motion is starting up and there is also static friction involved. As the toolpath flips in direction, there is a rapid change in the reference command, and for this large scale X-Y table, the bandwidth or the response time for the controller designs cannot be too high without losing stability. Similarly, the axis suffers from the highest tracking error at the wheels where the sharp change in the reference is demanding a large control effort from the controller. From Figure 5.16, the overall performance of the loop shaping controller is very good as there were no observable vibrations throughout the entire toolpath and the maximum contour error resulted in at the first wheel. It is also clear that the tracking errors are very small for the smoother regions of the toolpath. Chapter 5. Hardware and Controller Implementations of the X-Y Table 132 The pole placement controller parameters are the desired natural frequency and damping ratio of the resulting closed loop response. A high natural frequency as listen in Table 5.3 was selected to achieve a high response time for the controller and a slightly underdamped system was implemented. Controller Parameters X axis Y axis Natural frequency 50 40 Damping ratio 0.9 0.9 Table 5.3: Pole Placement Controller Parameters The faster response time of the designed pole placement controller leads to a lower maximum contour error of than the loop shaping controller. From the resulting contouring performance shown in Figure 5.19, the observed overshoots at the curves are very small as the system is very close to being critically damped. At the end of the toolpath, however, there is a residue error of , whereas the loop shaping controller only had of residual error. This can be attributed to the loop shaping controller being cascaded to an integrator which serves to eliminate steady state error. However, due to the faster response of the pole placement controller, the transient contouring performance where the curve switches directions or where the toolpath has a high curvature performs better than the loop shaping controller. Chapter 5. Hardware and Controller Implementations of the X-Y Table 133 Figure 5.17: Pole Placement Controller Position and Tracking Error Figure 5.18: Pole Placement Controller Contour Error For the sliding mode controller, some tuning was required for selecting the values for the adaptive gain, and the sliding gain, . The maximum and minimum disturbance values were obtained from the open loop friction experiment where the maximum observed static friction are taken for both directions of travel. The resulting controller parameters that were implemented are listed in Table 5.4: Chapter 5. Hardware and Controller Implementations of the X-Y Table 134 Figure 5.19: Pole Placement Controller Contouring Performance Controller Parameters X axis Y axis Bandwidth gain 15 13 Adaptive gain 0.003 0.004 Sliding gain 1 0.8 Min disturbance -8 -3.52 Max disturbance 8 3.52 Table 5.4: Sliding Mode Controller Parameters It was observed that during the X-Y table motion as shown in Figure 5.22, the sliding mode controller was very aggressive and that led to slight vibrations along the toolpath. A wavy position output can be observed from Figure 5.20. The maximum contour error was recorded as Chapter 5. Hardware and Controller Implementations of the X-Y Table 135 . Further tuning may be required to improve the performance of this controller, as a less aggressive controller will reduce the observed vibrations. Figure 5.20: Sliding Mode Controller Position and Tracking Error Figure 5.21: Sliding Mode Controller Contour Error Chapter 5. Hardware and Controller Implementations of the X-Y Table 136 Figure 5.22: Sliding Mode Controller Contouring Performance Overall, the pole placement controller was shown to have the lowest contour error compared to the loop shaping controller and the sliding mode controller. The loop shaping controller had the least steady state error by the end of the toolpath due to the cascading of an integrator. Further tuning of the sliding mode controller gains are required to improve its contouring performance. Chapter 6. Conclusion 137 Chapter 6 Conclusion 6.1 Conclusion The continuous motion of the cutting tool is highly appreciated in decreasing machining cost and improving part quality. Complex free-form geometries are often broken down into short linear segments in NC programs, and results in a piece-wise motion of the CNC machine tool. In this thesis, a smooth NURBS toolpath trajectory generation scheme with real time interpolation techniques is presented. The proposed techniques allow for the coordinated movements of the motor drives within their kinematic limits and are applicable for both 3-axis and 5-axis high speed machining. The NURBS representation of the toolpath was presented. A global approximation least squares fit allows a large number of tool data points to be fitted with a relatively small amount of control points. By using a pre-assigned knot vector, the control points can be solved linearly as the minimization parameter to minimize the error between the data points and the corresponding locations on the NURBS curve. However, it was shown that if the minimization consideration is solely at the data points, an undesirable wavy toolpath may be produced as the least squares algorithm forces the curve to discriminatively pass through the data points. The chord error minimization objective function was introduced to reduce the absolute influence at the data points, and strives to minimize each respective region of the curve to the respective chord formed by the data points. This minimization method scales the influence of each region through their range in the curve parameter and it was observed that the chord error results have a close resemblance to the mean error results at the data points. In addition, the jerk minimization objective function was used to minimize the jerk content of the curve with respect to the curve parameter. The effectiveness of the objective functions was proven using the sample fan shaped tool path, where the commonly used least squares fit at the data points was used as a controlled comparison as the objective coefficients for the chord minimization and the jerk minimization were varied. While increasing the influence of the chord error minimization affected the curve positively in terms of the observed fluctuations, the influence of the least squares objective at the data points was still required to preserve the overall shape of the curve and ensure that poor parameterization of the curve does not occur. This was the same for the jerk minimization objective, as the resulting curve’s curvature decreased; however increasing Chapter 6. Conclusion 138 the jerk minimization coefficient too much started to have a detrimental effect. It was concluded that the chord error minimization and the jerk minimization should be used conservatively while preserving the influence of the least squares error at the data points. By combining the smooth curve fitting technique and using the double spline format to simultaneously represent both the tool tip position and the tool orientation, it was shown that a single curve parameter can be used to accurately represent and interpolate the toolpath information. The fitting algorithm was tested on sample position and orientation toolpaths and feasibility was shown as the specified fitting tolerances were met. This representation allows for a convenient integration into a 5-axis system without the unnecessary computation from additional interpolations steps. Using the double spline format, one of the interpolation techniques can be applied to the lower spline in real time on the CNC machine to generate the reference tool tip position and the tool orientation. The real time interpolation techniques of the Taylor expansion and the Feed Correction Polynomial were analyzed. The Taylor expansion method is difficult to implement using a variable feedrate and shows high feed fluctuations where the toolpath has a high curvature. In addition, the computation of the higher order derivatives of the NURBS curve with the Taylor expansion can be computationally expensive due to the recursive nature of the B-spline basis functions. The Feed Correction Polynomial on the other hand, has extremely low real time computation time, as the polynomial coefficients are pre-calculated in pre-processing. It is also robust to using a variable feedrate and provides an accurate mapping between the spline length and the curve parameter. In addition, using a higher mean square error tolerance of fitting the polynomial has been shown to have good results with little feed fluctuations. While proper interpolation can reduce feed motion fluctuation of the cutting tool, the toolpath fitting process is also extremely important. Since the overall feed motion is the combined coordinated motion of all the motor axes, if the toolpath is inherently full of fluctuations, (high jerk and curvature content, etc.) the resulting motion for the individual axes can be oscillatory. The interpolation methods tries to output the next curve parameter value, , within the given sampling time to provide a consistent tool displacement, . The fluctuation of the individual axes can cancel each other out for the resulting feed to exhibit very low fluctuations. This is a limitation of the interpolation methods, since the individual axes can become excited and cause undesirable vibration with the respective axis. This ultimately means Chapter 6. Conclusion 139 that both the toolpath planning and the interpolation need to work effectively to produce a smooth and continuous tool motion. A multi-segment limited jerk feed profile was presented to continuously modulate the feedrate between segments of constant feed to meet the local constraints that were imposed by the kinematic motor constraints and the part geometrical constraints such as chord error and curvature. In order to properly apply these constraints, the inverse kinematics was applied to determine how the toolpath motion is translated into the individual motion of the motors. Due to the varying demands on the different motors along different regions of the toolpath, an overall feedrate constraint was incurred. From the experimental and simulation results, the reference commands of the motors did not violate the limits; however, the actual motor positions may end up violating the limits due to the transient response from the position tracking. Particularly, it was noted that the largest contour errors occurred where the limited jerk was applied to modulate the feedrate. This problem can be improved by applying a smoother feed profile than the limited jerk, such as the cubic acceleration. The advantage of using the limited jerk profile over an optimized profile is because it is well-defined, providing insights on the feasible feedrate regions and is able to modulate between constant feedrate easily. The cubic acceleration profile should be capable of the same thing, with much lower frequency within its jerk content, and thus is more robust from exciting the system. While toolpath generation, toolpath interpolation and feedrate scheduling are responsible for generating the motor reference commands, the CNC motion controller is responsible with the tracking performance of the reference commands. Some commonly used controller algorithms were compared using a simple toolpath and they were tested on a large- sized X-Y table that was driven by industrial Siemens motors. 6.2 Future Research Direction In continuation to this work, some possible future research direction is to analyze how the fitting of the toolpath can affect the frequency content of the reference command under constant feed. If the natural modes of the CNC machine system are known, the toolpath fitting may be adjusted to specifically avoid these modes. Another possible research direction is to analyze the spatial frequencies of the reference commands, as high frequencies often indicate sharp edges. Ideas from optics design of spatial filters may be used to filter out the high Chapter 6. Conclusion 140 frequencies; however, algorithms will have to be developed such that the geometrical machining tolerances are not affected and can still be met. During the toolpath fitting process, the corresponding curve parameters on the NURBS curve for the data points, were first estimated based on the chord length and were later found using the minimum distance condition with the Newton Raphson method, this can be improved computationally by narrowing down the search regions and there may be inherent properties within the NURBS curve that can be used to better estimate these corresponding curve parameter values, rather than through curve displacement. It was mentioned that curve displacement generally has a nonlinear relationship with the curve parameter; thus using this criteria in estimating the parameters may not be the best option. For the feed profile, the limited jerk profile was used because of its simple and well defined formulations, allowing for a known feasible feedrate range for the feedrate modulation. However, the non-continuous jerk profile was problematic and caused undesirable tracking error as the feedrate was modulated. It also contains a high frequency content that is capable of exciting the motor drives. A cubic acceleration or a cubic jerk feed profile also have well defined formulations. The multi-segmenting feed profile scheduling method can be easily extended to these other types of profile that have shown higher continuity and smoother motion. Additionally, as the feed scheduling becomes more developed in real time applications, it should be possible to apply control laws to the overall process; including the feedrate scheduling. It is undeniable that having a lower feedrate can improve contour error, and including the feedrate as part of the control loop can be robust to operational disturbances that are hard to estimate in pre-processing. However, as it is desirable to keep feedrate as constant as possible, look-ahead algorithms as well as effective scheduling algorithms will have to be developed. In terms of controller design, the CNC position controllers can be designed to specifically reduce contour error rather than the individual axis’s tracking error. The dynamics of the CNC kinematics has to be accounted for to formulate an expression of the contour error. The overall scheme of continuous tool motion can be applied to robotic applications in general. There are many types of industrial robots that can benefit from the optimization of their motion to increase productivity. New CNC configurations involving robotic arms are gaining popularity, having entirely different workspace and constraints than conventional CNC machines. Bibliography 141 Bibliography [1] Affouard, A., Duc, E., Lartigue, C. Langeron, J.-M., Bourdet, P., 2004, “Avoiding 5-Axis Singularities using Tool Path Deformation”, Journal of Machine Tools and Manufacture, Vol. 44, Iss. 4, pp. 415-425. [2] Altintas, Y., 2000, “Manufacturing Automation: Metal Cutting Mechanics, Machine Tool Vibrations and CNC Design”, Cambridge University Press. [3] Altintas, Y., Erkorkmaz, K., Zhu, W.-H., 2000, “Sliding Mode Controller Design for High Speed Drives”, CIRP Annuals – Manufacturing Technology, Vol. 49, Iss. 1, pp. 265-270. [4] Altintas, Y., 2009, “Computer Control of Mechatronics Systems (Course Notes)”, Mechanical Engineering, The University of British Columbia, Vancouver. [5] Bahr, B., Xiao, X., Krishnan, K., 2001, “A Real-time Scheme of Cubic Parametric Curve Interpolations for CNC Systems”, Computers in Industry, Vol. 45, Iss. 3, pp. 309-317. [6] Chen, X.-D., Yong, J.-H., Wang, G., Paul, J.-C., Xu, G., 2008, “Computing the Minimum Distance between a Point and a NURBS Curve”, Computer-Aided Design, Vol. 40, Iss. 10- 11, pp. 1051-1054. [7] Cheng. M.-Y., Tsai, M.-C., Kuo, J.-C., 2002, Real-time NURBS Command Generators for CNC Servo Controllers”, Journal of Machine Tools and Manufacture, Vol. 42, Iss. 7, pp. 801-813. [8] Cheng, C.-W., Tsai, M.-C., 2004, “Real-Time Variable Feedrate NURBS Curve Interpolator for CNC Machining”, Journal of Advanced Manufacturing Technology, Vol. 23, No. 11-12, pp. 865-873. [9] Constantinescu, D., Croft, E.A., 2000, “Smooth and Time Optimal Trajectory Planning for Industrial Manipulators Along Specified Paths”, J. Rob. Syst., Vol.17, pp. 233-249. [10] DSPACE Release, Quick Software Installation Guide, Release 6.1. [11] DSPACE Systems, First Work Steps, Release 6.0. [12] DSPACE PPC Controller Board, Hardware Installation and Configuration, Release 6.0. [13] Erkorkmaz, K., 1999, M.A.Sc. Thesis: “High Speed Contouring Control for Machine Tool Drives”, University of British Columbia, Department of Mechanical Engineering, BC, Canada. Bibliography 142 [14] Erkorkmaz, K., Altintas, Y., 2001, “High Speed CNC System Design: Part I – Jerk Limited Trajectory Generation and Quintic Spline Interpolation”, International Journal of Machine Tools and Manufacture, Vol. 41, No. 9, pp. 1323-1345. [15] Erkorkmaz, K., Altintas, Y., 2001, “Trajectory Generation for High Speed Milling of Molds and Dies”, Proceedings of the 2nd International Conference and Exhibition on Design and Production of Does and Molds, Kusadasi, Turkey, DM_46. [16] Erkorkmaz, K., Altintas, Y., 2002, “Optimal Spline Interpolation for High Speed Machine Tools”, Proceedings of 6th Biennial Conference on Engineering Systems Design and Analysis, Istanbul, Turkey. [17] Erkorkmaz, K., Altintas, Y., 2003, “Feedrate Optimization for Spline Interpolation in High Speed Machine Tools”, CIRP Annals – Manufacturing Technology, Vol. 52, Iss. 1, pp. 297- 302. [18] Erkorkmaz, K., 2004, Ph.D. Thesis: “Optimal Trajectory Generation and Precision Tracking Control for Multi-Axis Machines”, University of British Columbia, Department of Mechanical Engineering, BC, Canada. [19] Erkorkmaz, K., Altintas, Y., 2005, “Quintic Spline Interpolation with Minimal Feed Fluctuations”, Journal of Manufacturing Science and Engineering, Vol. 127, No. 2, pp. 339-349. [20] Erkorkmaz, K., M. Heng, 2008, “A Heuristic Feedrate Optimization Strategy for NURBS Toolpaths”, CIRP Annuals - Manufacturing Technology, Vol. 57, Iss. 1, pp. 407-410. [21] Heng, M., 2008, “Smooth and Time-Optimal Trajectory Generation for High Speed Machine Tools”, University of Waterloo, Department of Mechanical Engineering, Ontario, Canada. [22] Heng, M., Erkorkmaz, K., 2010, “Design of a NURBS Interpolator with Minimal Feed Fluctuations and Continuous Feed Modulation Capability”, International Journal of Machine Tools and Manufacture, Vol. 50, Iss. 3, pp. 281-293. [23] Ho, M.-C., Hwang, Y.-R., Hu, C.-H., 2003, “Five-Axis Tool Orientation Smoothing Using Quaternion Interpolation Algorithm”, International Journal of Machine Tools and Manufacture, Vol. 43, Iss. 12, pp. 1259-1267. [24] Hsu, Y.Y., Wang, S.S., 2007, “A New Compensation Method for Geometry Errors of Five- Axis Machine Tools”, International Journal of Machine Tools and Manufacture, Vol. 47, Iss. 2, pp. 352-360. Bibliography 143 [25] Huang, J.-T., Yang, D. C.H., 1992, “Precision Command Generation for Computer Controlled Machines”, ASME Precision Machining: Technology and Machine Development and Improvement, Vol. 58, pp. 89–104. [26] Jung, Y. H., Lee, D.W., Kim, J. S., Mok, H. S., 2002, “NC Post-Processor for 5-axis Milling Machine of Table-rotation/tilting type”, Journal of Materials Processing Technology, Vol 130-131, pp. 641-646. [27] Koren, Y., Lo, C.C., Shpitalni, M., 1993, “CNC interpolators: Algorithms and Analysis”, ASME Production Engineering Division, Proceedings of the 1993 ASME Winter Annual Meeting, Vol. 64, pp. 83-92. [28] Koren, Y. Lin, R. S.,1994, “Real-Time Five Axis Interpolator for Machining Ruled Surfaces”, Proceedings of the 1994 International Mechanical Engineering Congress and Exposition, ASME Dynamic System and Control Division, Vol. 55-2, pp. 951-959. [29] Koren, Y., Lin, R.-S., 1995, “Five-Axis Surface Interpolators”, Annals of CIRP, Vol. 44, No. 1, pp. 379-382. [30] Lai, Y.-L., 2010, “Tool-Path Generation of Planar NURBS Curve”, Robotics and Computer- Integrated Manufacturing, Vol. 26, Iss. 5, pp. 471-482. [31] Langeron, J.M., Duc, E., Lartigue, C., Bourdet, P., 2004, “A New Format for 5-Axis Tool Path Computation, using B-Spline Curves”, Vol. 36, Iss. 12, pp. 1219-1229. [32] Lei, W.T., Sung, M.P., Lin, L.Y., Huang, J.J., 2007, “Fast Real-Time NURBS Path Interpolation for CNC Machine Tools”, International Journal of Machine Tools and Manufacture, Vol. 47, Iss. 10, pp. 1530-1541. [33] Lei, W.T., Wang, S.B., 2009, “Robust Real-Time NURBS Path Interpolators”, International Journal of Machine Tools and Manufacture, Vol. 49, Iss. 7-8, pp 625-633. [34] Li, W., Liu, Y., Yamazaki, K., Fujisima, M., 2008, “The Design of a NURBS Pre-Interpolator for Five-Axis Machining”, International Journal of Advanced Manufacturing Technology, Vol. 36, No. 9-10, pp. 927-935. [35] Lin, H., Wang, G., Dong, C., 2003, “Constructing Iterative Non-Uniform B-Spline Curve and Surface to Fit Data Points”, Science in China Series F: Information Sciences, Vol. 47, No. 3, pp. 315-331. [36] Lin, M.-T., Tsai, M.-S., Yau, H.-T., 2007, “Development of a dynamic-based NURBS Interpolator with Real-Time Look-Ahead Algorithm”, International Journal of Machine Tools and Manufacture, Vol. 47, Iss. 15, pp. 2246-2262. Bibliography 144 [37] Lin, R.-S., 2000, “Real-Time Surface Interpolator for 3-D Parametric Surface Interpolator for 3-D Parametric Surface Machining on 3-Axis Machine Tools”, International Journal of Machine Tools and Manufacture, Vol. 40, Iss. 10, pp. 1513-1526. [38] Liu, X., Ahmad, F., Yamazaki, K., Mori, M., 2004, “Adaptive Interpolation Scheme for NURBS Curves With the Integration of Machining Dynamics”, International Journal of Machine Tools and Manufacture, Vol. 45, Iss. 4-5, pp. 433-444. [39] Lo, C.-C., 1998, “A New Approach to CNC Tool Path Generation”, Computer-Aided Design, Vol. 30, Iss. 8, pp. 649-655. [40] Macfarlane, S., Croft, E.A., 2003, “Jerk-Bounded Manipulator Trajectory Planning: Design for Real-time Applications”, Transactions of IEEE on Robotics and Automation, Vol. 19, No. 1, pp. 42-52. [41] Makhanov, S.S., 2010, “Adaptive Geometric Patterns for Five-Axis Machining: A Survey”, International Journal of Advanced Manufacturing Technology, Vol. 47, No. 9-12, pp. 1167-1208. [42] Matlab version 7.9.0 Natick, Massachusetts: The MathWorks Inc., 2009. [43] Mathews, J.H., Fink, K.K., 2004, “Numerical Methods Using Matlab (4th Edition), Prentice-Hall Inc. [44] Medioni, G., Yasumoto, Y., 1987, “Corner Detection and Curve Representation using Cubic B-Splines”, Computer Vision, Graphics, and Image Processing, Vol. 39, Iss. 3, pp. 267-278. [45] Omirou, S.L., 2003, “Space Curve Interpolation for CNC Machines”, Journal of Materials Processing Technology, Vol. 141, Iss. 3, pp. 343-350. [46] Park, J., Nam, S., Yang, M., 2005, “Development of a Real-Time Trajectory Generator for NURBS Interpolation Based On The Two-Stage Interpolation Method”, Vol. 26, No. 4, pp. 359-365. [47] Piegl, L., Tiller, W., 1997, “The NURBS Book”, Springer Verlag. [48] Piegl, L., Tiller, W., 2002, “Biarc Approximation of NURBS Curves”, Computer-Aided Design, Vol. 34, Iss. 11, pp. 807-814. [49] Selimovic, I., 2006, “Improved Algorithms for the Projection of Points on NURBS curves and surfaces”, Computer Aided Geometry Design, Vol. 23, Iss.5, pp. 439-445. [50] Sencer, B., 2005, M.A.Sc. Thesis: “Five-Axis Trajectory Generation Methods”, University of British Columbia, Department of Mechanical Engineering, BC, Canada. Bibliography 145 [51] Sencer, B., Altintas, Y., Croft, E. A., 2008, “Feed Optimization for Five-Axis CNC Machine Tools with Drive Constraints”, International Journal of Machine Tools and Manufacture, Vol. 48, Iss. 7-8, pp. 733-745. [52] Sencer, B., Altintas, Y., Croft, E. A., 2009, “Modeling and Control of Contouring Errors for Five-Axis Machine Tools. Part I – Modeling”, Transactions of ASME Journal of Manufacturing Science and Engineering, Vol. 131, Iss. 3, 8 pages. [53] Sencer, B., Altintas, Y., Croft, E. A., 2009, “Modeling and Control of Contouring Errors for Five-Axis Machine Tools. Part II – Precision Contour Controller Design”, Transactions of ASME Journal of Manufacturing Science and Engineering, Vol. 131, Iss. 3, 10 pages. [54] Sencer, B., 2009, Ph.D. Thesis: “Smooth Trajectory Generation and Precision Control of 5-Axis CNC Machine Tools”, University of British Columbia, Department of Mechanical Engineering, BC, Canada. [55] Shpitalni, M., Koren, Y., Lo, C.C., 1994, “Realtime Curve Interpolators”, Computer-Aided Design, Vol. 26, Iss. 11, pp. 832-838. [56] Siemens, “Quick Startup Guide for SIMODRIVE 611 Universal”, Version 1.0, 2000 [57] Siemens, “SIMODRIVE 611 digital – Drive Converters – Configuration Manual”, 05/2008 Edition [58] Siemens, “SIMODRIVE 611 MASTERDRIVES MC – Synchronous Servomotors 1FT6 – Configuration Manual”, 10/2005 Edition [59] Siemens, “SIMODRIVE 611 Universal – Control Components for Closed-Loop Speed Control and Positioning – Function Manual”, 09/2008 Edition [60] Tsai, M.-C., Cheng, C.-W., 2003, “A Real-Time Predictor-Corrector Interpolator for CNC Machining”, Journal of Manufacturing Science and Engineering, Vol. 125, Iss. 3, pp. 449- 460. [61] Tsai, Y.-F., Farouki, R.T., Feldman, B., 2001, “Performance Analysis of CNC Interpolators for Time-Dependent Feedrates along PH Curves”, Computer Aided Geometric Design, Vol. 18, No. 3, pp. 245-265. [62] Wang, F.-C., Yang, D.C.H., 1993, “Nearly Arc-Length Parameterized Quintic-Spline Interpolation for Prescision Machine”, Computer-Aided Design, Vol. 25, No. 5, pp. 281- 288. [63] Wang, F.-C., Schofield, S., Wright, P.K., 1996, “Real Time Quintic Spline Interpolator for an Open Architecture Machine Tool”, ASME Dynamic Systems and Control Division, Bibliography 146 Proceedings of the 1996 ASME International Mechanical Engineering Congress and Exposition, Vol. 58, pp. 291-297. [64] Wang, F.-C. Wright, P.K., 1998, “Open Architecture Controllers for Machine Tools, Part 2: A Real Time Quintic Spline Interpolator”, Journal of Manufacturing Science and Engineering, Vol. 120, No. 2, pp. 425-432. [65] Xu, H.-Y., Dai, J., Tam, H.-Y., Zhou, Y., 2003, “Angular Feedrate Interpolation for Three- Dimensional Implicit Curves”, International Journal of Production Research, Vol. 41, No. 15, pp. 3461-3478. [66] Xu, H.-Y., Tam, H.-Y., Zhou, Z., Tse, P.W., 2001, “Variable Feedrate CNC Interpolation for Planar Implicit Curves”, International Journal of Advanced Manufacturing Technology, Vol. 18, No. 11, pp. 794-800. [67] Yeh, S.-S., Hsu, P.-L., 1999, “The Speed-Controlled Interpolator for Machining Parametric Curves”, Comptuer-Aided Design, Vol. 31, Iss. 5, pp. 349-357. [68] Yeh, S.-S., Hsu, P.-L., 2001, “Adaptive-Feedrate Interpolation for Parametric Curves with a Confined Chord Error”, Computer-Aided Design, Vol. 34, No. 3, pp. 229-237. [69] Zhang, Q.G., Greenway, R.B., 1998, “Development and Implementation of a NURBS Curve Motion Interpolation”, Robotics and Computer-Integrated Manufacturing, Vol. 14, No. 1, pp. 27-36. [70] Zhiming, X., Jincheng, C., Zhengjin, F., 2002, “Performance Evaluation of a Real-Time Interpolation Algorithm for NURBS Curves”, International Journal of Advanced Manufacturing Technology, Vol. 20, No. 4, pp. 270-276. [71] Zhou, K., Wang, G., Jin, H., Tan, Z., 2008, “NURBS Interpolation Based On Exponential Smoothing Forecasting”, International Journal of Advanced Manufacturing Technology, Vol. 39, No. 11-12, pp. 1190-1196.
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Real time trajectory generation and interpolation
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Real time trajectory generation and interpolation Siu, Anthony 2011
pdf
Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.
Page Metadata
Item Metadata
Title | Real time trajectory generation and interpolation |
Creator |
Siu, Anthony |
Publisher | University of British Columbia |
Date Issued | 2011 |
Description | This thesis presents a continuous tool motion trajectory generation algorithm for high speed free form surface machining. A NURBS toolpath generation algorithm is presented to fit the discrete motion commands generated from free-form CAD-models. By using a NURBS representation of the machine part, the toolpath is interpolated continuously to direct the synchronized motion of the 5-axis CNC machine. The higher continuity of the motion trajectory allowed for tighter machining tolerances and reduced feedrate fluctuations and the undesired acceleration harmonics in the overall feed motion and in each of the motor motions. An optimal and feasible feedrate profile have been used to continuously maneuver the cutting tool with the interpolated reference tool position and tool orientation commands such that the kinematic constraints of the drives are not violated. Commonly used least squares curve fitting of discrete data points forces the curve to weave through the data points and results in a fluctuating toolpath. By making use of the defined basis function distributions of the NURBS control points, a higher smoothness fit has been achieved through a minimization on the chord error and the third derivative of the curve. The feasibility of this toolpath generation algorithm has been extended using the double spline representation to represent both the tool position and the tool orientation with minimal fitting error. The real time interpolation of the fitted NURBS toolpath has also been implemented using the multi-segment Feed Correction Polynomial. This method provides an adaptive mapping between the nonlinear relationship of the NURBS curve parameter and the curve displacement to allow for a consistent feedrate in the cutting motion. Additionally, the kinematic compatibility conditions are considered based on the inverse kinematics of the 5-axis CNC machine. The proposed algorithm ensures that an overall efficient feed constraint is placed such that none of the individual drives are overdriven. The results from experiments and simulations are presented to demonstrate the effectiveness of the developed trajectory generation algorithms. |
Genre |
Thesis/Dissertation |
Type |
Text |
Language | eng |
Date Available | 2011-07-05 |
Provider | Vancouver : University of British Columbia Library |
Rights | Attribution-NonCommercial-NoDerivatives 4.0 International |
DOI | 10.14288/1.0080691 |
URI | http://hdl.handle.net/2429/35898 |
Degree |
Master of Applied Science - MASc |
Program |
Mechanical Engineering |
Affiliation |
Applied Science, Faculty of Mechanical Engineering, Department of |
Degree Grantor | University of British Columbia |
GraduationDate | 2011-11 |
Campus |
UBCV |
Scholarly Level | Graduate |
Rights URI | http://creativecommons.org/licenses/by-nc-nd/4.0/ |
AggregatedSourceRepository | DSpace |
Download
- Media
- 24-ubc_2011_fall_siu_anthony.pdf [ 9.16MB ]
- Metadata
- JSON: 24-1.0080691.json
- JSON-LD: 24-1.0080691-ld.json
- RDF/XML (Pretty): 24-1.0080691-rdf.xml
- RDF/JSON: 24-1.0080691-rdf.json
- Turtle: 24-1.0080691-turtle.txt
- N-Triples: 24-1.0080691-rdf-ntriples.txt
- Original Record: 24-1.0080691-source.json
- Full Text
- 24-1.0080691-fulltext.txt
- Citation
- 24-1.0080691.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
data-media="{[{embed.selectedMedia}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.24.1-0080691/manifest