UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

A three-axis virtual computer numerical-controlled (CNC) system Yeung, Chi-Ho 2004

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

Item Metadata

Download

Media
831-ubc_2004-0334.pdf [ 12.49MB ]
Metadata
JSON: 831-1.0080793.json
JSON-LD: 831-1.0080793-ld.json
RDF/XML (Pretty): 831-1.0080793-rdf.xml
RDF/JSON: 831-1.0080793-rdf.json
Turtle: 831-1.0080793-turtle.txt
N-Triples: 831-1.0080793-rdf-ntriples.txt
Original Record: 831-1.0080793-source.json
Full Text
831-1.0080793-fulltext.txt
Citation
831-1.0080793.ris

Full Text

A T H R E E - A X I S V I R T U A L C O M P U T E R N U M E R I C A L - C O N T R O L L E D (CNC) S Y S T E M by CHI H O Y E U N G B.Eng. (Mechanical Engineering), University of Victoria 2001 A THESIS S U B M I T T E D IN P A R T I A L F U L F I L L M E N T O F T H E R E Q U I R E M E N T S F O R T H E D E G R E E O F M A S T E R O F A P P L I E D S C I E N C E in T H E F A C U L T Y O F G R A D U A T E S T U D I E S M E C H A N I C A L E N G I N E E R I N G We accept this thesis as conforming to the required standard T H E U N I V E R S I T Y O F BRITISH C O L U M B I A April 2004 © Chi Ho Yeung, 2004 Library Authorization In presenting this thesis in partial fulfillment of the requirements for an advanced degree at the University of British Columbia, I agree that the Library shall make it freely available for reference and study. I further agree that permission for extensive copying of this thesis for scholarly purposes may be granted by the head of my department or by his or her representatives. It is understood that copying or publication of this thesis for financial gain shall not be allowed without my written permission. Title of Thesis: A THREE-AXIS VIRTUAL COMPUTER NUMERICAL-CONTROLLED (CNC) SYSTEM CHI Ho Y £ C ( M ^ Name of Author (please print) Date (dd/mm/yy; Degree: Master of Applied Science Department of Mechanical Engineering The University of British Columbia Vancouver, BC Canada Year: 2004 Abstract The recent trend is to perform the machining operations in a comprehensive simulation envi-ronment before physical production. This thesis presents a virtual design and simulation of C N C machine tools with Cartesian drive configurations. The Virtual C N C system accepts reference toolpath generated on C A D / C A M systems in the form of industry standard Cutter-Location (CL) format. The C L file contains the cutter dimen-sions, toolpath coordinates, and travel speed in machining a particular part on a C N C machine tool. The motion commands are processed by considering the trajectory generation, control law, physical characteristics of feed drives, which describe the mathematical model of the selected C N C system. The Virtual C N C system consists of parametric modules, which can be either selected from the database or defined as a new module by the user. The trajectory generation modules include various feed profiles with low and high smooth-ness levels along the toolpath. The transfer functions of the individual physical elements in the drives, such as ball screw, gear reduction, inertia and viscous damping of the equivalent drive train, servomotor, motion sensors, and amplifiers are mathematically modeled based on the speci-fications. The non-linearities such as saturation of actuator, guideway friction, and backlash are also considered. The Virtual C N C system is furbished with experimentally proven various control laws, such as P-PI, PD, PID, Pole Placement Control (PPC), and Sliding Mode Control (SMC). The linear control laws are analytically tuned according to desired performance criteria. The non-linear S M C is tuned by developing a fuzzy logic based auto-tuning algorithm. ii A toolpath modification technique is also introduced for smoothening out the sharp corners with quintic splines whenever it is required. With this technique, the tracking performance of the machine tool is significantly improved as the feed direction changes continuously without stop-ping at the corners, resulting in less excitation to the drives. The Virtual C N C system processes the entire toolpath motion, provides a time-domain response of the entire feed drive control system by including the non-linearities, and predicts the tolerance violation locations along the toolpath. The system incorporating with auto-tuning and toolpath modification technique is experimentally verified in a 2-1/2 axis machining center. iii Table of Contents Abstract ii Table of Contents iv List of Tables ix List of Figures xii Acknowledgment xviii Nomenclature xix Chapter 1. Introduction 1 Chapter 2. Literature Review 4 2.1. Overview 4 2.2. Simulation and modeling of feed drive servo control system in CNC 5 2.3. Auto-tuning using fuzzy logic control 10 2.4. Reference toolpath modification using spline-fitting 11 Chapter 3. Virtual CNC System 14 3.1. Overview 14 3.2. Overall scheme of Virtual CNC system 15 3.3. CL file interpretation IV iv 3.4. Trajectory Generation 19 3.4.1. Distance of travel 21 3.4.2. Feed motion planning 24 3.4.2.1. Implementation of feed profiling with low smoothness level 25 3.4.2.2. Implementation of feed profiling with high smoothness level 30 3.4.3. Toolpath interpolation 39 3.4.3.1. Linear interpolation algorithm 39 3.4.3.2. Circular interpolation algorithm 40 3.5. Modeling of feed drive mechanism 45 3.5.1. Rigid body model with linear dynamics 45 3.5.2. Saturation of actuation system 48 3.5.3. Quantization error of D A C 49 3.5.4. Feedback measurement noise 51 3.5.4.1. Encoder 51 3.5.4.2. Tachometer 52 3.5.5. Disturbance torque 53 3.5.5.1. Non-linear friction characteristics 53 3.5.5.2. Cutting force disturbance 56 3.5.6. Backlash 57 3.5.7. Overall scheme of feed drive model 60 3.5.8. Identification of feed drive parameters 60 3.6. Axis tracking control 62 3.7. Real-time contouring error estimation 67 3.7.1. Region classification 68 3.7.2. Contouring error estimation corresponding to Region I and Region II 69 v 3.7.3. Contouring error estimation corresponding to Region III 70 3.8. Reconfigurable Virtual C N C 71 3.9. Simulation and experimental results 72 3.9.1. Experimental test platform 72 3.9.2. First scenario -- Feed motion planning with various smoothness levels 74 3.9.3. Second scenario — Feed drive performance against various control schemes 81 3.9.4. Third scenario -- Complex contouring test 88 Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 93 4.1. Overview 93 4.2. Hierarchical structure 95 4.2.1. Bottom layer 96 4.2.2. Intermediate layer 96 4.2.3. Upper layer 97 4.3. Criteria and assumptions 97 4.3.1. Case study -- Auto-tuning of Sliding Mode Control 97 4.3.2. System performance evaluation 98 4.3.3. Back-and-forth motion test 100 4.4. New methodology for system performance evaluation 101 4.4.1. Oscillation of control signal in frequency domain analysis 101 4.4.2. Stability margin analysis 105 4.4.3. Tracking accuracy analysis 107 4.4.4. Mapping from index of deviation to discrete performance index 108 4.5. Fuzzy logic control at upper layer 110 4.5.1. Membership functions for condition and action variables 111 vi 4.5.2. Fuzzy linguistic rules for S M C tuning 113 4.5.3. Composite fuzzy relation table 114 4.5.4. Fuzzy decision table 116 4.6. Simulation and experimental verification 118 4.6.1. Simulation setup 118 4.6.2. First scenario -- Noisy control signal 119 4.6.3. Second scenario — System response with very high stability margin 122 4.6.4. Third scenario -- Unstable system response 125 4.6.5. Experimental validation 128 Chapter 5. Reference Toolpath Modification For Cornering Motion 130 5.1. Overview 130 5.2. Quintic spline toolpath generation 132 5.2.1. Quintic spline parameterization 133 5.2.2. Quintic spline interpolation with minimum fluctuation 137 5.2.2.1. Iterative spline interpolation method 137 5.3. Development of boundary conditions for add-in quintic spline 140 5.3.1. Control knots for add-in spline toolpath 140 5.3.2. Identification of derivatives at control knots 145 5.4. Determination of feedrate along add-in quintic spline toolpath 147 5.4.1. Transition feedrate iterative searching algorithm 148 5.5. Modification of composite reference toolpath 149 5.6. Experimental Verification 151 vii Chapter 6. Conclusion 157 6.1. Conclusion 157 6.2. Future Research Directions 159 Bibliography 160 Appendix A. Example Of C L File Interpretation 167 Appendix B. Trapezoidal Acceleration Profiled Feed Motion Planning 171 Appendix C. Case Studies — Revision Of Axis Tracking Control Scheme 179 Appendix D. Initial Setup For Experimental Test Platform 184 Appendix E. Reference Kinematic Profiles For Diamond And Circle Shaped Toolpaths .187 Appendix F. Composite Fuzzy Relation Table For SMC Tuning 191 Appendix G. Reference Kinematic Profiles For Back-And-Forth Motion Test 193 viii List of Tables CHAPTERS Chapter 3. Virtual CNC System Table 3.1: Scenario 1 ~ Summary of simulation and experimental results for X-axis tracking 75 Table 3.2: Scenario 1 — Summary of simulation and experimental results for Y-axis tracking 76 Table 3.3: Scenario 1 ~ Summary of simulation and experimental results for contouring errors 76 Table 3.4: Scenario 2 ~ Summary of simulation and experimental results for X-axis tracking 82 Table 3.5: Scenario 2 — Summary of simulation and experimental results for Y-axis tracking 82 Table 3.6: Scenario 2 ~ Summary of simulation and experimental results for contouring errors 83 Table 3.7: Scenario 3 ~ Summary of simulation and experimental results for spiral contouring with command feedrate of 8000 [mm/min] 90 Table 3.8: Scenario 3 ~ Summary of simulation and experimental results for spiral contouring with command feedrate of 5000 [mm/min] 90 ix Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control Table 4.1: Constraints for back-and-forth motion test 101 Table 4.2: Mapping from index of deviation for oscillation level to discrete performance index 109 Table 4.3: Mapping from index of deviation for stability level to discrete performance index 109 Table 4.4: Mapping from index of deviation for tracking level to discrete performance index 109 Table 4.5: Context fuzzy states corresponding to discrete performance indices f o r O S C a n d P H M 110 Table 4.6: Context fuzzy states corresponding to discrete performance indices f o r T R E 110 Table 4.7: Membership functions for condition variables O S C , P H M , and T R E I l l Table 4.8: Mapping between discrete values and fuzzy states for D K S and D R H O 113 Table 4.9: Membership functions for action variables D K S and D R H O 113 Table 4.10: Knowledge-based guideline for S M C tuning 113 Table 4.11: Rule-base table for S M C tuning 114 Table 4.12: Fuzzy decision table for S M C tuning 118 Table 4.13: Summary of simulation results for three scenarios 128 Table 4.14: Summary of experimental validation for three scenarios 128 Chapter 5. Reference Toolpath Modification For Cornering Motion Table 5.1: Summary of experimental results for original and modified reference toolpath contouring tests 153 x APPENDICES Appendix D. Initial Setup For Experimental Test Platform Table D.l: Summary of feed drive parameters for experimental test platform 184 Table D.2: Summary of kinematic parameters for trajectory generation 185 Table D.3: Summary of control parameters for axis tracking control schemes 186 Appendix F. Composite Fuzzy Relation Table For SMC Tuning Table F . l : Composite Fuzzy-Relation Table - O S C to D K S 191 Table F.2: Composite Fuzzy-Relation Table -- O S C to D R H O 191 Table F.3: Composite Fuzzy-Relation Table -- P H M to D K S 191 Table F.4: Composite Fuzzy-Relation Table -- P H M to D R H O 192 Table F.5: Composite Fuzzy-Relation Table -- T R E to D K S 192 Table F.6: Composite Fuzzy-Relation Table -- T R E to D R H O 192 xi List of Figures CHAPTERS Chapter 1. Introduction Figure 1.1: Contouring errors due to the effect of servo tracking performance 1 Chapter 2. Literature Review Figure 2.1: Functional diagram of feed drive servo control system 4 Chapter 3. Virtual CNC System Figure 3.1: Overview of proposed Virtual C N C system 16 Figure 3.2: Description of feed motion direction in A P T standards 17 Figure 3.3: Overview of trajectory generation mechanism 20 Figure 3.4: Linear toolpath in Cartesian Space 21 Figure 3.5: Circular Toolpath in Cartesian ~ (a) Counter-Clockwise Rotation, (b) Clockwise Rotation 23 Figure 3.6: Mechanism of feed profiling — (a) with low smoothness level, (b) with high smoothness level 24 Figure 3.7: General kinematic profiles with low smoothness level 25 Figure 3.8: Low smoothness level: Constant Feedrate Duration ~ (a) included, (b) excluded ..28 Figure 3.9: General kinematic profiles with high smoothness level 30 Figure 3.10: Acceleration Saturation Duration--(a) included, T2 > 0, (b) excluded, T2 =0..35 Figure 3.11: Deceleration Saturation Durat ion-(a) included, T6 >0, (b) excluded, T6 =0. .36 Figure 3.12: High smoothness level: Constant Feedrate Duration -- (a) included, T4 > 0, (b) excluded, T4 =0 37 xii Figure 3.13: Path generation in circular interpolation — (a) in Cartesian space, (b) in rotation plane X'-Y' 41 Figure 3.14: Feed drive mechanism with a leadscrew drive 45 Figure 3.15: Block diagram of simplified feed drive model with rigid body dynamics 45 Figure 3.16: Saturation of actuation system 49 Figure 3.17: Quantization error — (a) block diagram of D A C Quantization, (b) uniform probability distribution function of quantization error u 50 Figure 3.18: Disturbance torque due to cutting forces and guideway friction 53 Figure 3.19: Stribeck friction curve for two lubricated metallic surfaces in contact 54 Figure 3.20: Non-linear friction dynamics model in feed drives 56 Figure 3.21: General types of backlash -- (a) linear, (b) angular 57 Figure 3.22: Classical dead-zone backlash model ~ (a) disengaged zone, (b) system engaged in positive direction, (c) system engaged in negative direction, (d) backlash plot 59 Figure 3.23: Overall scheme of feed drive dynamics model 61 Figure 3.24: General representation of axis tracking control scheme 62 Figure 3.25: Block diagram of the closed-loop feed drive control system — (a) general model, (b) revised model 64 Figure 3.26: Revised representation of axis tracking control scheme 65 Figure 3.27: Different cases for contouring error estimation 67 Figure 3.28: Contouring error estimation for Region I or II 70 Figure 3.29: F A D A L V M C 2216 -- 2-1/2 Axis C N C Vertical machining center 73 Figure 3.30: Simulations and experiments for tracking a diamond-shaped toolpath with ~ low smoothness feed profiling and P-PI control 77 Figure 3.31: Simulations and experiments for tracking a diamond-shaped toolpath with -trapezoidal acceleration feed profiling and P-PI control 78 xiii Figure 3.32: Simulations and experiments for tracking a circle-shaped toolpath with ~ low smoothness feed profiling and P-PI control 79 Figure 3.33: Simulations and experiments for tracking a circle-shaped toolpath with ~ trapezoidal acceleration feed profiling and P-PI control 80 Figure 3.34: Simulations and experiments for tracking a diamond-shaped toolpath with ~ trapezoidal acceleration feed profiling and PID control 84 Figure 3.35: Simulations and experiments for tracking a diamond-shaped toolpath with — trapezoidal acceleration feed profiling and S M C control 85 Figure 3.36: Simulations and experiments for tracking a circle-shaped toolpath with ~ trapezoidal acceleration feed profiling and PID control 86 Figure 3.37: Simulations and experiments for tracking a circle-shaped toolpath with ~ trapezoidal acceleration feed profiling and S M C control 87 Figure 3.38: Spiral part after machining 89 Figure 3.39: Results for spiral contouring with command feedrate of 8000 [mm/min] ~ (a) simulation, (b) experiment 91 Figure 3.40: Results for spiral contouring with command feedrate of 5000 [mm/min] ~ (a) simulation, (b) experiment 92 Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control Figure 4.1: Tracking and contouring performance due to poor tuning and appropriate tuning ...94 Figure 4.2: Fuzzy control architecture ~ (a) low-level direct control, (b) high-level supervisory control 95 Figure 4.3: Schematic representation of proposed hierarchical control structure 96 Figure 4.4: Tradition method for system evaluation ~ unit-step input response diagnosis test.. 99 Figure 4.5: C N C feed drive servo control system 99 Figure 4.6: Feed drive performance due to high overshoot tuning and low overshoot tuning — (a) unit-step input response, (b) back-and-forth motion response 100 xiv Figure 4.7: Influence of oscillation in control signal ~ (a) clean signal, (b) noisy signal 102 Figure 4.8: Fourier spectrum analysis in control signal ~ (a) clean signal, (b) noisy signal... 105 Figure 4.9: Nyquist curve in loop response analysis — (a) unstable system, (b) stable system 107 Figure 4.10: Evaluation of gain margin and phase margin from — (a) Nyquist curve, (b) Bode plot 107 Figure 4.11: Scenario 1) Noisy control signal — System response during auto-tuning process 120 Figure 4.12: Scenario 1) Noisy control signal ~ Summary and evolution of context values during auto-tuning process 121 Figure 4.13: Scenario 2) High stability margin — System response during auto-tuning process 123 Figure 4.14: Scenario 2) High stability margin — Summary and evolution of context values during auto-tuning process 124 Figure 4.15: Scenario 3) Unstable system — System response during auto-tuning process 126 Figure 4.16: Scenario 3) Unstable system — Summary and evolution of context values during auto-tuning process 127 Figure 4.17: Experimental validation for resulting control parameters - (a) 1st scenario, (b) 2nd scenario, (c) 3rd scenario 129 Chapter 5. Reference Toolpath Modification For Cornering Motion Figure 5.1: Contouring errors against toolpath with various cornered angles 131 Figure 5.2: Modified reference toolpath associated with small curve at corner 131 Figure 5.3: Overall scheme of quintic spline toolpath generation 132 Figure 5.4: Composite quintic spline defined by N control knots 133 Figure 5.5: Methodology for fitting spline at corner - (a) under-corner approach, (b) over-corner approach 140 xv Figure 5.6: Spline control knot RA 142 Figure 5.7: Starting control knot Rsc and ending control knot Rec for add-in spline 143 Figure 5.8: Identification of control knots Rsm and Rem — (a) mid-points M^ and Mts , (b) control knots Rsm and Rem for add-in spline 145 Figure 5.9: Identification of derivatives at control knots ~ (a) tangents and normals at Rsc , Rec , and RA , (b) tangents and normals at Rsm and Rem 147 Figure 5.10: Composite reference toolpath with multiple toolpath segments 149 Figure 5.11: General algorithm of proposed reference toolpath modification using spline fitting at corners 150 Figure 5.12: Trajectory profiles of original and modified reference cornered toolpaths 154 Figure 5.13: Experimental results for original and modified reference toolpath contouring tests — (a) zoomed view at first corner (0 l =90 [deg]), (b) zoomed view at second corner (02 =60 [deg]), (c) zoomed view at third corner (03 =30 [deg]) 155 Figure 5.14: Control signals and contouring errors during contouring tests — (a) at first corner (0{ = 90 [deg]), (b) at second corner (02 =60 [deg]), (c) at third corner (6>3 =30 [deg]) 156 xvi APPENDICES Appendix A. Example Of CL File Interpretation Figure A . l : Example of C L file created by C A T I A 167 Figure A.2: Interpretation of circular tool motion 170 Figure A.3: Toolpath geometry and motion commands interpreted from given C L file 170 Appendix B. Trapezoidal Acceleration Profiled Feed Motion Planning Figure B.l: Kinematic profiles for trapezoidal acceleration feed motion planning 171 Appendix C. Case Studies — Revision Of Axis Tracking Control Scheme Figure C . I : Overall scheme of standard P-PI control 179 Figure C.2: Revised P-PI control in discrete time domain 180 Appendix E. Reference Kinematic Profiles For Diamond And Circle Shaped Toolpaths Figure E . l : Reference trajectories for diamond-shaped toolpath with low smoothness level 187 Figure E.2: Reference trajectories for diamond-shaped toolpath with trapezoidal acceleration profiled feed motion planning 188 Figure E.3: Reference trajectories for circle-shaped toolpath with low smoothness level 189 Figure E.4: Reference trajectories for circle-shaped toolpath with trapezoidal acceleration profiled feed motion planning 190 Appendix G. Reference Kinematic Profiles For Back-And-Forth Motion Test Figure G. l : Reference axis kinematic profiles for back-and-forth motion response test 193 xvii Acknowledgment I would like to sincerely thank my research supervisor Dr. Yusuf Altintas for his support and guidance throughout my graduate studies at U B C . I am grateful for my colleagues in the Manu-facturing Automation Laboratory. They have shared their knowledge, experience, and culture with me and have thus broadened my horizons. Their assistance and presence have made my life at U B C very enjoyable. Especially, I wish to thank Dr. Kaan Erkorkmaz who helped me to get started in the laboratory and provided valuable feedback and support. Finally, I would like to thank my beloved family for their unwavering support and patience regarding my graduate study abroad. I dedicate this work to them. xviii Nomenclature A acceleration constant A c constant state matrix in continuous time domain spline coefficients for ith spline segment A nominal acceleration a(t) acceleration profile along given toolpath B viscous damping from motor bearings and guideway B c constant input matrix in continuous time domain c' crisp output corresponding to final aggregated set D deceleration constant Db backlash nominal deceleration Ds{z) 1x3 matrix corresponding to transfer function in feedback control DT(z) 1x3 matrix corresponding to transfer function in feedforward control dc shortest distance between circular arc and transition point positions of positive and negative ends of deadband for backlash F desired feedrate F- • rimt initial guess of transition feedrate F x nom nominal feedrate F L nyquist Nyquist frequency Ffhre threshold frequency value * tran transition feedrate fe ending feedrate xix fs initial feedrate /(t) feedrate profile along given toolpath Gm gain margin Gd (z) closed-loop transfer function in discrete time domain Gy (z) discrete equivalent transfer function of feed drive system H 4x4 homogeneous transformation matrix between reference frame and rotation frame H c constant input matrix in discrete time domain Hmax maximum magnitude at high frequency range Hmean magnitude mean at high frequency range 'min/max C u r r e n t l i n l i t S J total inertia reflected on motor's shaft Ji jerk limit corresponding to ith phase of movement J m a x maximum achievable jerk limit j(t) jerk profile along given toolpath Ka current amplifier gain Kd derivative gain Kt integral gain Kp proportional gain Ks feedback gain of Sliding Mode Control Kt motor torque constant L distance of travel along toolpath Z m a x maximum magnitude at low frequency range Lmean magnitude mean at low frequency range Ls total length of composite spline /;- ith spline segment length xx mid-point between Ptran and Rec mid-point between Ptran and Rsc MAe mid-point between RA and Rec MAs mid-point between RA and Rsc nb number of bits employed by D A C chip h normal vector Pc center of circular toolpath Pe ending position of tool P 1 new control parameters after fuzzy decision making Pold control parameters before fuzzy decision making Ps starting position of tool P 1 sen sensitivity factor for adjusting the sensitivity of fuzzy tuning p transition point P position vector R radius of circular toolpath Rec ending control knot of add-in spline D nem control knot of add-in spline between Rec and RA ith spline control knot B? first derivative at ith control knot with respect to u Ruu second derivative at ith control knot with respect to u Rsc starting control knot of add-in spline D •"Vsm control knot of add-in spline between Rsc and RA discrete transfer function of error regulator variance of quantization error R* variance of axis position measurement noise R~e variance of angular position measurement noise xxi rd st Sx(z) s(t) so r+l-lcoul 7 [int T x min/ max rp+l-1stat 1 stribeck Tfotal rp+l-•* vise t t variance of tachometer measurement delta control knot of add-in spline pre-defined ratio for adjusting dc leadscrew ratio scaling factor for oscillation level of control signal ith spline segment scaling factor for adjusting maximum desired geometric deviation discrete transfer function of feedback control displacement profile along given toolpath initial displacement actuation torque disturbance torque due to cutting forces coulomb friction torque disturbance torque due to cutting forces and non-linear friction effects disturbance torque due to non-linear guideway friction time duration for ith phase interpolation period total dynamic motor torque motor torque limits static friction torque non-linear friction torque due to Stribeck effect total time duration of motion viscous damping coefficient discrete transfer function of feedforward control time tangent vector xxn u spline parameter ua control signal applied to current amplifier uc command control signal generated by axis control law wmin/max control signal limits us saturation control signal u quantization error VDAC voltage range of D A C chip v direction vector of circular motion Wx, W2 weighting factors X - Y - Z original reference frame X' - Y' rotation plane X'-Y'- Z' rotation frame xa actual axis position xm measured axis position xr reference axis position xr reference axis velocity xr reference axis acceleration 3c axis position measurement noise c^' unit vector in x-direction corresponding to rotation frame y' unit vector in y-direction corresponding to rotation frame z' unit vector in z-direction corresponding to rotation frame xxiii constant state matrix in discrete time domain 0 actual angular position od angular displacement for circular toolpath measured angular position 0 angular position measurement noise (O actual angular velocity ®m measured angular velocity (Ou ultimate frequency COg gain cross-over frequency a tachometer measurement noise ^ + / - spacing between boundary lubrication and partial fluid lubrication zones 6> 2 + / - spacing between partial lubrication and partial fluid lubrication zones K phase margin A maximum desired geometric deviation tuning action obtained from fuzzy decision table As path increment ^des desired path increment Ax X-axis increment Ay Y-axis increment Az Z-axis increment A0 angular increment du D A C resolution dx linear encoder resolution 80 rotary encoder resolution Mc membership function of fuzzy output variable MD membership function of fuzzy input variable xxiv pR membership function of knowledge base P cornered angle e contouring error vector e specified part tolerance K direction sign of circular motion KP sign factor corresponding to under-corner or over-corner approach X sliding surface bandwidth of Sliding Mode Control p disturbance adaptation gain of Sliding Mode Control xxv A C R O N Y M S : A C C P Acceptable A P T Automatically Programmed Tools C A D Computer-Aided Design C A M Computer-Aided Manufacturing ccc Cross-Coupled Control ccw Counter-Clockwise direction C L Cutter Location C N C Computer Numerical Controlled C T M Continuous Tool Motion C W Clockwise direction D A C Digital-to-Analog convertor circuit D F T Discrete Fourier Transform D K S adjustment in the feedback gain Ks D R H O adjustment in the disturbance adaptation gain p E L Extremely Large F F T Fast Fourier Transform G P C Generalized Predictive Control H I O Q Highly Over-Qualified H I U N Highly Unsatisfactory L A Large L I O Q Little Over-Qualified L I U N Little Unsatisfactory L L C Lead-Lag Control M E Medium xxvi N C Numerical Controlled N L Negative Large N M Negative Medium NS Negative Small O K Okay O S C index of oscillation level of control signal in frequency domain P-PI digital position Proportional and analog velocity Proportional-Integral P H M index of phase margin in stability analysis PID Proportional-Integral-Derivative P L Positive Large P M Positive Medium PPC Pole Placement Control PS Positive Small PTP Point-To-Point S M Small S M C Sliding Mode Control T D B Toolpath Description Buffer T R E index of axis position tracking accuracy Z O H Zero-Order Hold Z R Zero xxvii Chapter 1 Introduction Enhancements in high precision, high speed, and low cost machining operations are essential for survival in the global manufacturing industries. Before the parts are machined confidently in production line, a trial-and-error cutting test is required to confirm the validation of the current process planning. The produced part is inspected for the specified part tolerance. The part is scrapped if the discrepancy between the machined part and the desired part violates the specified tolerance. In order to reduce this costly and time-consuming testing on the part, the recent trend is to shift from the experimental testing to validation on virtual platform by numerical simulation. Although C N C machine tools are considered to be accurate, they nevertheless contain machining errors originating from feed drive servos due to the limited bandwidth of drives, the system non-linearities, and the disturbances generated from cutting forces and guideway friction. The effect of the servo tracking performance on the tool position accuracy is shown in Fig. 1.1. In reality, the tool cannot follow the desired toolpath perfectly due to the tracking errors generated from each axis servo drive, resulting in geometric deviations (also called contouring errors) between the actual tool location and the desired toolpath. actual toolpath actual tool position 8 = contouring error Figure 1.1: Contouring errors due to servo tracking performance 1 Chapter I. Introduction 2 In high speed machining operations, the contouring errors originating from the feed drive ser-vos can be significant. Typically, the contouring errors are dependent on the smoothness of the reference trajectory, the physical characteristics and non-linearities of the drives, the robustness and tracking ability of the axis control law, the axis velocity derived from the command feedrate, as well as, the toolpath geometry. If a feed drive system is simplified as a second order linear sys-tem, the tracking errors in steady state are directly proportional to the reference feed speed and the damping ratio of the closed-loop servo control system, and inversely proportional to the closed-loop control bandwidth [45]. In high speed machining operations, the feed speed may reach up to 30 [m/min] (i.e. 500 [mm/sec]). The tracking errors can be up to several millimeters, resulting in significant contouring errors left on the part. In practice, the machining errors generated from the feed drive servos can be reduced by adjusting the feed speed with a trial-and-error technique. The goal of the machining processes is to increase precision and productivity while reducing cost. Therefore, machining accuracy and efficiency can be enhanced greatly if the feed drive servo per-formance of C N C machine tools can be evaluated in a virtual environment before actual machin-ing takes place. Besides the importance of predicting the feed drive servo performance, fine-tuning of axis controllers is another key issue to improve the performance of the drives at the controller design stage. In general, the axis control laws are either analytically designed according to the desired performance criteria, or tuned with trial-and-errors until a satisfactory response is achieved. In manual tuning, selecting the appropriate control parameters is not a trivial task and is also depen-dent on expertise and experience. Poor tuning of axis controllers generates larger tracking errors at each axis, resulting in significant contouring errors. In order to tackle the problem of manual tuning, fuzzy logic control can be applied as a high-level supervisor to perform decision making for tuning the control parameters in the low-level direct control, based on the desired control objectives. Chapter 1. Introduction 3 Feed drive servo performance can also be improved by modifying the reference toolpath. Usually, the critical contouring errors are found at sharp corners where transients in the reference trajectory occur. These sudden changes in feed direction may excite the natural modes of the mechanical structure and servo control system, resulting in the degradation of the axis tracking performance, thus affecting contouring accuracy. A reference toolpath modification technique is introduced to tackle the problem in cornering motion. In this technique, the reference toolpath is modified by fitting a small curve, constrained by the part tolerance, at sharp corners (i.e. transition points). With this approach, the direction of feed motion can change continuously at the transition point and the modified toolpath becomes smoother. Excitation due to sudden changes in feed direction at the transients is diminished, resulting in better tracking and contouring performance. This thesis mainly focuses on a virtual design and simulation of a C N C system, which includes the prediction and improvement of feed drive servo performance in C N C machine tools. It is organized as follows: The review of related literature is presented in Chapter 2. The system-atic analysis and development of a comprehensive simulation platform, called Virtual C N C sys-tem, in predicting machining errors originating from the C N C feed drive servos is presented in Chapter 3. The influence of trajectory generation, actuator saturation, non-linear guideway fric-tion characteristics, measurement noise, quantization errors, backlash, and axis control laws are considered in the modeling of the Virtual C N C system. In Chapter 4, the auto-tuning of axis con-trollers using fuzzy logic hierarchical control is presented in detail. This chapter also covers a new strategy for evaluating system performance based on the evaluation of the oscillation in sys-tem response, the system stability, and the tracking accuracy of the feed drive servos. A n auto-matic reference toolpath modification by spline-fitting at sharp corners is proposed in Chapter 5. The methodologies for constructing the spline toolpath and for determining the transition feedrate along the spline are also presented in this chapter. The thesis is concluded with a summary of contributions and recommended future work in Chapter 6. Chapter 2 Literature Review 2.1. Overview The feed drive servo control system in C N C machine tools consists of three major compo-nents: machine tool feed drive mechanism, motion controller, and computer executive unit [1], The functional diagram of the feed drive servo control system is depicted in Fig. 2.1. Machine tool feed drive mechanism consists of mechanical and electrical parts. Mechanical components consist of table and nuts, ball lead screws, torque reduction gear set, and servomotors. Electrical components comprise of current limit switches, servoamplifiers, and feedback measurement devices. Computer executive unit consists of trajectory generator and command interpolator. Axis Motion Control Broad Feed Drive Mechanism To other actuated axes CNC m n m n m ! Trajectory Generator and § Command Interpolator p Figure 2.1 : Functional diagram of feed drive servo control system Fundamentally, the evaluation of the feed drive servo performance in C N C machine tools is based on these three main components of feed drive servo control system. In order to accurately predict the feed drive servo performance in a virtual environment, the analysis and modeling of these three components should be taken into account. Chapter 2. Literature Review 5 In the controller design, two fundamental approaches have been reported to determine the control parameters: analytical method and manual tuning. For analytical method, the overall closed-loop servo control system is first mathematically modeled. Then, the control parameters are computed by specifying the desired closed-loop control performance, such as damping ratios and natural frequencies for the overall system [1]. However, some control schemes cannot be solved analytically. Therefore, manual tuning is required to achieve a desired tracking perfor-mance. However, determination of control parameters is very time-consuming. Due to these rea-sons, a significant amount of work has been done in the area of controller tuning with an automatic and systematic way, in order to achieve better system performance [9,17,35,61,80,87]. Usually, significant geometric deviations are found in tracking sharp corners at high speed where acceleration and deceleration have large transients. Some work has been reported in the lit-erature to remedy this problem, such as resolving the reference path by fitting a curve at sharp corners. In this chapter, past research reported in the literature is reviewed in relation to the areas of prediction and improvement of feed drive servo control performance in C N C machine tools. In Section 2.2, a literature survey related to simulation and modeling of feed drive servo control sys-tem is presented. This is followed by a summary of research in auto-tuning methods for determin-ing control parameters, in Section 2.3. A literature review related to the reference toolpath modification using spline-fitting at corners is covered in Section 2.4. 2.2. Simulation and modeling of feed drive servo control system in CNC The ability to simulate the feed drive servo control performance of C N C machine tools in a virtual environment is an essential step towards achieving high productivity, high accuracy, and low cost in machining processes. Little work has been reported in literature concerning the simu-lation and prediction of feed drive performance in C N C machining tools. Younkin [83] pointed out that computer iterative techniques (i.e. numerical iterative methods) could be used in analyz-Chapter 2. Literature Review 6 ing and predicting the servo drive performance. In his conceptual simulation model, the non-lin-earities of backlash and stiction in the servo drives were included. He also stated that the proposed servo simulation technique could be possible to anticipate machine design problems affecting servo performance and then correcting them before the machine is built. However, the influence due to the smoothness of reference trajectories and other non-linearities such as satura-tion of actuation system, quantization error and measurement noise effects were not taken into account. L o [49] presented an approach to preview the cutter path for contour machining based on the identification of motion errors. He considered that the sources of motion errors include the mismatch of feed drives, the friction disturbances, and the geometry of reference cutter path. He proposed that the contouring errors in linear and circular motions could be mathematically expressed in a combination of these three components, where the overall transfer function of the feed drive servo control was assumed to be a second-order system. He developed an identifica-tion technique to evaluate these three basic contouring error components by comprising a series of motion tests against different shapes of reference toolpaths and feedrates. With this approach, he was able to preview the cutter path for linear and circular motions before the real run. Few publi-cations have been reported in literature emphasizing on the simulation of machining processes in a virtual environment [36,57,84,85,86]. However, none of them included the dynamic influence of feed drive servo control system into their simulation models. In order to accurately predict the feed drive performance, the major components of the feed drive servo control system in C N C machine tools should be analytically modeled. Trajectory generation plays an important role in computer control of machine tools as it describes the kine-matics of the feed drives. The smoothness of the reference trajectories affects the tracking perfor-mance of the feed drives. In practice, discontinuity in reference motion commands delivered by the trajectory generator may excite the dynamics of the feed drive system with high frequency harmonics, resulting in larger tracking errors and thus contouring errors. Boric and Cohen [11] addressed that the trajectory profiling could be generally classified into two groups: low smooth-Chapter 2. Literature Review 7 ness level and high smoothness level. Low smoothness level of trajectory profiling has constant acceleration and deceleration in the transients, where the feed drive system needs a period of time to accelerate or decelerate to achieve the desired feedrate. In this profiling, the acceleration pro-file is not continuous. High smoothness level of kinematic profiling relates to the acceleration profile that is continuous and constrained by jerk limits. They also noted that the classification of smoothness in trajectory generation could be based on the shapes of the acceleration profiles in the transient phases. Trajectory generation with high smoothness level does not only yield smoother reference trajectories which are easier to track, but also it avoids high frequency har-monics in the acceleration profile that would result in degrading the tracking and contouring accu-racy. Due to the importance of trajectory generation in predicting the feed drive performance of C N C machine tools, the modeling of feed drive kinematics should be carried out. Various trajec-tory generation approaches proposed in literature are briefly summarized. Makino and Ohde [52] used a universal cam curve for jerk-limited trajectory generation. Macfarlane and Croft [51] designed a jerk-limited trajectory generation for industrial robotic applications. They used a sine wave approximation to determine the velocity ramp from zero acceleration to non-zero accelera-tion. Chen and Tlusty [16] and Erkorkmaz and Altintas [27] used the jerk-limited trajectories with trapezoidal acceleration profiles in their feed drive development work. Later, Erkorkmaz and Altintas [30] implemented a trajectory generation with cubic acceleration profiles for the high speed milling operations. Tounsi et al. [69] developed an empirical method to identify the accel-eration and deceleration profiles of the feed drive system used in C N C machines. They also trans-formed the model into a Finite Impulse Response (FIR) Filter applied as an acceleration/ deceleration processor to determine the actual feedrate profile from the command feedrate speci-fied by the G-Code file. They stated that the proposed identification technique could be used in process planning for predicting the actual feedrate profile, especially in the transient phases. Numerous publications have dealt with the modeling and identification of the dynamics of the machine tool's feed drive system [28,60,67,68,71]. Koren [45] used a simple first order linear Chapter 2. Literature Review 8 model for identifying the dynamics of the classical feed drives. In a leadscrew driven mechanism, non-linear guideway friction become a significant factor in degrading the tracking and contouring accuracy, especially at motion reversals in sharp corners and circular arc quadrants. At such tran-sients, friction on the guideway undergoes a discontinuous change due to a zero velocity crossing that cannot be immediately compensated by the feedback controller, resulting in larger tracking errors. Armstrong et. al [5] presented an excellent survey on the physics behind the friction phe-nomenon. They pointed out that the typical friction characteristics for lubricated metallic surfaces in contact could be described by the Stribeck curve. Tomizuka [70] developed a friction model for feed drives through repetitive control experiments. He also proposed a feedforward compen-sation technique of dealing with the non-linear dominant friction effects reflected on the motor shaft. Polycarpou and Soom [59] also conducted a survey in the friction of linear contact objects operating in boundary and mixed lubrication regions. They developed a mathematical model to describe the friction as a function of sliding velocity and the thickness of the oil film formed in the contact area. Later, Mei et al. [54] also used the two-component mixed friction model, developed by Polycarpou and Soom, to describe the friction effects for a high-speed precision table. Erkork-maz and Altintas [28] presented a comprehensive method for modeling and identifying the dynamics of feed drives where the classical servo model, the noise and quantization properties, and the dominant non-linear friction effects were included into the formulation. They used the unbiased least square identification technique to estimate the inertia and viscous friction of drives. In addition, they proposed that a Kalman filter design could be used to observe the unknown dis-turbance in order to identify the guideway friction characteristics. Recently, they also considered the high-order structural dynamics of the ball screw drive mechanism, comprising of the torsional vibrations of the leadscrew and translational vibration of the table, in the modeling of feed drives as well as in the controller design [25]. Backlash is also responsible for the motion accuracy limitation of C N C machine tools. A significant amount of research has been devoted to modeling and compensation of backlash Chapter 2. Literature Review 9 effect. Kao et al. [42] reported an analytical method to observe and model the backlash behaviors on the motion accuracy of C N C lathes. They presented that the motion errors due to backlash could be classified into two categories: static and dynamic backlash errors. The static backlash error is purely generated by the clearance between two mechanical elements. The dynamics back-lash error relates to the imperfect transient response of the driving mechanism. They also devel-oped a simple compensation strategy to reduce the static and dynamic backlash errors. Nordin et al. [55] reported that the classical dead-zone backlash model gave an inadequate behavior of the dynamics when a shaft is not rigid and has internal damping. They developed a simple model based on phase plane analysis to deal with the backlash effect for elastic shaft with internal damp-ing. Selmic and Lewis [63] presented a backlash compensation in non-linear dynamic system using the dynamic inversion technique with neural networks. In their proposed compensation technique, a backlash was simply modeled using the classical dead-zone method. By inverting the backlash non-linearity in the feedforward stage, the backlash effect could be learned and com-pensated adaptively using neural networks. Estimation of geometric deviations, i.e. contouring errors, between the desired and actual toolpaths should also be studied in the development of a time-domain simulator for predicting the feed drive performance in C N C machine tools. Koren [43,44] assumed that the contouring errors for linear and circular motions could be formulated as a function of the axis tracking errors. How-ever, the estimation approach requires the path shape to be known in advance. Yeh and Hsu [81] used a similar idea to estimate the contouring error for Cross-Coupled Control (CCC) design. They defined the contouring error as a vector form based on the tracking error vector and the tan-gential and normal vectors of the path contours. However, this estimation technique is still an approximation. Erkorkmaz and Altintas [24] developed a real-time contouring error estimation method for arbitrarily shaped toolpaths. The analytical method reconstructs the desired contour using reference trajectory data, and evaluates the shortest distance between the desired contour and the actual tool position. Chapter 2. Literature Review 10 In this thesis, a numerical iterative method is used to develop a time-domain simulation model to predict the feed drive servo control performance in C N C machine tools. The mechanism for trajectory generation is taken into account. Detailed modeling of the dynamics of the feed drive system is presented. Together with the classical servo model, the dominant non-linear effects of friction, measurement noise and quantization errors, saturation of actual system, back-lash are also considered. A novel real-time contouring error estimation, proposed by Erkorkmaz and Altintas, is used to realize the geometric deviations between the actual and desired toolpaths. 2.3. Auto-tuning using fuzzy logic control In order to improve the feed drive servo control performance, the control parameters should be determined in such a way that better tracking ability of the control law can be adopted. Many researchers have reported that intelligent control could be used to tackle the auto-tuning problem in controller design [18,34,50,73]. Over the last 20 years, the use of fuzzy logic control has been widely proposed in the literature for tuning the control parameters to improve the control perfor-mance. MacFarlane and de Silva [50] conducted a research regarding the auto-tuning of PID-type control for industrial robotic applications. They presented that a theory of hierarchical and multi-level system could be applied in the control structure for robotic manipulators. They integrated a knowledge-based fuzzy logic control (at high-level layer) with conventional hard control algo-rithms (at low-level layer) to achieve the overall control objectives. They also proposed that a fuzzy tuner could be developed using a decision table approach [23]. Chan [15] also used a fuzzy logic control for tuning PI and PID feedback controllers. They introduced a concept of virtual fuzzy sets and fuzzy rule learning algorithm to provide a more accurate and effective approach for building fuzzy inference systems. Visioli [73] proposed a methodology for the tuning of PID con-troller by combining fuzzy logic and genetic algorithms. He developed a fuzzy set-point weight-ing control integrating into the existing PID controller to yield better system performance. He also presented that an optimal tuning could be obtained by shifting the peak of membership func-Chapter 2. Literature Review 11 tions using genetic algorithms. Bandyopadhyay et al. [8] also used a similar idea for tuning the parameters of the PID controllers using a fuzzy-genetic approach. In their work, the shapes of the membership functions for the fuzzy sets were changed adaptively using a genetic algorithm. Therefore, the performance of the fuzzy logic tuner could be improved by optimizing the values in the rule-bases. Wickramarachchi and de Silva [77,78,79,80] applied a knowledge-based hier-archical control system for fish processing applications. Their proposed control system had a three-layer hierarchical architecture, with the bottom layer dedicated to low-level in-loop direct control. The intermediate layer performed data processing for use in various knowledge-based modules in the top layer, where fuzzy logic control was used to supervise the control actions for the low-level control to improve the overall control performance. De Silva [22] investigated an analytic framework for knowledge-based tuning of servo controllers. He pointed out that a sub-stantial reduction in computational effort could be achieved through the application of the analyt-ical framework. Goulet [35] also used a hierarchical control structure for the design of a deployable orbiting manipulator. He addressed that the advantages of combining a crisp conven-tional control and a soft knowledge-based fuzzy logic control could be implied for controlling a space-based manipulator with flexible deployable and slewing links. In this work, a multi-level knowledge-based hierarchical structure with fuzzy logic control is applied to automatically tune the control parameters of axis controllers in order to improve the tracking and contouring accuracy of the feed drive servos. 2.4. Reference toolpath modification using spline-fitting In order to tackle the position tracking problem for sharp-cornered path, one possible solution is to resolve the reference path by fitting a curve at the corners. This technique has been used in robotics literature. Jouaneh et al. [39] addressed that sharp-cornered paths usually took more time to track since the manipulator had to stop at the corner. They resolved the sharp-cornered paths by fitting a circular arc for robotics motion applications. They further improved the methodology Chapter 2. Literature Review 12 by using a double clothoid curve, instead of a circular arc, to smooth the transition motion at cor-ners [38,40]. Kanayama and Miyake [41] also used a double clothoid curve to smooth the transi-tion motion at corners for mobile robots. This reference path resolving strategy could also be applied to improve the feed drive perfor-mance for tracking the cornered toolpaths in C N C machine tools. In practice, the cornered tool-paths could be resolved using a spline, instead of a clothoid curve. Spline trajectory generation techniques have been widely adopted in machining complex sculptured surfaces, especially for aerospace part, dies and molds. Usually, there are two research areas related to spline toolpath generation: spline parameterization and spline interpolation. A common problem with parametric interpolation techniques for spline toolpath is the difficulty in parameterizing the spline toolpath in terms of the arc length. Wang and Yang [75] tackled the problem of trajectory generation for cubic and quintic splines using chord length and near-arc length parameterization. They addressed that splines interpolated with constant chord length increment resulted in feedrate fluc-tuation due to the discrepancy between the chord length parameter and the traveled arc length increment. They introduced a near-arc length parameterization that resulted in small feedrate fluctuations compared to chord length parameterization. Later, Wang et al. [74] improved on this methodology by preserving third derivative continuity boundary conditions at the spline knots. This improved technique, called Approximately Arc-Length Parameterization with C 3 , further reduced the feedrate fluctuation and yielded smoother geometric derivatives. They also recom-mended using more points in fitting the spline at high curvatures in order to reduce the feedrate fluctuation. Erkorkmaz and Altintas [25] proposed an Optimally Arc Length Parameterization technique for quintic splines. This approach was based on optimizing the toolpath geometry to achieve minimum discrepancy between the spline chord length parameter and traveled arc length increment, resulting in less feedrate fluctuation compared to near-arc length parameterization. Besides spline parameterization, spline interpolation is also an important research area in relation to spline toolpath generation. Week et al. [76] implemented a cubic spline interpolation Chapter 2. Literature Review 1 3 where feedrates for the spline segments were adjusted based on the physical limitations of the machine tools. Shpitalni et al. [65] presented an iterative interpolation technique where a first order Taylor series approximation was applied for determining the spline parameter to obtain the desired feedrate. This approach reduced the feedrate fluctuation induced by the non-arc length parameterization. Erkorkmaz and Altintas [27] developed an iterative interpolation technique that was based on scheduling the spline parameter to yield the desired arc displacement. This method required the numerical solution of the roots of a high order polynomial corresponding to the arc increment and spline parameter increment. Later, they also proposed a feedrate correction poly-nomial technique instead of using an iterative interpolation technique to realize the desired arc displacement [25,31]. Both interpolation techniques were not only capable of eliminating the fee-drate fluctuation due to parameterization errors, but also improve the feedrate consistency with a small computational cost. In this thesis, a reference toolpath modification technique is presented in order to improve the contouring performance for cornering motion. The basic idea is to resolve the reference toolpath by fitting a small spline at the corners. Spline parameterization is based on a near-arc length parameterization technique. A n iterative interpolation approach is applied to interpolate the spline toolpath with minimal feedrate fluctuation. Chapter 3 Virtual CNC System 3.1. Overview In this chapter, the development of the Virtual C N C system for predicting the machining error originating from the feed drive servos is presented. Typically, the main reasons behind the feed drive performance degradation are: dynamic response of the feed drive system; disturbances due to non-linear friction on the guideway and cutting forces; other non-linearities such as back-lash and saturation in the actuation system; measurement noise and quantization errors; and exci-tation of structural dynamics due to discontinuity in the reference trajectories. To accurately predict the feed drive performance in a virtual environment, these sources of errors should be ana-lytically modeled. In Section 3.2, the overall scheme of the proposed Virtual C N C system is out-lined. In Section 3.3, the methodology to interpret the toolpath geometry, motion commands, and cutting conditions from Cutter Location (CL) file is briefly discussed. The mechanism for gener-ating the reference trajectories is presented in Section 3.4. In Section 3.5, the modeling of feed drive dynamics integrated with non-linear friction effect, quantization and measurement errors, system saturation, and backlash are described in detail. The method to generalize the axis track-ing control schemes in a standard notion is presented in Section 3.6. The novel algorithm to accu-rately estimate the real-time contouring errors along the desired toolpath is given in Section 3.7. In Section 3.8, the standardization of inputs and outputs in the proposed Virtual C N C system is briefly discussed. The experimental verifications of the proposed Virtual C N C system in predict-ing the machining errors originating from feed drive servos are presented in Section 3.9. 14 Chapter 3. Virtual CNC System 15 3.2. Overall scheme of Virtual CNC system During the operations of C N C machine tools, the Numerical Controlled (NC) program, describing the toolpath geometry, cutting conditions and motion commands, is fed into the com-puter executive unit in the C N C machines. Usually, the N C program is created using the commer-cial C A D / C A M application. After data processing, discrete numerical position commands for each feed drive servo are generated. The numerical commands are converted into voltage signals by the motion tracking controllers and sent to the servoamplifiers. The servomotors are con-nected to the servoamplifiers and the feed drives are powered by the servomotors attached to the axis ball screw shafts. When the drives move, position and/or velocity are measured. The feed-back measurements are sent back to the motion tracking controllers for maintaining feed and tool position. Since the operations of C N C machine tools are reviewed, it is used as the guidelines to develop a reconfigurable Virtual C N C time-domain simulator to predict the feed drive perfor-mance. The overview of the proposed Virtual C N C system is illustrated in Fig. 3.1. In the real machining practice, the part to be machined is usually designed and modeled in a C A D environ-ment. Then, the corresponding N C program is created using a C A M system. Once the N C pro-gram is ready, it is entered into the C N C executive unit for machining the part. Similar concepts are applied to the proposed Virtual C N C system. However, commercial C N C machine tools are widely developed, the same N C codes may not be equivalent to all machines. A Cutter Location (CL) file, pre-processed version of the N C program, is considered as an input of the proposed Vir-tual C N C system. It is because the C L file is written in an industry standard Automatically Pro-grammed Tools (APT) format and is completely machine-independent [46]. Chapter 3. Virtual CNC System 16 CAD Model CAD/CAM System CL File LOADTU2 FEDRAT710000.00, MMPM RAPID GOTO / 0.000, 0.000,50.000 CL File Interpretation Tool Path Geometry 4-y x - - 4 P , Axis Servo Control Closed-Loop Trajectory Generation 1 Feed Drive Servo Dynamics Axis motion Tracking ControL ^ + \ r(t), f(t), r(t) mm* Feedback Actual Axis Position Actual Tool Position with Servo Errors reference axis I commands Reference Axis Position Placement S i Feed rate ' Acceleration * s * * J e r k Kinematic Profiles along Toolpath Tracking Error and Contouring Error Estimation Figure 3.1 : Overview of proposed Virtual C N C system By interpreting the C L file, the toolpath geometry, the motion commands, and the cutting conditions can be recognized. After trajectory planning, the kinematic profiles along the toolpath are developed and discretized at the interpolation time intervals. In addition, the time stamped reference axis commands are generated by decoupling the desired vectorial motion into its axis components. These reference commands for each axis are fed into the axis servo control closed-loop system. The axis servo control closed-loop system consists of two major components: the feed drive servo dynamics and the axis tracking control law. Using numerical iterative method in time-domain series, the actual axis positions of the tool and table can be computerized at each servo sampling. By comparing the reference position commands with the actual position com-mands, the geometric deviations from the desired toolpath corresponding to the performance of the feed drive servo control system can be also realized in real-time using a novel algorithm. The Chapter 3. Virtual CNC System 17 proposed Virtual C N C system consists of four main modules: the C L file interpretation, the trajec-tory generation, the modeling of feed drive dynamics, and the axis motion control laws. 3.3. CL file interpretation In the proposed Virtual C N C system, the initial step is to interpret the desired reference tool-path, such as toolpath geometry, motion commands, and cutting conditions, from the C L file. Generally, two types of statements should be first understood in order to retrieve the information from the C L file. The first type is called geometric statement and the second type is called tool motion statement. The geometric statement is used to define the part geometry using points, lines, arcs, space curves, and surfaces. Each geometric entity is mathematically represented and stored as variables by the A P T programming system. The geometric statement is usually defined as [14]: (Geometry' s symbol) = GEOMETR Y / (Dimensions and parameters of geometry) (3.1) The tool motion statement is used to describe the motion of the tools. Typically, there are two types of tool motion commands in the A P T programming system: Point-To-Point (FTP) and con-tinuous tool motion commands (CTM) . The FTP command is used if the tool is moved to a spec-ified point from its current position. The C T M command is used when the tool is to move along the drive surface while the tooltip stays on the part surface and the tool motion is bounded by the check surface, as shown in Fig. 3.2. Figure 3.2 : Description of feed motion direction in A P T standards Chapter 3. Virtual CNC System 18 The typical statements used to represent the C T M command are given as follows: INDIRV / vector (or point) G O / TO ON PAST , drive surface, \ TO ON PAST , part surface, TO ON PAST TANG TO check surface or INDIRV / vector (or point) GOFWD GOBACK GOLFT GORGT / drive surface, TO ON PAST TANG TO check surface (3.2) where the first set of command statements is used for initializing the tool position in the startup stage. The INDIRV command is the direction vector (or point) command which is usually used to declare the tool motion in a desired direction. The second set of statements is the main command line to control the tool to move along a given path profile. The G O F W D , G O B A C K , G O L F T , and G O R G T motion codes correspond to the continuous tool motion in the forward, backward, left, or right direction relative to the preceding motion. The modifiers (TO, O N , PAST, T A N G T O ) are selected to assign the position of the tool with respect to the drive, part, and check surfaces. Once the structures and formats of the A P T standards are realized, the toolpath coordinations, the motion command types, and the cutting conditions can be interpreted from the C L file. In practice, the toolpath geometry generated by most commercial C A D / C A M systems is mainly con-structed from linear and circular segments. For simplicity, the linear and circular tool motions are considered in the proposed Virtual C N C system. A simple example, describing how to interpret the C L file, is given in Appendix A . Chapter 3. Virtual CNC System 19 3 .4 . Trajectory Generation Reference trajectory generation plays a significant role in computer control of machine tools. The purpose of trajectory generation is to move the mechanical system along a predefined path and to synchronize motion between the axes. It also generates the kinematic profiles that include the discrete information of displacement, velocity, acceleration, and even jerk for each axis. In high speed machining application, discontinuity in the reference trajectory along the toolpath results in undesirable high frequency harmonics, which ends up exciting the natural modes of the mechanical structure of the feed drive and the servo control system [27]. Consequently, the axis tracking and contouring accuracy are both degraded. In order to accurately predict the feed drive servo control performance, the mechanism of trajectory generation should be included in model-ing of Virtual C N C system. The overall scheme of trajectory generation in the Virtual C N C system is shown in Fig. 3.3. In the C L file interpretation, the starting and ending coordinates of the toolpath, the types of the tool movement, and the feedrate for each tool motion command are realized and they are stored into a buffer called the Toolpath Description Buffer (TDB). By executing the buffer block by block, the descriptions for each toolpath segment are obtained and then passed to the trajectory generation process sequentially. In the mechanism of the trajectory generation, the distance of travel for each toolpath segment is first defined. Based on the selections of feed motion planning, the kinematic profiles along the toolpath segment are developed by specifying the physical limits of the machine center (such as acceleration, deceleration, or/and jerk constraints for each axis) and the interpolation time interval. Finally, they are re-constructed into the reference trajectory commands corresponding to the active axes using the interpolation techniques. This mechanism is re-run for the next toolpath segment retrieved from the buffer until the reference axis trajecto-ries for the whole toolpath are recognized. These reference trajectories are then fed into the axis servo control system as the input commands. Typically, the mechanism of trajectory generation is divided into 3 stages: distance of travel, feed motion planning, and real-time interpolation. Chapter 3. Virtual CNC System 20 Toolpath Description Buffer f CL File I^nterpretation in)** Linear: Feedrate, Ps -*Pe Circular: Feedrate, Ps -»Pe, Radius, Center, Direction Commanded feedrate Physical limits of machine (e.g. Acceleration, Deceleration, jerk values) Interpolation Period C e I l i Tool Path Geometry (for each toolpath segment) y y w A e \ /z Distance of Travel: L I Feed Motion Planning Feed Motion Profile Type: s(t), s(t), s(t), s(t) - Low smoothness level (i.e. Trap. Vel.) - High smoothness level (e.g. Trap Ace, Cubic Acc ) Initialization & Constraint Check: - Starting and ending feedrates —> fs, f e - Interpolation period, -> T , n t Computations: Kinematic Motion Profile along the toolpath t=kTinl , k=l,2,.., N Feed Profiling and Parameters Kinematic Profile Along the toolpath s(t): travel length s(t): feedrate s(t): tangential accerelation 's(t): jerk Real-Time Interolation Algorithm Real-Time Interpolation: - Linear - Circular (CW&CCW) x(t) =f(s(t)); y(t) = g(s(t)); z(t) = h(s(t)); Computations: Interpolation and Parameterization > z(0 r(t): Axis position, Reference Axis Commands r(t): Axis velocity, r'(t): Axis acceleration Figure 3.3 : Overview of trajectory generation mechanism Chapter 3. Virtual CNC System 21 3.4.1. Distance of travel In the Virtual C N C system, the formulations of the distance to be traveled along the linear and circular toolpaths are summarized as follows: 1) Linear toolpath, In linear toolpath motion, the tool moves from one point in space to another, following a lin-ear path. This is depicted in Fig. 3.4, where Ps(xs,ys,zs) and Pe(xe,ye,ze) denote the starting and ending positions of the tool in Cartesian space, respectively. The distance of travel L along the linear toolpath is calculated as, (3.3) Figure 3.4 : Linear toolpath in Cartesian Space Chapter 3. Virtual CNC System 22 2) Circular toolpath, In circular toolpath motion, the tool is assigned to move along a defined circular arc in Carte-sian space, as shown in Fig. 3.5. The tool starts at Ps(xs,ys,zs), moves continuously on a circu-lar arc with radius R and center point at Pc(xc,yc,zc), and ends at Pe(xe,ye,ze). The total travel distance L from the starting point Ps to the ending point pe along the circular path is determined as, L*R-0d (3.4) where 0d is the angular displacement (in radian) needed to be traveled. Generally, 6d is depen-dent on the direction of rotation with respect to the rotation axis Z ' (Fig. 3.5). The direction sign of rotation, K , is determined as follows: + 1; if (fs=fe) or (rs=-re) or ,!jXV,. = ,/f X[ e N \\rsxv\\ \\rsxre]] -1; otherwise (3.5) where => rs = PCPS = (xs-xc)-i + {ys-yc)-j + (zs - z c ) - k ^>Te = pcpe =(xe-xc)-i + {ye-yc)-i + {ze-zc)-k (3.6) It is noted that fs and fe are the position vectors from Pc to Ps and from Pc to pg, respec-tively, v is the direction vector of the circular motion indicated in the C L file. Considering Eq. (3.5), the direction of rotation is defined as counter-clockwise (CCW) if K is equal to 1; other-wise, the tool rotates in clockwise direction (CW) corresponding to the rotation axis Z ' . Once the direction of rotation is realized, the angular displacement 6d is determined as, Chapter 3. Virtual CNC System 23 if (*• = +!) & (rs=re) if (K = +l) & (rs=-re) sin \\\rs ' re\\J if (*" = +!) & (rs*re) & (rs*-re) (3.7) 2 -^-s in" vii r*lnl r<?iiy ; r («•=-!) \ Rotation Axis, Z'~ \ 'tool Rotation Axis, Z (a) Y Direction Vector, v / I Direction Vector, v 7 ^ 4 (b) Figure 3.5 : Circular Toolpath in Cartesian— (a) Counter-Clockwise Rotation, (b) Clockwise Rotation Chapter 3. Virtual CNC System 24 3.4.2. Feed motion planning Once the distance of travel for the pre-specified path is defined, the kinematic profiles along the path are generated depending on the feed profiles. The feed profiles are usually classified into two major categories: feed profiling with low smoothness level, and feed profiling with high smoothness level, as shown in Fig. 3.6. Deceleration Stage (a) (b) Figure 3.6 : Mechanism of feed profiling — (a) with low smoothness level, (b) with high smoothness level [11] In feed profiling with low smoothness level, only three phases of movement are involved: acceleration, cruise (constant velocity), and deceleration. First, the tool accelerates constantly to reach a desired feed velocity. Then, the tool moves along the path at constant velocity. Finally, the tool decelerates constantly to a desired ending feed velocity. This feed motion planning is also called trapezoidal velocity trajectory planning. This type of feed profile has the theoretical infi-nite jerk peaks where the acceleration changes discontinuously. It leads to various oscillations on the acceleration and results in degrading the tracking performance of the feed drive control sys-tem. In feed profiling with high smoothness level, additional phases are included. The accelera-tion and deceleration states are broken into three sub-states: Increase, saturation, and decrease. Therefore, seven phases of movement are modeled in the mechanism of the feed profiling with high smoothness level. In the proposed Virtual C N C system, the feed motion planning based on Chapter 3. Virtual CNC System 25 these two categories are both considered and modeled. The implementation of feed profiling with low and high smoothness levels are presented in the following sub-sections. 3.4.2.1. Implementation of feed profiling with low smoothness level The kinematic profiles with low smoothness level are illustrated in Fig. 3.7 [1]. For motion along the path coordinates, the velocity profile has trapezoidal shape with pre-specified slopes and the displacement profile is parabolic. Assuming that the acceleration profile is known, the displacement profile s(t) and velocity profile /(?) are obtained by integrating the acceleration profile a(t) with respect to time as, t t f(t) = s(t) = f(ti)+ja(T)-dT s(t) = s(ti)+ \f(T)-dt (3. 8 ) Phase region: (D Constant Acceleration ©Constant Feedrate ©Constant Deceleration Figure 3.7 : General kinematic profiles with low smoothness level Chapter 3. Virtual CNC System 26 (A) Expression of kinematic profiles The equations corresponding to the acceleration, velocity, and displacement profiles are t expressed as follows, (i) Acceleration profile a(t) = A, 0 < t < , A: acceleration limit ( +ve) 0, tx<t<t2, [D, t2 <• t < t3, D: deceleration limit (-ve) (3.9) where tt denotes the time boundary of ith movement phase. A and D are the positive constant acceleration and negative constant deceleration, respectively. (ii) Velocity profile f(.t) = fs+A-t, 0<t<tu fie=fs+ATx F, h<t<t2, f2e=F = fle [f2e+D-t, t2<t<t3, f3e = f2e + DT3=fe (3.10) where f s , F , and fe denote the initial, desired, and ending feedrates, respectively. The sym-bols fie and 7} correspond to the ending feedrate and the time duration of the ith phase, respec-tively. (iii) Displacement profile s(t) = s0+fst + ^ At\ 0<f<*,, sle=s0 + fsT1+±ATl2 sle + Ft, tx<t<t2, s2e=sle + FT2 (3.11) ^e + fiJ + ^ Dt2, t2<>t<tz, s3e=s2e+f2eT3+^DT32=s0 + L Chapter 3. Virtual CNC System 27 Therefore, I = / J , +^ATi2 + FT2 + FT3+±DT32 (3.12) where s0 and L denote the initial displacement and distance of travel, respectively. sie is the displacement reached at the end of the ith phase. By solving the equations of the above kinematic profiles, the duration of each phase 7} can be expressed in terms of the input variables as, F-fs L-J 1_ 2A 2D F2 + ( f 2 f 2 \ V 2A 2D j fe'F _ Je D (3.13) (B) Compatibility conditions Before developing the kinematic profiles along the path, the conditions of the desired fee-drate, acceleration and deceleration limits should be first checked in order to ensure that the kine-matic profiles are compatible. If compatibility checks are violated, modifications should be achieved. The compatibility conditions for the feed profile with low smoothness level are sum-marized as follows: (i) Sign correction The correct signs of acceleration and deceleration can be determined from the feedrate condi-tions. A = sign(F-fs)-\A\ & D = sign(fe - F) ^  (3.14) A negative value of acceleration limit A means that deceleration occurs instead of acceleration at the beginning of motion. On the contrary, acceleration is required instead of deceleration at the ending of motion if a positive value of deceleration limit D is obtained. Chapter 3. Virtual CNC System 28 (ii) Constant feedrate duration The time duration T2 of the second phase (with constant feedrate) is ensured not to be nega-tive. By substituting the known inputs into the expression of the time duration T2 given in Eq. (3.13), the constant feedrate duration T2 is verified. If this condition does not hold, then the time duration T2 is set to zero and the desired feedrate should be reduced to the achievable value, F', by re-solving the following equation (Fig. 3.8): Set T2 = 0, i.e. T2=0 = — • 2 F L — 1 1 2A 2D F'2 + f f 2A 2D (3.15) i.e. F where a = ,_-P + 4P2-4CCY 2a (_L-_L\ ^=o. Y -\2A 2D) f r2 /• 2 A J s _|_ J e v 2A 2D j -L (3.16) time Figure 3.8 : Low smoothness level: Constant Feedrate Duration — (a) included, (b) excluded (C) Motion duration The time duration of motion corresponding to each phase should be verified as well. Recall Eq . (3.13), the time durations for each phase (Tx, T2, T 3 ) are determined by substituting the updated feedrate, acceleration and deceleration limits. Therefore, the total duration of motion, Ttotai' required to travel the distance L is computed as follows: Tlolal=T,+T2+T3 (3.17) Chapter 3. Virtual CNC System 29 Since the total time duration of motion Ttotal must be equal to an integer multiple of the interpo-lation period 7] n t , the time durations 7], T2 , T3, and Ttotal should be re-adjusted to, ^total ~ ^total X i^nt (3.18) fr where Ntolal=ceil T total V i^nt J (T! total T V total J x r . where / = 1,2,3 (3.19) As the new duration of motion for each phase are derived, the desired feedrate, acceleration and deceleration limits should be updated in order to realize the correct duration of motion. The nominal feedrate Fnom can be expressed in terms of the new time durations (T{ ) for each phase, the initial and ending feedrates ( fs, fe ), as well as the distance of travel ( L ). F =2'L-f*'Ti'-f<'Ti (320) The acceleration and deceleration limits are then modified with respect to the new nominal fee-drate as follows, F -f f-F A — nom J s r\ _ J e nom (3 21) ^iom .j,/ ' nom ,w After resolving the nominal values of the desired feedrate, acceleration and deceleration limits, the kinematic profiles along the path can be generated using the expressions of kinematic profiles given in Eq . (3.9), (3.10) and (3.11). Chapter 3. Virtual CNC System 30 3.4.2.2. Implementation of feed profiling with high smoothness level The kinematic profiles with high smoothness level are illustrated in Fig. 3.9. For motion along the path, the velocity profile is not linear. The acceleration profile is continuous and is con-strained by the finite jerk values. The general methodology for developing the kinematic profiles with high smoothness level is presented as follows: Phase region: (T) A c c e l e r a t i o n Increase ©Acceleration Saturation ©Acceleration Decrease (3) Constant Feedrate ©Deceleration Increase ©Deceleration Saturation ©Deceleration Decrease Figure 3.9 : General kinematic profiles with high smoothness level Chapter 3. Virtual CNC System 31 (A) Expression of kinematic profiles Assuming that the jerk profile is known, the displacement, velocity, and acceleration profiles can be obtained by integrating the jerk profile with respect to time: a(t) = s(t) = a(ti)+ \j{t)-dt 'i t f(t) = s(t) = f(ti)+ja(T)-dT t S(t) = s(ti)+ \f(T)-dT (i) Jerk profile For example, the jerk profile is given as follows, (3.22) (3.23) j i 00, 0 < t < tx, Phase (1): Acceleration increase 0, tl<t<t2, Phase(2): Acceleration saturation j2(t), t2<t<t3, Phase(3): Acceleration decrease 0, t3 < t < t4, Phase (4): Constant feedrate j5(t), t4<t<t5, Phase(5): Deceleration increase 0, t5 < t < t6, Phase(6): Deceleration saturation j7(t), t6<t<t7, Phase(7): Deceleration decrease where the function jt(t) denotes the description of the jerk profile for the ith phase of motion. It should be ensured that jt(t) can be expressed in terms of the finite jerk limit, , corresponding to the ith phase of movement. Chapter 3. Virtual CNC System 32 (ii) Acceleration profile Integrating Eq. (3.23) with respect to time yields the tangential acceleration profile as, a i (0= \ji(r)-dT, 0<t<tlt ale = jjl(T)-dr = A a(t) = A, tx<t<t2, a2e=A (3.24) a3(t) = a2e+jj3(r)-dr, t2<t<t3, a3e=a2e+jj3(T)-dr = 0 h h 0, t3<t<t4, a4e-a3e=0 t h a5 (t) = a4e + | ; 5 (r) -dr, t4<t<t5, a5e = a4e + Jy5 (r) -dr = D D, h<t<t6, a6e=D t . h a7(t) = a6e+ jj7(T)-dT, t6<t<t7, ale=a6e+ jj7(r)-dT = 0 '6 '6 where the function at(t) denotes the expressions of acceleration profile for the 1st, 3rd, 5th, and 7th phases of movement. (iii) Velocity profile Similarly, integrating the acceleration profile with respect to time gives the velocity profile: fi(t) = fs + \a1(T)-dT, 0<t<tlt fie=fs + \aiW-dT o o fle+A-t, h<t<t2, f2e=fle + A-T2 t h hit) = f2e+\a3(T)-dT, t2<t<t3, f3e = f2e+\a3(T)-dt=F t2 h f(t) = \F, t3<t<t4, f4e = f3e = F (3-25) t '5 / 5(0 = /4*+ J«5(*0 U<t<t5, f5e = Ue+\a5(T)-dT f5e+D-t, t5<t<t6, f6e=f5e+D-T6 Mt) = f6e+ ja7(T)-dT, t6<t<t7, fle=f6e+)a7(T)-dT = fe '6 l6 Chapter 3. Virtual CNC System 33 where the function f(t) denotes the description of the velocity profile for the ith phase of motion. (iv) Displacement profile The expressions of the travel distance can be obtained by integrating the velocity profile with respect to time, resulting in, *i(0 = Jo + \f\ir)-dr, 0<t<tlt sle =sQ + jf^-dr o o he+fie-t + -A-t2, h<t<t2, s2e=sle+fle-T2+±-A-T22 ^ 2 s3(0 = S2e+ \f2(T)-dT, t2<t<t2, S2e=S2e+ \f3(t)-dt S(t)- ^e+F-t, (3.26) t3<t<t4, s4e=s3e + F-T4 t h s5(t) = s4e + Jf5(T)-dr, t4<t<t5, s5e = s4e + J / 5(r)• dr S5e+f5e-t + \D-t2, t5<t<t6, S6e = S5e + f5g-T6 +^D-T2 ' h S7(t) = S6e+ jf7(T)-dT, t6<t<t7, Sle=S6e+ $f1(T)-dT = SQ+L Similarly, the function st(t) denotes the expressions of the displacement profile along the path corresponding to the ith phase of motion. It is noted that sie , fie , and aie represent the displace-ment, velocity, and tangential acceleration reached at the end of the ith phase, respectively. (v) Time duration of motion The time duration for the ith phase 7] can be expressed in terms of the input variables by solving the expressions of the given kinematic profiles. For example, the expression of 7] required for the acceleration increase phase can be obtained by realizing the corresponding boundary condition found in the acceleration profile. Similarly, the time duration T3 can be Chapter 3. Virtual CNC System 34 solved by considering the boundary condition for acceleration corresponding to the 3rd phase (i.e. acceleration decrease phase). In acceleration saturation, T2 can be achieved by solving the boundary conditions in the acceleration and velocity profiles corresponding to the 1st, 2nd, and 3rd phases of movement. In the deceleration stage, the expressions of the time durations T5, T6 , and T7 relative to the phases of deceleration increase, deceleration saturation, and deceleration decrease, respectively, can be obtained using a similar approach. In the constant feedrate stage, the time duration T4 can also be formulated by solving the boundary conditions of displacement, velocity, and acceleration profiles, consecutively. Therefore, the time durations for each phase can be defined as follows, where the function denotes the expressions of time duration required for the ith phase of motion. (B) Compatibility conditions The conditions of the desired feedrate, acceleration, deceleration, and jerk limits should first be checked in order to ensure the compatibility of the desired kinematic profiles. The compatibil-ity conditions of the feed profiles with high smoothness level are summarized as follows: T, =/*,(/,, A) 0<f<f! T2=h2(Jl,J3,A,F,fs) h<t<t2 T3=h3(J3,A) t2<t<t3 T4=h4(J1,J3,J5,J1,A,D,F,fs,fe,L) t3<t<t4 r 5 =/i5(7 5 ,D) t4<t<t5 T^htiJ^J^D^JJ t5<t<t6 r 7 =/ i 7 (7 7 ,£>) t6<t<t7 (3.27) (i) Sign correction The correct signs of acceleration, deceleration, and jerk limits can be recognized from the feedrate conditions. Chapter 3. Virtual CNC System 35 A = sign(F-fs)-\A\ Ji = sign(A)-\ji\, Ji=sign(D)-\ji\, & D = sign(fe-F)-\D\ where i = l,3 where i = 5,l (3.28) (ii) Jerk condition A l l given jerk limits cannot exceed the maximum jerk, 7 m a x , that can be delivered in one interpolation period. If this condition fails, then the corresponding jerk limits should be reduced to the maximum jerk 7 m a x . 4 4 lD0 max l 71. (3.29) (iii) Acceleration condition Considering the acceleration zone, the time duration of the acceleration saturation phase (i.e. T2 ) should not be a negative value. The acceleration limit A should be reduced to an achievable value if this condition does not hold. In this case, the new acceleration limit, A', is resolved by setting T2 to be zero (Fig. 3.10): \T2 > 0, no action T2=h2(Jl,J3,A,F,f,) = -T 2 < 0, set T2 = 0, solve A again using the function h^ (3.30) c o CB L_ 0 <D O O < A \ time (a) Figure 3.10 : Acceleration Saturation Duration - (a) included, T2 >0, (b) excluded, T2 =0 Chapter 3. Virtual CNC System 36 (iv) Deceleration condition Similarly, the time duration of the deceleration saturation phase (i.e. T6 ) should be a non-negative value if a deceleration zone exists in the motion. If this condition does not hold, the deceleration limit D is then reduced to its maximum possible value. Considering that T6 is set -to zero, the new deceleration limit, D', is realized (Fig. 3.11). r 6 = / z 6 ( 7 5 , 7 7 , D , F , / J : IT6 > 0, no action | T 6 < 0, set T6 = 0, solve D again using the function \ (3.31) c o a> a> o o < s T 1 D , (a) o o < time D' (b) Figure 3.11 : Deceleration Saturation Duration — (a) included, T6 > 0, (b) excluded, T6 = 0 (v) Constant feedrate duration One of the important compatibility conditions is to check the existence of the constant veloc-ity phase. The time duration T4 corresponding to the constant velocity stage should be ensured to not be a negative value. By substituting the known inputs into the expression of the time duration 7*4 > T4 can be obtained. If T4 is negative, the desired feedrate should be reduced to the maxi-mum possible value, F', by assigning J4 to be zero (Fig. 3.12). [T, > 0, no action T^h^J^J^J.J^A^FJsJ^Q^l* . . (3.32) IT 4 < 0, set T4 = 0, solve F again using hA Chapter 3. Virtual CNC System 37 s F i 1 1 © ! © < & © time \ ® '© ©, ® time Feedrate ® © 1 r (a) (b) Figure 3.12 : High smoothness level: Constant Feedrate Duration — (a) included, T4 >0, (b) excluded, r 4 = 0 If the expression of the desired feedrate has a higher order, then it can be solved iteratively ! using Newton-Raphson's algorithm] The system is considered to be fully compatible when all of these conditions are verified and accepted. If any of them requires an adjustment, then the depen-dent conditions should be checked again. (C) Motion duration After these compatibility conditions are checked, the last step is to verify the time duration of motion corresponding to each phase. Recall Eq. (3.27), the time durations 7} for the ith phase (where i = 1 to 7) are determined by substituting the updated feedrate, acceleration, deceleration, and jerk limits. The total duration of motion Ttotal is then obtained by superposing the time dura-tions required for each phase as: 1=1 (3.33) The total time duration of motion Tlotal must be ensured to be equal to an integer multiple, Ntotai, of the interpolation period Tint. By considering this assumption, the total time duration should be updated as follows, 7" = N xT 1 total l y total int where Nlotal = ceil (3.34) total V i^nt J Chapter 3. Virtual CNC System 38 Once the new value of total time duration, T'total, is realized, the duration of each phase is then readjusted as, T'= T' total T V total J XT: where / = 1,2,....,7 (3.35) Since the new duration of motion for each phase, T[ , are defined, the desired feedrate, accelera-tion, deceleration, and jerk limits should be modified in order to yield the correct duration of motion. By re-organizing the expressions of time durations given in E q . (3.27), the nominal fee-drate, F n o m , can be defined in terms of the new time durations for each phase, the initial and end-ing feedrates, and the distance of travel: Fnom = Function^', T2\ %, T'A, T'5,7/6', 7,', / , , / , , L) (3.36) The expression of Fnom can be solved using Newton-Raphson's iterative algorithm with the initial guess of the original desired feedrate F . After the new nominal feedrate is obtained, the kinematic parameters (such as acceleration, deceleration, and jerk limits) are re-adjusted corre-sponding to the new nominal feedrate and the updated phase time durations. By considering the compatibility and parameter modifications, the kinematic profiles along the path with high smoothness level are constructed and discretized at the interpolation period. 7 1=1 7 i(0 = / (0 = E/i ( 0 (=i 7 f (3.37) jf(f) = a(r) = £ « i W i=i 7 m^m^jiit) i=i In order to realize the general methodology for implementing the feed profiling with high smoothness level, an example is given in Appendix B . Chapter 3. Virtual CNC System 39 3.4.3. Toolpath interpolation In a C N C feed drive system, a sequence of reference axis commands are fed to the servo con-trol system for realizing the motion of the tool. Interpolation is used to generate the reference axis commands based on the kinematic profiles of the toolpath. In the proposed Virtual C N C system, the linear and circular real-time interpolations are presented in the following sub-sections. 3.4.3.1. Linear interpolation algorithm The expressions for the reference axis position trajectories corresponding to the linear inter-polation in the Cartesian coordinate system are given as follows [1]: xr(t) = xs + e s •sit) yr(t) = xs+^j^ •sit) (3.38) Z r ( t ) = Zs+^_Is. s(t) where s(t) is defined as the displacement profile along the path, which are realized through the feed motion planning. Differentiating Eq. (3.38) with respect to time yields the reference velocity profiles corresponding to the active axes: xr(t) = at L •s(t) = X e X s L •fit) yr(t) = > , < * » - V ' at L .S(t)=ye~ys L -fit) (3.39) zr(t) = at L -,t)=ze-zs _ L fit) Similarly, the reference axis acceleration profile can be obtained by differentiating the refer-ence axis velocity trajectories with respect to time. Chapter 3. Virtual CNC System 40 xr (0 = ^ 1 (xr (t)) = . m = —^——^- • „(,) 2 J>r (0 = ~2~ br (0) = • i"(0 = • fl(0 (3.40) zr (t) = - 4 (zr (0) = i £ ^ 2 - • i'(0 = • fl(0 In most cases, the reference axis jerk commands are not required for the feed drive servo control system. Therefore, the generation of the reference axis jerk profile is not included in the develop-ment of the Virtual C N C system, for simplicity. 3.4.3.2. Circular interpolation algorithm In 3-axis C N C machine tools, the tool could be moved circularly on any plane in Cartesian space. In order to interpolate the circular toolpath in a proper manner, a rotation frame (named X'-Y'-Z') corresponding to the circular motion should first be constructed, as shown in Fig. 3.13. It is noted that the origin of the rotation frame is always located at the center point of the desired circular path. In most circumstances, the unit vector in z-direction corresponding to the rotation frame, z , is obtained by taking the cross product between the position vectors fs and re . If the position vectors rs and re are parallel to each other, then z should be defined by tak-ing the cross product between the unit vectors f. and v : —/ z : r xv J -n = ^ - i + o -j + o z - k ; if (rs=re) or (rs=-re) rsxv\ T X Y — — — = 0 X ' i + o y • j + o z *k; otherwise (3.41) r s X r e The unit vector of the x-axis in the rotation frame, x , is simply assumed to be equal to the nor-malized vector of p • ' s x=Y^-r{=mx-i + m -} + mz-k (3.42) Chapter 3. Virtual CNC System 41 Based on this assumption, the tool always starts to rotate from the x-axis relative to the rotation frame X'-Y'-Z'. Furthermore, the unit vector of the y-axis corresponding to the rotation frame ( y ) is defined by taking the cross product between the unit vectors of z and x : —/ Z X X . . . y = -/ -/ =nx-i + n -j + nz-k Z XX (3.43) Therefore, the rotation frame X -Y -Z can be described in a matrix form as [62], rotation frame X'-Y'-Z' = R ( = my ny oy mz nz °ZJ (3.44) 3x3 Once the rotation frame is defined, the desired circular toolpath is first interpolated with respect to the rotation frame, and then transformed back to the original Cartesian space. Desired circular path (b) Figure 3.13 : Path generation in circular interpolation ~ (a) in Cartesian space, (b) in rotation plane X'-Y' Chapter 3. Virtual CNC System 42 In circular interpolation, the desired circular toolpath always lies on the X'-Y' plane corre-sponding to the rotation frame X ' - Y ' - Z ' . The reference axis position commands relative to the rotation frame for the circular arc are interpolated as follows, x'r (t) = R • COS(K -0(t)) = R- cos y'r (t) = R- sin(*- • 0(f)) = R • sin Zr(t) = 0 f 1 ^ K S(t) v R 1 ( 1 ^ K s(t) ' x'r(s) y'r(s) (3.45) As~RA0 -> 0(t) s(t) R (3.46) where K is the directional sign of motion defined in Eq. (3.5). The path and angular increments are labeled as As and A0 , respectively, as shown in Fig. 3.13b. Since the time stamped axis position commands (x'r(t), y'r(t), z'r{t)) correspond to the rotation frame, the homogeneous transformation is applied to obtain the reference axis position commands, xr(t), yr(t), and zr (t), with respect to the original reference frame X - Y-Z [62]. P0=H.P' Therefore, xr(t) 'Kit) yr(f) < ^ my ny oy yc y'At) Zr{t) mz nz °z ZC Kit) 1 0 0 0 l 4x4 l xr(t) = mx •xrit) + nx •yr(f)+ xc yr0) = my •xrit) + ny •y'r(0 + yc Zr{t) = mz x'rit) + nz •yr(t) + zc (3.47) (3.48) as zr(t) = 0 Chapter 3. Virtual CNC System 43 where H denotes a 4 x 4 homogeneous transformation matrix between the reference frame and the rotation frame. JC C , yc , and zc correspond to the center coordinates of the circular path in Cartesian space. They also describe the displacement of translation from the reference frame to the rotation frame in the X , Y, and Z directions, respectively. The reference velocity profiles cor-responding to the active axes are obtained by differentiating the expressions of the reference axis positions with respect to time: xr(t) = mx~xr(t) + nx~y'r(t) at at yr(t) = my~xr(0 + ny ~y'r(t) (3.49) at at zr(t) = mz ~x'r{t) + nz ~y'r(t) at at The derivatives in Eq. (3.49) can be expressed using the chain rule, —x' (t) =—x' is) x—s(t) =—x' (s) xs(t) dt r ds ' dt ds r (3.50) 4 y'r o=-J- y'r (*)x 4 s ^ = T" y'r ( j ) x w) dt ds dt ds Similarly, the reference axis acceleration profiles for circular path are interpolated by differ-entiating the reference axis velocity trajectories with respect to time: d2 d2 xr (t) = mx- — (xr (t))+nx— {y'r (f)) dr dt 2 2 yr(t) = my .^(x'r(t))+ny ~(y'r{f)) (3-51) dt dt d2 d2 zr(t) = mz —-{xr(tj)+nz —Ayr{tj) dt2 dt2 Chapter 3. Virtual CNC System 44 where (again using the chain rule), ,2 . d' -{xr(t)) =—xr(s)x—s(t) + dr ds dr dt sit) ^ d2 x — x (s) ds 2 =—xr (s) x jf(f) + {mf *^x'r (s) ds ds' -{yr{t))=^-yr(s)x^s(t)4^-s(t) d r ds dr \dt 2 rf2 ds' y'As) d d2 =—y'r (s) x s(t) + (s(t))2 x—-y'r(s) ds ds1 (3.52) It is noted that the reference velocity and acceleration trajectories for each axis can be simply estimated from the reference position commands using the Euler technique: r(k)-r(k-\) r(k) = -r{k) = x in t r(k)-r(k-\) 'int where r = xr,yr,zr (3.53) Chapter 3. Virtual CNC System 45 3.5. Modeling of feed drive mechanism After trajectory generation, the reference axis trajectories for the whole toolpath is given as an input to the axis servo control system. The feed drive servo control system consists of two major components: the feed drive mechanism and the axis control law. The objective in model-ing the axis feed drive is to get a simple but fairly accurate model used to predict the performance of the feed drive servo control system in the C N C machine tools. Together with the classical feed drive servo, the saturation of actuation system, the measurement noise and quantization proper-ties, the dominant non-linear friction effects in the guideways, leadscrews and bearings, and the effect of backlash are also considered in the feed drive modeling. The modeling of these compo-nents is presented in the following sub-sections. 3.5.1. Rigid body model with linear dynamics The classical feed drive servo mechanism is assumed to be a rigid body model with linear dynamics [45], as shown in Fig. 3.14 and 3.15. From controller. To controller I Control I Signal i Workpiece [-" | 1 Encoder/ Motor Coupling | - Machine Table ~H ' Sensor Spindle Amplifier L Motor Current T Lead Screw preloaded Nut Feedback measurements Figure 3.14 : Feed drive mechanism with a leadscrew drive Current Amplifier K a i K t Control + Disturbance Torque - 1 CO 1 e | T Js+B s r g Input Actual Position Motor Gain Inertia and Viscous Damping Figure 3.15 : Block diagram of simplified feed drive model with rigid body dynamics Chapter 3. Virtual CNC System 46 The feed drive mechanism consists of a current amplifier, servo-motor, coupling mechanism, leadscrew driveway, preloaded nut, machine table with workpiece, and feedback measurement devices. Considering the feed drive model with linear rigid body dynamics, the control signal, ua [Volt], generated by the axis controller is passed to the current amplifier and it is then con-verted to the motor current, i [ A ] , through the current amplifier gain, ^ [ A / V o l t ] . In the motor armature, the motor torque, Tm [N • m] , is produced, which is linearly proportional to the motor current with the motor torque constant, K, [N • m / A ] . This dynamic torque is used to compen-sate: Accelerating the total inertia reflected on the motor's shaft (J [kg-m 2 ] ) , viscous damping from the motor bearings and guideway ( B [kg • m 2/s]), and disturbance torque due to the cutting forces and non-linear friction effects (Td [N • m]). The equations corresponding to the total dynamic motor torque Tm in both time and Laplace domains are given as follows, In time-domain, Tm(') = • / • + B• co(t) + Td(t) ( 3 . 5 4 ) Tm(s) = J-s-OJ(s) + B-(0(s) + Td(s) Ins-domain, 1 r -, J s + B (3.55) In return, the angular velocity of the motor shaft, co [rad/sec], is determined, and then trans-ferred to the angular position, #[rad], through its integral. Finally, the actual axis position, xl [mm], is obtained from the angular position with the leadscrew ratio, rg [mm/rad]. If there are any gear ratios in the transmission train from the motor shaft to axis position, these effect should be included into the term rg. For linear motor driven feed drives, J and B are correlated to the transitional axis mass and viscous damping respectively, where the leadscrew ratio rg is unity. Taking the Laplace transforms, the angular velocity y^(^ ) and axis position xt (s) are calcu-lated in terms of the control signal ua(s) and the disturbance torque Td(s) as, J s + B Chapter 3. Virtual CNC System 47 re re 1 X[(s) = — -co(s) = — -s s J-s + B where the leadscrew ratio r is determined as follows, [KtKa-ua(s)-Td(s)] (3.57) 2-n h = leadscrew pitch length [mm] Eq. (3.56) and (3.57) can also be formulated in a standard state space notation: (3.58) dco(t) B . . KaKt . . 1 _ . . —^- = ---a)(t) + ^-L-ua(t)---Td(t) at J J J dt s (3.59) i-e X(t) = Ac-X(t) + B -Uc(t) (3.60) where x c00 = Uc(t) = A c = \co(t)] U(0J f»«(0l \Td(t)\ 0 J h 0 B c = K a K t J 0 2x2 J 0. (3.61) 2x2 where Xc{t) and Uc(t) denote the state output vector and the input vector respectively. The above state space equation can be rewritten as the discrete equivalent solution with a zero-order hold (ZOH) at the control loop sampling period Ts [56]: Xc (k + l) = <DC (Ts) • Xc (k) + H c (T 5 )-Uc(k) (3.62) Chapter 3. Virtual CNC System 48 Xc(k) = coik) X[(k) Ucik) = uaik) Tdik) (3.63) where { <S>ciTs) = e HC(TS)= ]eA<'-dt B c yo J The constant matrix Oc(Ts) can be solved using a Taylor series approximation [1] when the sampling interval Ts is small enough: 3.5.2. Saturation of actuation system The control signal generated by the motion controller is usually bounded by the saturation limits. In certain cases, the actuation system may need more power to drive the motors in order to follow the desired tool and table positions at the programmed feedrates. However, the control sig-nal delivered to the current amplifier is limited and the saturation of the actuation system occurs. This results in degrading the tracking performance of the drives. Due to the importance of the sat-uration effect in predicting the feed drive performance, the saturation of actuation system is mod-eled as (Fig. 3.16): O ciT s) = eA°r* = [I] + [A c]• T, + i • [A c f • Ts2 (3.64) ua(k) = \ max (3.65) Chapter 3. Virtual CNC System 49 where ua and us denote the actual control signal applied to the amplifier and the desired control signal passed to the voltage limiters, respectively. umin and w m a x are constant values which cor-respond to the lower and upper saturation limits. U s [Volt] umax r U a [Volt] Current i [A] Saturation control sianal umin Applied control sianal Ampl i f ie r Voltage Saturation Figure 3.16 : Saturation of actuation system It is noted that the voltage saturation limits can also be determined by the current limits, i^^ m a x , and torque limits, T m i n / m a x , given by the servomotors: If current limits are available If torque limits are available Umi in/max min/max *min/ max v v min/max (3.66) If the voltage, current, and torque limits are all given, the smallest range of these limits are selected in order to satisfy all saturation conditions. 3.5.3. Quantization error of DAC Another factor affecting the achievable tracking accuracy is quantization error. The digital control law in the motion control board is periodically executed to generate the required digital control signal. Through a Digital-to-Analog convenor circuit (DAC) , the digital signal is then converted to the analog signal which is applied to the current amplifier of the feed drive. The quantization error of D A C , w , is assumed to be present between the control signals before and after being quantized by the D A C , which has a resolution of Su : us(k) = uc(k) + u(k) => u(k) = us(k)-uc(k) (3.67) Chapter 3. Virtual CNC System 50 where us is the desired control signal applied to the saturation limiters and uc is the command control signal generated by the motion controller. Considering that us always lies in a range of ±dul2 within the mean of uc , the quantization error results in a uniform distribution with a zero mean and bounded by -dull and + Su/2 [28]. The uniform probability distribution function of u is expressed as follows (Fig. 3.17), 1 Su ^ „ ^ du — ; — < « < + — ,~s j Su 2 2 p(u) = < 0; otherwise where the D A C resolution Su is found as, (3.68) Su = D ^ = \Volt I count] (3.69) Considering Eq . (3.69), VDAC is the voltage range of the D A C chip and nh is the number of bits employed by the D A C chip in converting a binary number to an analog signal. Reference axis commands Mot i on Contro l ler j^Uc [Volt] Commanded |control signal Uc [Volt] £1 <U DAC Quantization Saturation j control signal (a) p(u) 1 8u _5u 0 (b) u Figure 3.17 : Quantization error -- (a) block diagram of D A C Quantization, (b) uniform probability distribution function of quantization error u The quantization error is considered to have a zero mean. Therefore its variance, R~ , is computed as, Rs = E[{u - E(u)f] => as E(u) = 0 (3.70) Chapter 3. Virtual CNC System 51 Rn=E[u)2= \p(u)-u2 -du = f u2 -du (3.71) The quantization error is considered to be a random value which has a uniform distribution with zero mean and variance R~ . 3.5.4. Feedback measurement noise When the feed drive for each axis moves, its motion are measured by the sensors. The mea-sured signals are fed back to the axis motion controller for regulation purposes. In the feed drive servo control system, there are two basic feedback measurement devices: tachometer used to mea-sure velocity and encoders used to measure position feedback. Measurement noise are present in any measurement devices and should be considered in the modeling of the feed drives. 3.5.4.1. Encoder The encoder can be classified into two types: linear type and rotary type. A linear encoder is used to measure the translation motion of the table. A rotary encoder is used to measure the angu-lar position of the motor shaft. The axis position measurement noise is formulated as, where xm , xa , and JC denote the axis position measured by the encoder, the actual axis position reflected on the table or tool, and the axis position measurement noise, respectively. If a rotary encoder is used instead, Eq . (3.72) is re-written as: xm(k) = xa(k) + x(k) x{k) = xm(k)-xa(k) (3.72) 0(k) = — -xa(k) (3.73) 0m(k) = 0(k) + 0(k) => 0(k) = 0m(k)-0(k) Chapter 3. Virtual CNC System 52 where 6m , 6, and 6 correspond to the measured angular position, the actual angular position, and the angular position measurement noise, respectively. Similar to quantization error analysis, the position measurement noise is assumed to have a uniform distribution with zero mean and variance of [28], For linear encoder For rotary encoder 12 {sef (3.74) 6 12 where R~ and Rg are the variances of the axis and angular position measurement noise, respec-tively. Sx and 86 denote the resolutions corresponding to the linear encoder and rotary encoder accordingly. The encoder resolutions 5x and 86 can be computed as follows: hr For linear encoder => Sx = For rotary encoder => 86 = pitch length "p [mm] number of sensing x line density ns x m; [count] 2-n 2-n [rad] number of sensing x line density ns x m ; [count] (3.75) 3.5.4.2. Tachometer The tachometer measurement noise is defined as: Q)m{k) = Q){k) + a)(k) => co{k) = com(k)-co{k) (3-76) where com, co , and to are the measured angular velocity, the actual angular velocity, and the tachometer measurement noise, respectively. The profile of the tachometer measurement noise can be reasonably assumed to have a normal distribution with zero mean and variance of RQ . The variance of the tachometer measurement can be obtained either from the catalog or by moni-toring the noise in the tachometer signal when servomotor is powered, but the axis is at rest. It is noted that the variance of the tachometer measurement should be set to zero if the tachometer is absent in the feed drive servo system. Chapter 3. Virtual CNC System 53 3.5.5. Disturbance torque In a feed drive servo system, the disturbance torque, Td , is mainly considered as a combina-tion of two components: non-linear guideway friction, 7y , and cutting forces, Tc , reflected to the motor shaft. The external disturbance torque is expressed in s-domain (Fig. 3.18): Td(s) = Tf(s) + Tc(s) (3.77) ro 5 £ Motor ». Inertia and T^orque + w T Viscous Damping ^ Equivalent to Motor "^ "m, f Torque -f-•e o ro LL. •e o » Inertia and T Viscous Damping Figure 3.18 : Disturbance torque due to cutting forces and guideway friction 3.5.5.1. Non-linear friction characteristics The dominant non-linear axis friction reflected on the motor shaft can be classified as the typ-ical friction characteristics for the lubricated metallic surfaces in contact, which can be described by the Stribeck curve, as shown in Fig. 3.19 [5,28]. The Stribeck curve consists of four different regions: static friction zone, boundary lubrication zone, partially lubrication zone, and full fluid lubrication zone. Assuming that a tangential force is applied to the contact surfaces, the asperity junction between the surfaces is elastically deformed. If the applied force exceeds a certain threshold (named the static friction), the junction will break, causing sliding. This region is referred to as the static friction zone. At very slow velocities, a film of lubricant cannot be formed between the contact surfaces. In this case, sliding occurs between the solid boundary layers of lubricant which are trapped on the contact surfaces. This phenomenon is called the boundary lubrication. As the sliding velocity increases, more lubricant is fed into the contact area. A lubricant film is formed. Chapter 3. Virtual CNC System 54 However, the film is not thick enough to completely separate the two contact surfaces. This stage is called the partial fluid lubrication zone. In this zone, the friction force starts to reduce as the solid to solid contact area between the boundary layers decreases. After the sliding velocity reaches a certain level, a continuous fluid film is formed. In this stage, the two contact surfaces are completely separated. The viscosity of the lubricant dominates the friction force. This zone is called the full fluid lubrication. Friction force, Ff +ve Static friction ^ + ( V ) ~ - J " * l T+ve Viscous friction -ve Coulomb friction -ve Viscous friction -ve velocity thresholds / \ +ve Coulomb friction \ / +ve velocity thresholds -•Sliding Velocity, v -ve Static friction | I | Static Friction Threshold | II | Boundary Lubrication | III | Partial Fluid Lubrication | IV | Full Fluid Lubrication Figure 3.19 : Stribeck friction curve for two lubricated metallic surfaces in contact Considering the nature of the Stribeck curve, the friction force F$ can be defined as a func-tion of the sliding velocity v . The non-linear friction torque due to stribeck effect, T^eck , can be also expressed in terms of the angular velocity co . In practice, the characteristics of T^eck can be formulated analytically as follows: lstribeck\UJ> 1 stat e + 1 coul V A e ) + 1visc CO (3.78) Chapter 3. Virtual CNC System 55 ' vise T*tat and T^~t are the static friction torque and the coulomb friction torque, respectively. 7^ is the viscous damping coefficient that corresponds to B in previous expressions. &^ + / _ and (02~ are the velocity thresholds which are used to distinguish the velocity spacing between the different friction regions. & \ + / _ determines the spacing between the boundary lubrication and partial fluid lubrication zones. determines the spacing between the partial lubrication and partial fluid lubrication regions. The superscript " + / - " denotes the direction of the motion in positive or negative side. The expression for the disturbance torque due to guideway friction Tf in discrete time domain can be summarized as follows [28], 0; Uk); Uk); T+ • ± stat' 1 stat' f;tribeck(co(k))\ if {co(k) = 0)&{Ta(k) = 0) if (o>(*) = 0) & {Ta (k) >0)& (ra (*) < Ts+tat) if {co(k) = 0) & {Ta (k) <0)& (Ta (k) > T~at) if {co(k) = 0)& {Ta (k) >0)& (Ta (k) > Ts+tat) if {co(k) = 0)& {Ta (k) <0)& (Ta (k) < T~at) if {co(k)>0) if {co(k)<0) (3.79) [TsrtbeckWk)); where Ta is the actuation torque that corresponds to the remaining part of the motor torque Tm after compensating for the component of the disturbance torque due to cutting forces Tc . The actuation torque Ta is defined as, Ta(k) = Tm(k)-Tc(k) where Tm(k) = Ka-Kt -u(k) (3.80) In the first case, no friction torque is found as there is no actuation and the axis is at rest. In the second and third cases, the friction torque is assumed to be equal to the actuation torque where the actuation torque is present but is not large enough to compensate for the static friction torque. The fourth and fifth stages deal with the case that the actuation torque is larger than the static fric-tion torque but the axis is still at rest. In the last two cases, the friction torque is considered to have the friction characteristics corresponding to the stribeck effect while the axis is in motion. Chapter 3. Virtual CNC System 56 Since the effect of the viscous damping is included in the stage of modeling the feed drive with the linear rigid body dynamics, the function of the friction torque obtained from the nature of the stribeck curve should be modified by neglecting the component of the viscous damping (Fig. 3.20). Therefore, Eq . (3.78) is re-written as: f:Lck (com = T;<; • e-^'<" + T;<- . a - *-**>'-*'- > o.8i) Motor 1 m Torque -| ro U Q Q Non-Linear Friction Dynamics + 1 Js+B Inertia and Viscous Damping Angular Velocity Figure 3.20 : Non-linear friction dynamics model in feed drives 3.5.5.2. Cutting force disturbance Considering the mechanics and dynamics of the machining processes, the cutting forces are predicted based on a specified tool geometry, material cutting properties, and cutting conditions such as spindle speed, feed, depth and width of cut. The static cutting forces are dependent on the instantaneous chip area, tool geometry, and material cutting force coefficients. The chip area depends on the feed rate and the workpiece intersection boundaries. The tool geometry refers to the dimensions and properties of the cutting tool. The cutting force coefficients are constant val-ues which are used to describe the relationship between the cutting forces and the uncut chip area and contact length. It is noted that the cutting coefficients can be evaluated practically using the cutting tests [1]. Due to the complexity in predicting the cutting forces along the whole toolpath, the methodologies for predicting the cutting forces corresponding to the different machining oper-ations are not covered in this thesis and the in-depth discussions can be found in the reference [1]. Chapter 3. Virtual CNC System 57 Once the cutting forces are predicted, the axial components of the resultant cutting forces are con-verted to the disturbance torque by the leadscrew ratio. Finally, they are used as the sequence commands that are injected as an external disturbance into the corresponding axis dynamics. 3.5.6. Backlash Basically, backlash is a non-linear position-dependent error due to the existence of clearance between two mechanical elements [42]. In a feed drive servo control system, the leadscrew is connected to a motor shaft by a coupling mechanism. As the motor turns the leadscrew, the pre-loaded nut moves the table. The spacing or dead-zone between the screw and the nut is known as backlash. The non-linearity due to backlash may degrade the tracking accuracy in position motion control and should be considered in the modeling of the feed drive system. There are two types of backlash: linear and angular, as shown in Fig. 3.21. Figure 3.21 : General types of backlash — (a) linear, (b) angular where Db denotes the width of the spacing in the dead-zone. xin (6 i n ) and xout (6 0 U t ) corre-spond to the input and the output of axial (angular) displacements due to backlash, respectively. In order to incorporate the effect of the backlash into the feed drive model, the following assump-tions are made: 1) The interference between guideway friction and backlash is assumed to be negligible. 2) The effect of backlash is applied to the state of the actual axial position xa only. •in (a) (b) Chapter 3. Virtual CNC System 58 Generally, the following two conditions should hold in the modeling of the backlash effect: 1) xout (Gout) = xin (Oin )> w h e n " i n contact" 2) xou[ ( 6out ) = 0, when "no contact" In the prediction of the C N C feed drive servo performance, the actual axis position is the most important state that should be observed. Therefore, the mathematical model of the backlash is preferably designed in terms of the state of position instead of the state of velocity. In the Vir-tual C N C system, the backlash model is developed based on the classical dead-zone model which has three motion zones: disengaged zone, engaged in a positive direction, and engaged in a nega-tive direction [42]. In the case of disengaged zone, the input lies in the dead-zone area and the output remains constant. Therefore, no motion occurs (Fig. 3.22a). When the system is engaged in a positive direction, the input and output are in contact and the output starts to move in a posi-tive direction as input is increasing. The output is equal to the input minus the half of the dead-band width Db (Fig. 3.22b). In the case of engagement in a negative direction, the input is decreasing and the output is equal to the input plus the half of the deadband width Db (Fig. 3.22c). The analytical expressions for the backlash model are summarized as follows, xa(k-l); de < Xt (k) < d* case (1) xt(k)>d; case (2) => set d* x,(k) (3.82) x,(k)<d; case (3) & d~ => set d* x,(k)-Db •• xt(k) + Db & d~e xt(k) with initial setting d+ = ; and d, (3.83) Chapter 3. Virtual CNC System 59 where xa and xt are the actual output axial position due to backlash and the axial position obtained from the discrete state space equation (Eq. (3.62)), respectively, and d~ are the positions of the positive and negative ends of the deadband, respectively. The axial position xt is assumed to be located at the middle of the dead-zone as the starting point. Therefore, d* and d~ are initially set to be the plus and minus half of the width of the dead-zone Db . Figure 3.22 : Classical dead-zone backlash model ~ (a) disengaged zone, (b) system engaged in positive direction, (c) system engaged in negative direction, (d) backlash plot Chapter 3. Virtual CNC System 60 3.5.7. Overall scheme of feed drive model When the linear rigid body feed drive dynamics (Eq. (3.62) & (3.63)), the saturation of actu-ation system (Eq. (3.65)), the measurement noise and quantization properties (Eq. (3.67), (3.72), (3.73), (3.76)), the dominant non-linear friction effects (Eq. (3.79)), and the effect of backlash (Eq. (3.82)) are combined together, the feed drive system can be analytically modeled. It is noted that the inputs of the feed drive system are the control signal generated by the controller uc and the axis disturbance torque due to the cutting forces Tc . The outputs are the states of the actual angular velocity CO and the axial position xa . Although there are still several uncertainties (such as the structural flexibilities of the leadscrew drives) which are not included in this model, it is fairly sufficient to represent the classical feed drive system using the proposed modeling scheme. The overall scheme of the feed drive dynamics model is illustrated in Fig. 3.23. 3.5.8. Identification of feed drive parameters In the development of the Virtual C N C system, the axis parameters of the feed drive system are assumed to be known in advance. These feed drive parameters can either be obtained from the specification sheets of the parts given by the manufacturers, or be identified experimentally. For example, the drive dynamics such as the total inertia reflected on the motor shaft and the viscous damping can be identified experimentally using least squares parameter estimation approach [48]. The variances of the quantization error and the feedback measurement noise can be obtained from the corresponding quantization and measurement resolutions. The non-linear friction model can be developed by jogging the machine tool axes under the closed-loop control at various velocities, and monitoring the actual friction characteristics using a Kalman filter design that can be used as the disturbance observer in the feed drive identification stage [28]. The backlash in the leadscrew driven mechanism can be experimentally obtained by comparing the difference between the lead screw position measured by an encoder and the table position measured by a laser displacement sensor. Chapter 3. Virtual CNC System 61 Figure 3.23 : Overall scheme of feed drive dynamics model Chapter 3. Virtual CNC System 62 3.6. Axis tracking control In the axis servo control closed-loop, the digital control law is periodically executed at the control sampling frequency to maintain the feed speed and the tool position at the programmed rates. Typically, the control law is like an error regulator, which decides how much control volt-age should be generated by comparing the actual output measured by the feedback devices against the reference input at the same state. The tracking performance is dependent on the tracking abil-ities of the control laws used in the system. In order to accurately simulate the motion errors orig-inating from the feed drive servos, the axis tracking control scheme is assumed to be known in advance and the corresponding controller parameters are given. Since the proposed Virtual C N C system does not only focus on one particular type of control-ler scheme, the general representation of the axis tracking control laws is investigated. Typically, most types of tracking control schemes can be represented by a combination of the following three components: feedforward control, feedback control, and error regulator [7,10]. The general representation of the axis tracking control scheme is depicted in Fig. 3.24. Axis Tracking Control scheme External Disturbance 1 \ Feedforward Error Feed Drive Control P Regulator 1 u c System 1 Feedback _} x m Measurement Control Noise Effect _ i Figure 3.24 : General representation of axis tracking control scheme By neglecting the effects of measurement noise and external disturbances, the closed-loop transfer function Gd(z) of the complete feed drive control system in the discrete time domain can be written as, Chapter 3. Virtual CNC System 63 [xr (z) -Tx(z)-xa(z)- Sx(z)\ Rx(z)-GAz) = xa (z) i.e. Gcl(z) = _ Xa(z)_ Tx(z)-Rx(z)-Gf(z) (3.84) xr{z) l + Sx(z)-Rx(z)-Gf(z) The digital control law is given as, uc(z) = [Tx(z)-Rx(z)]-xr(z)-[Sx(z)-Rx(z)]-xa(z) (3.85) where xr and xa are the reference input state and the actual output state of the whole system, respectively. Tx(z), Sx(z), and Rx(z) are the discrete transfer functions of the feedforward control, feedback control, and error regulator for the corresponding axis, respectively. Gj (z) is the discrete equivalent transfer function of the feed drive system. uc is the control signal gener-ated by the control law. Furthermore, the closed-loop transfer function Gcl (z) can be rewritten as follows: GAz) = X a ( z ) _ T'x(z)-Gf{z) xr(z) \ + S'x(z)-Gf(z) & u(z) = Tx(z) • xr (z) - Sx(z) • xa (z) where T'x{z)=Tx(z)-Rx(z) & S'(z)=Sx(z)-Rx{z) (3.86) Tx(z) and S'x(z) correspond to the revised discrete transfer functions of the feedforward control Tx(z) and feedback control Sx(z) combining the error regulator term Rx(z) • Eq. (3.86) prompts that the general representation of the tracking control scheme can only be assumed to have a revised feedforward control and a revised feedback control, as shown in Fig. 3.25. Chapter 3. Virtual CNC System 64 xr(z). T x(z) Error ' Feed Drive r Regulator | System | xa(z) x r(z) 1 Feedforward Control *(Z) u c(z) G f(z) Sx(z) T x(z)R x(z) Uc(z) Feed Drive System Revised Feedforward Control G f(z) xa(z) US x (z)R x (z) Feedback Control Revised Feedback | Control (a) (b) Figure 3.25 : Block diagram of the closed-loop feed drive control system — (a) general model, (b) revised model Fig. 3.25b shows that the inputs of the axis tracking control scheme are the reference axis commands and the actual axis motion measured by the feedback devices. The output of the con-trol scheme is the control signal. In order to increase the flexibility of the Virtual C N C system in the development stage, any type of axis tracking control scheme is assumed to be integrated into the system without affecting other modules. Therefore, the modeling of the axis control law used in C N C machine is always re-constructed into two control components — the feedforward part and the feedback part, in the discrete time domain. The feedforward part takes an action corre-sponding to the reference state and the feedback part monitors the actual state coming from the closed-loop system. Usually, the axis tracking control only requires the reference and actual axis positions as the input. However, some tracking controllers also regulate the velocity or even acceleration during the motion. Therefore, the information of the reference and actual states cor-responding to the position, velocity and acceleration should be feasible as they may be required in the desired control scheme. For a more robust Virtual C N C system, the states of the measured angular velocity com and measured axis position xm are considered in the model, instead of using the actual angular velocity co and axis position xa , because of the measurement noise effects (Fig. 3.26). Chapter 3. Virtual CNC System 65 From trajectory generation From feedback measurements Reference position Reference velocity Reference acceleration, (X r , X r , X r ) Measured position Measured velocity Measured acceleration ( X m , X m , X m ) Feedforward + < Control Feedback Control Control signal Figure 3.26 : Revised representation of axis tracking control scheme Through the modeling of trajectory generation, the discrete reference commands such as the axis position xr, axis velocity xr and axis acceleration xr are derived. Therefore, this informa-tion is available in the system. On the other hand, the axis position measurement xm is obtained from the angular position measurement 6m by the leadscrew ratio rg, if the angular encoder is available, instead of linear encoder. In addition, axis velocity measurement xm is obtained by either using angular velocity measurement, if the tachometer reading is available, or by numeri-cally differentiating the axis position measurement xm . Similarly, the axis acceleration measure-ment xm is estimated by numerically differentiating the axis velocity measurement xm . The numerical differentiation is carried out using the Euler technique: Axis position measurement => x„ (k) = rg-0m (k) <- If angular encoder is used (3.87) Axis velocity measurement Tachometer is available No Tachometer Axis acceleration measurement => xm{k) = ^xm(k) xm(k)-xm(k-l) _ xm(k)-xm(k-\) (3.88) (3.89) If the axis control scheme is designed in the continuous time domain, a transformation from continuous state (s-domain) to discrete state (z-domain) is required in order to rewrite the control Chapter 3. Virtual CNC System 66 law into a feedforward part and a feedback part, in the discrete time domain. A Euler Backward Difference approximation is used for the transformation from s-domain to z-domain: s ~ • z-1 T,-z (3.90) In the Virtual C N C system, the axis tracking control law is re-constructed into the following manner: uc(z) = DT(z)-Xr(z)-Ds(z)-Xm(z) where DT(z) = [dn(z) dT2(z) dT2(z)\x3 Ds(z) = [dsl(z) dS2(z) dS2(z)]m (3.91) Xr(z) = xr(z) xr(z) xr(z) & Xm(z) = J3xl xm(z) 3x1 In the above expression, DT(z) and Ds(z) are the 1x3 matrices corresponding to the transfer functions in feedforward control and feedback control, respectively. dTi(z) and dSi(z) (i = 1,2,3) denote the elements in the feedforward and feedback transfer function matrices with respect to the reference and measured axis position, velocity, and acceleration, respectively. Xr(z) and Xm(z) are the input state vectors in the feedforward and feedback parts. Xr(z) is the reference axis command state vector and Xm(z) is the axis measurement state vector. For consistency, the reference and measurement state vectors are assumed to be derived from the axis motion only. The digital control law is then expressed at the sampling interval number k by tak-ing the inverse z~X transform, where z~l is called backward time shift operator, z±l -x(z) = x(k±i), where j =0,1,2,. (3.92) In order to realize the proposed idea used to re-construct the axis tracking control scheme in a standard notation, several case studies are provided in Appendix C . Chapter 3. Virtual CNC System 67 3.7. Real-time contouring error estimation By comparing the reference and actual axis position commands at the same time stamp, the tracking errors for each axis are observed from the feed drive simulation model. In order to eval-uate the geometric deviations between the desired and actual toolpaths (i.e. contouring error), a method to accurately estimate the contouring errors for arbitrary paths in Cartesian space is pre-sented in this section [24]. This method does not require the path geometry to be known in advance. The objective of this contouring error estimation technique is to evaluate the shortest distance between the actual tool position and the desired toolpath. B y searching the reference dis-crete commands along the toolpath, the nearest one to the actual tool position is found. This near-est reference point is used as the reference position in estimating the contouring error. The contouring error can be estimated by considering the three possible cases which the actual tool position may fall into (Fig. 3.27): Case 1) Contouring error estimation using the previous closest reference path segment R^\Ri Case 2) Contouring error estimation using the next closest reference path segment RjRi+i Case 3) Contouring error estimation using the closest reference point RtP bi-normal surface of i+l R i-i i+i normal surface of path vector Rj_]Rj / 1 normal surface of / path vector RjRj. case (1) R, i-i case (2) •i+1 case (3) Figure 3.27 : Different cases for contouring error estimation Chapter 3. Virtual CNC System 68 In Fig. 3.27, P is the actual tool position and R{ is the closest reference point to P . and Ri+l are the previous and next reference points corresponding to Rj, respectively, e denotes the contouring error vector corresponding to P . In most cases, the contouring error is estimated by calculating the shortest distance between the actual tool position and the closest ref-erence path segment, either using the previous closest reference point or using the next closest ref-erence point. In certain circumstances, the contouring error is not orthogonal to the reference path segments, and the distance between the actual tool position and the closest reference point is taken as the contouring error. 3.7.1. Region classification The three regions are bounded by the normal surfaces of the path segment vectors, and the bi-nomial surface of the angle ZR^RjRj+i. Assuming that the reference points flM(x(_1,y,_1,z,_1), /?,(*,-, y,-,z,), and R M ( x M , y i + 1 , z M ) are known, the normalized vectors of the path segments R^Rj and RiRM are written as, _ Ri-iRi = (xi - xi-i) •'+(y,- - ) • J+(z,- - ) • k ^ | | V ( J c . - - J c . - - i ) 2 + ( y , - - y M ) 2 + U/-z,-- i ) 2 ri = rxri + ryrj + rzrk ri+l = RiRi+i _ -*,-)• i + - y,-) • j + (z,-+i - Zj) • k V - xt ) 2 + (y,+i - y,- ) 2 + (z,-+i - zt f (3.93) \\RiRi+i = rxi+l ' 1 + ryi+l ' J + rzi+l ' k Furthermore, the position vector p from the closest reference point Rt to the actual tool position P(xp ,yp,zp) is defined as, p = R.p = (Xp -x.) i + (yp - y.). j + ( Z p - z . ) - k = P x i + P y • j + pz k (3.94) Chapter 3. Virtual CNC System 69 The formulations of the normal surfaces Nt and A ^ I + 1 , perpendicular to the path segment vectors r{ and ri+l respectively, are obtained as, (3.95) Nt(x,y,z) = rxi • (*-*,•) + ryi • ( y - y , ) + rzi • (z-z,) = 0 Ni+l(x, y, z) = rxM •(x-xi) + ryi+l • (y - yt) + rzM • (z - z,-) = 0 The bi-normal surface Bt of the angle Z/? ( _j/? ( /? ( + 1 is defined as follows, Bt (x, y, z) = (rxi + rxi+l)•(*-*,-) + (ryi + ryi+l) • (y - y,-) + (rzi + rzi+1) • (z - z,-) = 0 (3.96) As the bounds of the three regions can be realized using Eq. (3.95) and (3.96), the three regions corresponding to the actual tool position P(xp, yp, zp) can be determined as follows, if Z rfi+j *180° (or rt + fM * 0), then Region I <= if B{(xp,yp,zp)<0 & N i ( j c p , y / , , z / , ) < 0 Region II <= if B i ( ; t p , y p , z p ) > 0 & N i + 1 ( x p , y p , z p ) > 0 Region III <= if N ; ( x p , y p , z p ) > 0 & N i + 1 U p , y p , z p ) < 0 otherwise Region III <= if N i ( x p , y p , z p ) > 0 & N i + 1 ( x p , y p , z p ) < 0 Region II <= otherwise (3.97) The conditions listed in Eq. (3.97) cover all possibilities which could be found in classifying the region with respect to the actual tool position P . 3.7.2. Contouring error estimation corresponding to Region I and Region II If the actual tool position falls into Region I or II, the contouring error estimation can be sum-marized into the following steps (Fig. 3.28): First, projecting the position vector p onto the normalized closest path segment vector rc gives, Chapter 3. Virtual CNC System 70 Projection =>p= (rc -p)-rc= (rxcPx + r y c P y + rzcpz )• (rxci + ryj + rzck) ) <= in Region I <= in Region II where (3.98) p is the projection vector corresponding to the actual tool position and the nearest reference path segment. After the projection vector is found, the contouring error vector, e , is obtained by sub-tracting the projection p' from the position vector p . £ = £ x • i + £ • j + £ • k = p - p (3.99) Its magnitude is taken as the contouring error which corresponds to the deviation between the actual tool position P and the desired toolpath. contouring error =14= 2 2 2 + £y +£z (3.100) rr=n in Region I in Region II Figure 3.28 : Contouring error estimation for Region I or II 3.7.3. Contouring error estimation corresponding to Region III If the actual tool position falls into Region III, the contouring error can be estimated by sim-ply taking the distance between the actual position P and the closest reference point R{. ForRegionl l l => £ = ex-i + £y • } + £z-k = RtP - p - px-i + py • j + pz k II—II I 2 2 2 where => contouring error = = Jpx + py + pz (3.101) Chapter 3. Virtual CNC System 71 3.8. Reconfigurable Virtual C N C By combining the modules of C L file interpretation, trajectory generation, feed drive model, and axis control law together, the Virtual C N C system are constructed to predict the C N C feed drive performance in the discrete time-domain. In order to further improve the flexibility of the Virtual C N C system, the inputs and outputs of all modules are standardized so that each module can be interchanged independently. For example, in trajectory generation, the input is always the toolpath description buffer created by interpreting the given C L file and the outputs are the refer-ence trajectories for the active axes. In the feed drive servo control closed-loop system, the inputs of the axis tracking control law are the reference axis commands generated by trajectory genera-tion and the measured axis commands obtained from the feed drive dynamics model. The control law's output is always the control signal which is also the input corresponding to the feed drive dynamics model. In the Virtual C N C system, all modules are pre-defined and stored in the corre-sponding libraries. According to the standardization of the input and output for each module, the Virtual C N C system is easily reconfigured by interchanging the current module (such as the feed profiles in the trajectory generation or the axis control laws) to the others without the need of re-implementing the whole system. Chapter 3. Virtual CNC System 72 3.9. Simulation and experimental results The proposed Virtual C N C system is verified through several simulations and experiments. Two standard contouring tests are conducted: a diamond-shaped path with a side length of 50 [mm] and a circular path with a diameter of 100 [mm]. The kinematic profiles of the two refer-ence shaped toolpaths are given in Appendix E. Furthermore, different scenarios are considered in order to demonstrate the robustness of the proposed Virtual C N C system. The first scenario is focused on various smoothness level of the feed motion planning used in trajectory generation. In the second scenario, different axis tracking control schemes are considered. A more complex toolpath is also tested. The command feedrate along the desired toolpath is set to 200 [mm/sec] for the two standard contouring tests. A l l experiments are done in air cutting; in other words, any influence of the disturbance due to cutting forces are neglected. 3.9.1. Experimental test platform A leadscrew driven F A D A L V M C 2216 2-1/2 axis machining center is used as the experi-mental test platform, shown in Fig. 3.29. The machine is controlled by a Digital Signal Process-ing (DSP) board interfaced with an programmable digital control I/O card. A n in-house developed Open architecture Real-Time operating System (ORTS) [4] is used to execute the tra-jectory generation and control laws. It should be noted that all of the contouring tests are done on the x-y plane only and the motion in z-direction is not considered, for simplicity. The pitch length of the leadscrew drives is 10 [mm]. The servomotors are powered by the servo-amplifier in cur-rent control mode, which receives the control signals from the axis control card. Position feed-back is measured through the incremental linear encoders with 1.22 [pm] resolution, in both axes. The velocity measurements are not acquired in this setup; therefore, the measurement noise due to the tachometer is not considered in the simulations. The feed drive parameters correspond-ing to the feeding axes in the experimental test platform is summarized in Table D . l , in Appendix D . In addition, the kinematic parameters (such as acceleration, deceleration, and jerk limits of the Chapter 3. Virtual CNC System machine) for trajectory generation and the controller parameters for the axis tracking control schemes can be found in Table D.2 and D.3, in Appendix D as well. Figure 3.29 : F A D A L V M C 2216 -- 2-1/2 Axis C N C Vertical machining center Chapter 3. Virtual CNC System 74 3.9.2. First scenario -- Feed motion planning with various smoothness levels The first scenario is to demonstrate the ability of the proposed Virtual CNC system in predict-ing the feed drive performance under different trajectory generation schemes. In this scenario, the feed motion planning with low and high smoothness levels are both tested. In feed profiling with high smoothness level, a trapezoidal acceleration feed motion planning is chosen to be tested and the expressions for the corresponding kinematic profiles are given in Appendix B [27]. P-PI con-trol is selected as the axis tracking control scheme used in both experimental test platform and Virtual CNC system, since P-PI control is a common motion tracking control scheme which has been widely used in the conventional CNC machining centers. The block diagram and the control law corresponding to the P-PI control can be found in Appendix C. Simulation and experimental results with the low and high smoothness level feed motion plannings for the two different refer-ence shaped toolpaths are compared and shown in Fig. 3.30 through 3.33. The maximum tracking and contouring errors obtained from experiments and simulations for each case are summarized in Table 3.1 through 3.3. For the diamond-shaped contour, simulations match nicely with the exper-iments. It can be seen that the most critical parts on the diamond paths are located at the corners where transients in reference trajectory occur. In feed profiling with low smoothness level, the maximum contouring errors from experiments and simulations are found to be 0.5836 [mm] and 0.5763 [mm], respectively. The corresponding discrepancy error between experiments and simu-lations is found to be 1.2509 [%], where the expression for estimating the error of discrepancy is given as follows, For the feed motion planning with high smoothness level, the maximum contouring error from experiments is reduced from 0.5836 [mm] to 0.2823 [mm]. Similarly, the maximum con-touring error obtained from simulations is reduced from 0.5763 [mm] to 0.2769 [mm]. The corre-max. simulation error - max. experimental error \ error of discrepancy = xl00% (3.102) V max. experimental error Chapter 3. Virtual CNC System 75 sponding discrepancy error between simulations and experiments is found to be 1.9129 [%]. In the circle-shaped contour, the results obtained from simulations and experiments are almost iden-tical to each others. The results also point out that the most significant deviations on the circular paths are located at the quadrants where the direction of the axis motion changes. By focusing on the maximum contouring error along the toolpath, the absolute differences between simulations and experiments are found to be 0.0017 [mm] for the case with low smoothness profiling and 0.0020 [mm] for the case with high smoothness profiling. The corresponding errors of discrepan-cies for both cases are found to be less than 1 [%]. The observation shows that the degree of smoothness in feed motion planning is definitely one of the factors which could affect the perfor-mance of the feed drive servo control in C N C machines. This scenario demonstrates that the pro-posed Virtual C N C system is able to analytically predict the feed drive performance against various trajectory generation schemes. X-Axis - Tracking Error Comparison between Simulations and Experiments Diamond shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 4.6956 4.6966 0.0010 0.0213 High Smoothness Level (Trapezoidal Acceleration) 4.6825 4.6835 0.0010 0.0214 Circle shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 6.6036 6.6049 0.0013 0.0197 High Smoothness Level (Trapezoidal Acceleration) 6.6033 6.6042 0.0009 0.0136 Table 3.1 : Scenario 1 — Summary of simulation and experimental results for X-axis tracking Chapter 3. Virtual CNC System 76 Y-Axis - Tracking Error Comparison between Simulations and Experiments Diamond shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 4.6955 4.6956 0.0001 0.0021 High Smoothness Level (Trapezoidal Acceleration) 4.6824 4.6835 0.0011 0.0235 Circle shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 6.6037 6.6068 0.0031 0.0469 High Smoothness Level (Trapezoidal Acceleration) 6.6037 6.6055 0.0018 0.0273 Table 3.2 : Scenario 1 — Summary of simulation and experimental results for Y-axis tracking Contouring Error Comparison between Simulations and Experiments Diamond shaped toolpath Feed motion planning Maximum Contouring Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 0.5763 0.5836 0.0073 1.2509 High Smoothness Level (Trapezoidal Acceleration) 0.2769 0.2823 0.0054 1.9129 Circle shaped toolpath Feed motion planning Maximum Contourng Error Comparison Analysis (with P-PI Control) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Low Smoothness Level 0.4506 0.4523 0.0017 0.3759 High Smoothness Level (Trapezoidal Acceleration) 0.4504 0.4524 0.0020 0.4421 Table 3.3 : Scenario 1 — Summary of simulation and experimental results for contouring errors Chapter 3. Virtual CNC System Figure 3.30 : Simulations and experiments for tracking a diamond-shaped toolpath with low smoothness feed profiling and P-PI control Chapter 3. Virtual CNC System Figure 3.31 : Simulations and experiments for tracking a diamond-shaped toolpath with trapezoidal acceleration feed profiling and P-PI control Chapter 3. Virtual CNC System 79 100 90 80 70 1 60 £ 50 > 40 30 20 10 0 50.3 j experiment 50.0 Y simulation 49.7 ! o.i l !•—1 49.4 50.0 50.2 -50 -40 -30 -20 -10 0 10 20 30 40 50 X-Axis [mm] 0.5 1.0 1.5 1.8 Time [sec] 1.2 1.3 1.4 1.5 1.1 Time [sec] Figure 3.32 : Simulations and experiments for tracking a circle-shaped toolpath with - low smoothness feed profiling and P-PI control Chapter 3. Virtual CNC System Figure 3.33 : Simulations and experiments for tracking a circle-shaped toolpath with trapezoidal acceleration feed profiling and P-PI control Chapter 3. Virtual CNC System 81 3.9.3. Second scenario -- Feed drive performance against various axis control schemes In the second scenario, the Virtual C N C system is tested against various axis tracking control schemes. Three axis motion control schemes are tested: P-PI control, PID control, and S M C con-trol. The information regarding these three motion control schemes can be found in Appendix C. In this case, trapezoidal acceleration profiled feed motion planning (i.e. high smoothness level) is selected for generating the reference trajectories as the influence due to the discontinuous in refer-ence trajectories can be minimized. Simulation and experimental results for difference axis con-trol schemes corresponding to the two standard shaped toolpaths are compared and shown in Fig. 3.31, 3.33, 3.34 through 3.37. The maximum tracking and contouring errors obtained from exper-iments and simulations for each case are summarized in Table 3.4 through 3.6. For the diamond-shaped contour, simulations match well with the experimental results. For P-PI control, the max-imum contouring errors from experiments and simulations are found to be 0.2823 [mm] and 0.2769 [mm], respectively. The corresponding absolute difference is around 0.0054 [mm]. For PID control, the maximum contouring errors from experiments and simulations are reduced to 0.0138 [mm] and 0.0126 [mm], respectively. The deviation between experimental results and simulations are not greater than 10 [%]. The contouring errors are further decreased when a non-linear type S M C control is used. The maximum contouring errors from experiments and simula-tions are 0.0081 [mm] and 0.0084 [mm], accordingly. By comparing the simulation and experi-mental results, the error of discrepancy corresponding to the maximum contouring errors is around 3.7037 [%]. Similar contributions are observed for testing the circular reference trajec-tory. By considering the maximum contouring error along the toolpath, the deviations between the simulations and experiments are not more than 10 [%] (e.g. 0.4421 [%] for P-PI, 4.8673 [%] for P-PI, and 8.3333 [%] for S M C ) . The corresponding absolute differences are also found to be a few microns for all cases. It is shown that the feed drive performance can be accurately predicted using the proposed Virtual C N C system when various axis control schemes are applied. Chapter 3. Virtual CNC System 82 X-Axis - Tracking Error Comparison between Simulations and Experiments Diamond shaped toolpath Axis Tracking Control Law Maximum Tracking Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment, [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 4.6825 4.6835 0.0010 0.0214 PID Control 0.0375 0.0376 0.0001 0.2659 SMC Control 0.0122 0.0115 0.0007 6.0870 Circle shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment, [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 6.6033 6.6042 0.0009 0.0136 PID Control 0.0471 0.0436 0.0035 8.0275 SMC Control 0.0117 0.0109 0.0008 7.3394 Table 3.4 : Scenario 2 — Summary of simulation and experimental results for X-axis tracking Y-Axis - Tracking Error Comparison between Simulations and Experiments Diamond shaped toolpath Axis Tracking Control Law Maximum Tracking Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 4.6824 4.6835 0.0011 0.0235 PID Control 0.0412 0.0414 0.0002 0.4831 SMC Control 0.0074 0.0070 0.0004 5.7143 Circle shaped toolpath Feed motion planning Maximum Tracking Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 6.6037 6.6055 0.0018 0.0273 PID Control 0.0223 0.0220 0.0003 1.3636 SMC Control 0.0077 0.0072 0.0005 6.9444 Table 3.5 : Scenario 2 - Summary of simulation and experimental results for Y-axis tracking Chapter 3. Virtual CNC System 83 Contouring Error Comparison between Simulations and Experiments Diamond shaped toolpath Axis Tracking Control Law Maximum Contouring Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 0.2769 0.2823 0.0054 1.9129 PID Control 0.0126 0.0138 0.0012 8.6957 SMC Control 0.0084 0.0081 0.0003 3.7037 Circle shaped toolpath Feed motion planning Maximum Contouring Error Comparison Analysis (with Trapezoidal Acceleration Feed Motion profiling) Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] P-PI Control 0.4506 0.4524 0.0020 0.4421 PID Control 0.0215 0.0226 0.0011 4.8673 SMC Control 0.0117 0.0108 0.0009 8.3333 Table 3.6 : Scenario 2 — Summary of simulation and experimental results for contouring errors Chapter 3. Virtual CNC System Figure 3.34 : Simulations and experiments for tracking a diamond-shaped toolpath with trapezoidal acceleration feed profiling and PID control Chapter 3. Virtual CNC System , experiment \ \ simulation 35.35 35.38 -40 -30 -20 -10 0 10 20 30 40 X-Axis [mm] 0.015 0.010 rror w LU E O) < c 3 > 2 c i-E 0.008 LU cp-g- 0.006 | E, 0.004 § 0.002 ° 0 0.5 1.0 Time [sec] 0.40 0.41 0.42 Time [sec] Figure 3.35 : Simulations and experiments for tracking a diamond-shaped toolpath with trapezoidal acceleration feed profding and S M C control Chapter 3. Virtual CNC System 100 90 80 70 60 50 40 30 20 10 0 99.98 -0.34 -0.33 A -0.30 / / ; / \ . \ i i Reference Experiment Simulation / , r. -50 -40 -30 -20 -10 0 10 20 30 40 50 X-Axis [mm] 50.02 50.0 49.98 reference experiment— Jo.005 simulation —-0.005 49.97 50.0 50.01 I UJ II Q c o O 0.03 0.02 0.01 0.0 1 \ / V i h \ V l simulation 0.5 1.0 Time [sec] 1.5 1.8 1.2 1.25 1.3 1.35 1.4 1.45 Time [sec] Figure 3.36 : Simulations and experiments for tracking a circle-shaped toolpath with trapezoidal acceleration feed profiling and PID control Chapter 3. Virtual CNC System 100 90 80 70 60 50 40 30 20 10 0 -50 -40 -30 -20 -10 0 10 20 30 40 50 X-Axis [mm] 52.78 52.7 52.64 reference experiment Jo.02 simulation 49.84 0.02 49.9 49.98 0.95 0.5 1.0 Time [sec] 1.5 1.8 1.22 1.24 1.26 1.28 1.30 1.32 Time [sec] Figure 3.37 : Simulations and experiments for tracking a circle-shaped toolpath with trapezoidal acceleration feed profiling and S M C control Chapter 3. Virtual CNC System 88 3.9.4. Third scenario -- Complex contouring test In order to further verify the proposed Virtual C N C system, more complex contouring tests are conducted. In this test, a spiral part is machined in the experimental test platform and the machined part is illustrated in Fig. 3.38. For the machine's configuration, feed motion planning with trapezoidal acceleration profile is applied for generating the reference trajectories and a con-ventional P-PI control is used as the axis control scheme. It is noted that only one layer of motion on the x-y plane is simulated, for simplicity. The experimental test is again done in air cutting and the disturbance due to the cutting forces is ignored. In order to perform control system monitor-ing and diagnosis, a part tolerance is set to 0.40 [mm], so that the violation spots due to the part errors dominated from the performance of the feed drive servo control can be visualized. The command feedrate is first set to 8,000 [mm/min] (approximately 133 [mm/sec]). Simulation and experimental results for the spiral part are compared and shown in Fig. 3.39. The tracking and contouring errors found in experiments and simulations are summarized in Table 3.7. Simula-tions match well with the experimental results. Using the proposed Virtual C N C system, the vio-lation spots against the part tolerance can be geometrically visualized on the toolpath. The violation spots are usually located at the sharp corners and at the locations of high curvatures for the case of the circular path. The pattern of the contouring error profile obtained from the experi-ments is quite similar to the predictions by the proposed Virtual C N C system. The maximum con-touring errors from experiments and simulations are found to be 0.606 [mm] and 0.575 [mm], respectively. The corresponding deviation is around 5.116 [%]. Since the maximum contouring errors are above the specified part tolerance, the command feedrate should be reduced in such a way that the contouring errors are within the part limit. Using the proposed Virtual C N C system, a trial and error test can be carried out in a virtual environment. In this case, the simulation results are observed by iteratively adjusting the command feedrate along the toolpath. After several tri-als, the command feedrate should be reduced from 8000 [mm/min] to 5000 [mm/min] (approxi-mately 83 [mm/sec]), so that the geometric deviations between the actual toolpath and the Chapter 3. Virtual CNC System 89 reference toolpath do not violate the specified part tolerance. By changing the feedrate to 5000 [mm/sec], an experimental test is also conducted in order to verify the diagnosis of the feed drive control performance using the Virtual C N C system. Simulation and experimental results for the spiral part are compared and shown in Fig. 3.40. The maximum tracking and contouring errors from experiments and simulations are summarized in Table 3.8. Again, simulations are close to the experimental results. A l l violation spots disappear in both simulation and experiment results. The maximum contouring errors from experiments and simulations are found to be 0.398 [mm] and 0.378 [mm], respectively. The error of discrepancy is also found around 5 [%]. Although the time duration of motion is a bit longer than the time duration found for the case with the command feedrate of 8000 [mm/min], the contouring errors from simulation and experimental results are both less than the specified part tolerance. This example shows that the Virtual C N C system is not only able to realize the feed drive performance in a virtual environment, but it also can be used for control system performance monitoring and diagnosis. Figure 3.38 : Spiral part after machining Chapter 3. Virtual CNC System 90 Simulation and experimental results for spiral part P-PI Control with Trapez Commanded federate = 8 Specified Tolerance = 0.4 oidal Acceleration Feed Motion Planning ,000 [mm/min] 0 [mm] Results Comparison Analysis Simulation [mm] Experiment [mm] Abs. Difference [mm] Err. Discrepancy [%] Tracking Error in X-Axis 4.448 4.451 0.003 0.067 Tracking Error in Y-Axis 4.449 4.448 0.001 0.023 Contouring Error 0.575 0.606 0.031 5.116 Table 3.7 : Scenario 3 — Summary of simulation and experimental results for spiral contouring with command feedrate of 8000 [mm/min] Simulation and experimental results for spiral part P-PI Control with Trapez Commanded federate = 5 Specified Tolerance = 0.4 oidal Acceleration Feed Motion Planning ,000 [mm/min] 0 [mm] Results Comparison Analysis Simulation [mm] Experiment [mm] Abs. Difference, [mm] Err. Discrepancy, [%] Tracking Error in X-Axis 2.783 2.784 0.001 0.036 Tracking Error in Y-Axis 2.781 2.783 0.002 0.0719 Contouring Error 0.378 0.398 0.020 5.025 Table 3.8 : Scenario 3 — Summary of simulation and experimental results for spiral contouring with command feedrate of 5000 [mm/min] Chapter 3. Virtual CNC System 91 Simulation Results for Spiral Toolpath • Commanded Feerate = 8000 [mm/mln] -Experimental Results for Spiral Toolpath - Commanded Feerate = 8000 [mm/min] -20 25 Time [sec] (a) 20 25 Time [sec] (b) Figure 3.39 : Results for spiral contouring with command feedrate of 8000 [mm/min] - -a) simulation, b) experiment Chapter 3. Virtual CNC System 92 Simulation Results for Spiral Toolpath - Commanded Feerate = 5000 [mm/min] • Experimental Results for Spiral Toolpath - Commanded Feerate = 5000 [mm/min] -Reference Simulation Violation Spot Reference - Experiment Violation Spot 30 40 Time [sec] 30 40 Time [sec] (a) (b) Figure 3.40 : Results for spiral contouring with command feedrate of 5000 [mm/min] --a) simulation, b) experiment Chapter 4 Auto-Tuning Using Fuzzy Logic Hierarchical Control 4.1. Overview In controller design, an appropriate tuning is required in order to achieve a satisfactory sys-tem response. As poor tuning results in generating larger tracking errors for each axis, conse-quently, the feed drive performance may be degraded and may become unsatisfactory. Therefore, finding the suitable control parameters becomes a very challenging topic in this area. Fig. 4.1 illustrates the effects on tracking accuracy due to poor tuning. The simulations are done for track-ing a diamond reference trajectory with the length of 50 [mm]. The test platform is the Fadal V N C 2216 C N C machine and the corresponding feed drive parameters are given in Appendix D . The axis control scheme is selected as a S M C control. The trajectory generation is based on trap-ezoidal acceleration feed motion planning. The command feedrate, acceleration/deceleration, and jerk limits are 200 [mm/s], 2,000 [mm/s 2 ] , and 50,000 [mm/s 3 ] , respectively. For poor tuning, the maximum contouring error is found to be 0.028 [mm]. On the other hand, the tracking and contouring accuracy is significantly improved with more suitable tuning. The corresponding maximum contouring error is reduced to 0.0084 [mm]. This example addresses the importance of tuning the control parameters for achieving better feed drive servo control performance in C N C machine tools. Generally speaking, the control parameters are obtained either by an analytical method, or by a manual tuning. In the manual tuning process, the control parameters are usually adjusted itera-tively by examining the step response for the closed-loop control system (i.e. a trial-and-error approach). The process of manual tuning is usually time-consuming. Furthermore, selecting the proper control parameters is all dependent on expertise and experience. Due to this fact, an auto-93 Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 94 matic approach for tuning the control parameters is introduced in this chapter. In the proposed auto-tuning scheme, a fuzzy logic hierarchical control is applied. o m — I HI I!" o O 0.04 0.03 0.02 0.01 0 -0.01 -0.02 -0.03 -0.04 I 0.04 0.03 0.02 0.01 0 -0.01 -0.02 -0.03 -0.04 ( 0.03 0.025 0.02 0.015 0.01 0.005 0 0.5 1.0 1.5 ) 0.5 1.0 1.5 i^Poor a : Tuning : i . Appropriate • | f Tuning; V, Jlv-. A ' A J I A < ) 0.5 1.0 Time [sec] 1.5 70.8 70.5 70.2 70-60 50 </> 40 >L 30 20 10 0 . x . Appropriate \ v « ^ Tuning .Poor Tuning 34.8 35.0 35.6 — Reference — Appropriate Tuning — Poor Tuning -50 -40 -30 -20 -10 0 10 20 30 40 50 X-Axis [mm] Figure 4.1 : Tracking and contouring performance due to poor tuning and appropriate tuning This chapter is organized as follows: The development of the hierarchical structure, used in the proposed auto-tuning control system, is presented in Section 4.2. Several assumptions and criteria are discussed in Section 4.3. The new strategies for the system performance evaluation and classification is proposed in Section 4.4. This is followed by the development of the fuzzy tuning layer using fuzzy decision table approach in Section 4.5. The development of the member-ship functions and the fuzzy linguistic rules corresponding to the condition and action variables are also discussed in this section. Simulations for realizing the proposed automatic tuning scheme, with experimentally validation, are summarized in Section 4.6. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 95 4.2. Hierarchical structure Typically, fuzzy logic control can be used either as a low-level direct control or as a high-level supervisory control, as shown in Fig. 4.2. The low-level direct control is more suitable when the required control bandwidth is relatively low as the time constant of the control system is usually large. The high-level fuzzy logic control is used as a supervisor to perform tuning or adaptive control functions rather than in-loop direct control. In the proposed auto-tuning scheme, a high-level fuzzy logic control is applied. The control system has a hierarchical structure which combines a crisp control at lower level and a fuzzy logic supervisory control at upper level. The overall control structure is decomposed into three main layers: bottom layer for direct control, intermediate layer for performance evaluation, and upper layer for supervisory control [34]. The schematic representation of this three-level hierarchical control structure is shown in Fig. 4.3. Supervision Output [^FuzzyLpgipN ' f \-r\ ControlTV^ < Mesurement \ ^ I Feedback J~^~^ Mesurement Feedback C o n t r o l ^ — S y s t e m ^ -{ Mesurement \ m \ Feedback J^~^ Output (a) (b) Figure 4.2 : Fuzzy control architecture — (a) low-level direct control, (b) high-level supervisory control Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 96 INPUT (i.e. reference axis position) 3 e <D g E s 5 •§ o "33 'Upper Layer High-Level Fuzzy Logic Control (Intelligent Supervisor) : Intermediate Layer Performance Evaluation Level (Information Abstraction and System Performance Evaluation) Bottom Layer Feedback Measurement Servomotor Low-Level Crisp C o n t a i n 1 Amplifier OUTPUT (i.e. actual axis position) Figure 4.3 : Schematic representation of proposed hierarchical control structure 4.2.1. Bottom layer The bottom layer corresponds to the low-level direct control loop. The controller in this layer is a crisp control dealing with high-resolution information coming from the feedback measure-ments attached to the closed-loop feed drive servos. 4.2.2. Intermediate layer The intermediate layer represents the data processing especially for monitoring and evaluat-ing the system performance. The tasks handled in this layer are system performance specifica-tion, response recognition, and computation of the performance indices. This intermediate layer acts as an interface between the low-level control for regulating the servomotors at the bottom layer, and the knowledge-based fuzzy logic control for supervising the tuning actions at the upper layer. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 97 4.2.3. Upper layer The third layer corresponds to the high-level supervisory control and is also called fuzzy tun-ing layer. In this layer, fuzzy logic control acts as an intelligent supervisor for decision making to achieve the overall control objective, particularly improving the control performance in the low-level direct loop. Through the fuzzy inference process, the necessary tuning actions are decided. This control layer usually requires a high degree of information in terms of fuzziness and it has a relatively low control bandwidth. 4.3. Criteria and assumptions Before proceeding to the proposed auto-tuning scheme for improving the feed drive perfor-mance in C N C machine tools, several assumptions and criteria should be made. 4.3.1. Case study -- Auto-tuning of Sliding Mode Control In control literature, an auto-tuning using high-level fuzzy logic control has been conducted by many researchers [8,34,73,80]. However, most of these proposed fuzzy tuning schemes are applied on the PID-type control only. It is because this type of control is usually used in the industrial process control and motion control systems. In order to demonstrate the effectiveness of the proposed auto-tuning scheme, a non-PID type control, called Sliding Mode Control (SMC), is selected as a direct crisp control at the low-level control layer, in this case study. As mentioned in the previous chapter, S M C has been proposed for the use in the control of high speed feed drives due to its robustness and simplicity [3]. The digital control law of the S M C design is given as, Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 98 uscMC(z) = Je-[A^z)-xAz))+xr(z)]+Be-xm(z) + Ks-S(z) + d(z) \S(z) = A-[xr(z)-xm(z)]+[xr(z)-xm(z)] where < (4.1) T -z T -z 5 -*r(z)—s—-xm(z) z-l z - l + [xr(z)-xm(z)]\ More information regarding the S M C design is given in Appendix C . The S M C design has three control parameters: sliding surface bandwidth A , in [rad/sec], feedback gain Ks, in [Volt/ (mm/sec)], and disturbance adaptation gain p , in [Volt/mm]. In order to develop the auto-tuning process using fuzzy logic control, the co-relationships between these three control parameters and the system performance should be constructed. However, the number of control parameters directly relates to the difficulty of designing the linguistic rules in the whole process. Moreover, the computational load could increase if more control parameters are involved. To simplify the tuning process, one of these three control parameters, the sliding surface bandwidth A , is assumed to be pre-defined. In other words, the value of A cannot be changed and is considered as a fixed gain during the overall tuning process. After this assumption is made, only two flexible control parameters (i.e. Ks and p ) are considered in the proposed auto-tuning process. 4.3.2. System performance evaluation In the intermediate layer, the system performance has to be evaluated into a crisp value which represents the current status of the overall control performance. Generally, a step-input response diagnosis test is used for system performance evaluation. By observing the step response of sys-tem, the system performance attributes such as maximum overshoot, rise time, peak time, oscilla-tion, and steady state error can be analytically evaluated (Fig. 4.4). However, this methodology may not be applicable in the case of auto-tuning for the feed drive servo control. It is because the reference input (i.e. reference axis trajectory) to the feed drive servo control system is no longer a step input. In C N C servo control, the axis reference command is always smoothed out by the tra-Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 99 jectory generator (Fig. 4.5). Fig. 4.6 addresses the drawback of tuning the control parameters based on the system performance evaluation using a step-input response diagnosis test. The first case corresponds to the control design which has a low overshoot system response, and the second case relates to the control design with high overshoot system response. The results show that a larger tracking error is obtained in the first case, although it has less overshoot shown in the step input response graph. On the other hand, the second control design results in large overshoot but the tracking accuracy is much better than the first case. Due to this evidence, a unit-step input diagnosis for system evaluation (based on the overshoot, rise time, steady state error, and so on) cannot be directly used in this particular case. Therefore, a new strategy for system performance evaluation is investigated and the details are discussed in Section 4.4. Controller -c System { Mesurement \ ^ I Feedback Response cz^ Recognition overshoot steady state error rise time Figure 4.4 : Tradition method for system evaluation — unit-step input response diagnosis test HOME X0Y0Z0 N? G01 X50 CNC feed drive servo control system r — — — — — — — — — — — — — Trajectory Generator Position command e.g.: X-Axis: 0 — • 50 [mm] Axis reference commands f X [mm] Controller I •c System { Mesurement \ ^ | | Feedback Figure 4.5 : C N C feed drive servo control system Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 100 1.4 1.2 S 1.0 c o 8 - 0 8 * 0.6 Q. CO 0.4 0.2 0 High Overshoot Tuning ji Low Overshoot Tuning I — Step Input — High Overshoot Tuning --- Low Overshoot Tuning 0.01 0.02 0.03 0.04 (a) 100 .c •e o 50 •*> o CD m 0.05 i -LU •= „ i " ? | o H £ m — High Overshoot Tuning Reference, Low Overshoot Tuning -0.05 High Overshoot Tuning A Low Overshoot Tuning I 0.5 1.0 1.5 Time [sec] (b) 0.62 0.64 0.66 Figure 4.6 : Feed drive performance due to high overshoot tuning and low overshoot tuning — (a) unit-step input response, (b) back-and-forth motion response 4.3.3. Back-and-forth motion test According to the drawback of using a unit-step input test for system performance evaluation in C N C servo control tuning, a new input response diagnosis test is required. In C N C controller design, the control engineer usually develops a mathematical model representing the whole feed drive servo control system for each axis. By feeding a back-and-forth axis motion into the closed-loop model, the simulated system performance can be observed and evaluated. Then, the control parameters are adjusted iteratively corresponding to the system response until the control perfor-mance is satisfactory. Afterwards, the controller is fine-tuned by jogging the axis back and forth again under a real motion test. By considering this tuning technique in feed drive servo control, a back-and-forth motion test is used as a diagnosis test for evaluating the system performance. In order to remove the uncertainties of using the back-and-forth motion test, the proposed auto-tun-ing process is subjected to two constraints. The first constraint is that the length of the traveled distance cannot be too short. It is because the command feedrate cannot be reached to the desired level due to the acceleration and deceleration transients if the distance of travel is not long Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 101 enough. The second constraint is that the command feedrate cannot be too small. Otherwise, the steady state position error (i.e. following error) may become minor and may not be easily exam-ined. Therefore, the reasonable ranges of traveled distance and command feedrate for the back-and-forth motion test are suggested as follows, Constraints for back-and-forth motion test Length of traveled distance (L), [mm] L>50[mm] Command federate (F), [mm/sec] 20 [mm/sec] < F < 200 [mm/sec] * dependent on the physical limits of machine' Table 4.1 : Constraints for back-and-forth motion test 4.4. New methodology for system performance evaluation Based on the tuning experience, there are three sources that can be used as the guidelines for describing or evaluating the system performance: (1) Oscillation level or pattern of control signal (2) Stability margin analysis (3) Tracking accuracy analysis 4.4.1. Oscillation of control signal in frequency domain analysis Generally, the control signal should not oscillate too much during the whole control process. Fig. 4.7 clearly demonstrates the influence of the oscillation level in the control signal. By con-sidering the first set of control parameters, the control signal (u) is clean and the corresponding tracking error profile is also very smooth. However, in the second case, it can be observed that the profile of the control signal is very noisy and it leads to a noisy tracking error profile as well. By focusing on the tracking performance, the maximum absolute tracking errors for both cases are found to be less than 0.015 [mm]. Although both cases yield a very attractive tracking accu-racy, the control design with the first set of control parameters is more preferable than the second Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 102 one with noisy control signal, based on expertise and experience. Based on this phenomenon, the oscillation level of the control signal can be used to reflect the tracking performance in feed drive servo control system. 100 C C P 0> O £ _ 0) o CC 0 -i i c o O 1 0 0 0 . 0 1 5 g 0 . 0 1 W — 0 . 0 0 5 TO E c E , 0 t > - 0 . 0 0 5 2 1— - 0 . 0 1 0 - 0 . 0 1 5 0 . 5 1 . 0 Time [sec] (a) 1 . 5 0 . 0 1 5 0 . 0 1 0 . 0 0 5 - 0 . 0 0 5 - 0 . 0 1 0 - 0 . 0 1 5 0 . 5 1.0 Time [sec] (b) 1 . 5 Figure 4 . 7 : Influence of oscillation in control signal — (a) clean signal, (b) noisy signal Although the system performance can be recognized by monitoring the oscillation level of the control signal during the diagnosis test, how to classify the oscillation level of the control sig-nal is another challenge in this system performance evaluation technique. Experience indicates that the oscillation level is hard to be identified by just looking at the response of the control sig-nal in the time-domain. In practice, the frequency content of the control signal can be evaluated by converting the original signal into frequency-domain using Fourier Transform [12]. The Fou-rier Transform, in essence, decomposes a waveform into a sum of sinusoids of different fre-quency. Generally, the Fourier Transform is defined as, Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 103 in continuous form =>X(&>) = -jm-dt 1 N =>X(Q)k) = X(k-m = --JZx(ti)-e (4.2) in discrete form j-Cukti k = 1,2,3... where Aco = ; t;=i-T NT 1 where X(cok) is the Fourier spectrum of the signal x(t) at ith sampling time instant tt, in [sec]. Q)k corresponds to the kth frequency sample, in [rad/sec]. T and TV are the sampling period and the number of time samples (or frequency samples) in the given time-domain signal, respectively. It is noted that the Discrete Fourier Transform (DFT) can be computed efficiently using a Fast Fourier Transform (FFT) [12]. By taking F F T with respect to the sampling frequency used in the servo control loop, the frequency content (i.e. Fourier spectrum) of the control signal can be observed. Fig. 4.8 shows the profiles of the control signal in frequency domain corresponding to the example given in Fig. 4.7. The information of the signal in the frequency range up to the half of the sampling frequency is considered and useful. This cutoff frequency is called Nyquist fre-quency which corresponds to the maximum frequency that can be measured without aliasing based on the specified sampling frequency. Fig. 4.8 shows that the oscillation level of the signal and the dominant frequency (with maximum power magnitude) are some how co-related to each other. For example, the dominant frequency is most likely located at the low frequency range if the control signal is clean. On the contrary, high frequency harmonics are found if the control sig-nal is very noisy. According to this relationship, the location of the dominant frequency and the corresponding power magnitude can be used to classify the oscillation level of the control signal. In other words, the system performance attribute can be analytically specified according to the degree of the oscillation in the control signal. (4.3) Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 104 In order to map the system performance into the primary fuzzy states, the index of deviation for each system performance attribute should be determined. The expression used to compute the index of deviation regarding the oscillation level in control signal is introduced as follows, — ' C^max ~ ^ mean ) u^^index ~ tj _ j \ v^ max '-'mean) where low frequency range => 0 < / < Fthre high frequency range Fthre <f< Fnyquist where OSCindex denotes the index of deviation corresponding to the oscillation level in control signal. Fthre is introduced as a threshold value to distinguish between the low frequency region and the high frequency region. The value of Fthre is reasonably selected to be around 50 [Hz] as the dominant frequency reflecting the clean control signal is usually located within 0 to 50 [Hz]. O f course, the selection of this threshold is also dependent on the sampling frequency used in the servo control loop. F n y q u i s t corresponds to the Nyquist frequency which is the half of the control sampling frequency. L m a x and HmM are the maximum magnitudes (or powers) according to the dominant frequencies located at the low and high frequency ranges, respectively. Similarly, L m e a n is the average of magnitude corresponding to the low frequency range and Hmean is the average of magnitude corresponding to the high frequency range, in the power spectrum plot. Lmean a n c * H m e a n a r e implied in order to minimize the uncertainties (or bias) which may occur in the system. The term Sc is a scaling factor which is introduced for adjusting the sensitivity for specifying the oscillation level, when needed. In the proposed fuzzy tuning process, the deviation error index OSCindex is one of the sources used to describe the system performance in the current status. This index also corresponds to the context of the rule-base of the system tuning. There-fore, the index of deviation must be fuzzified into the membership values corresponding to the primary fuzzy states. For example, if OSCindex is greater than 1.0, it means that the system per-formance is highly unsatisfactory due to high oscillations in control signal. Similarly, the system Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 105 performance is considered to be acceptable if the oscillation error index is found to be between 0.5 and 0.75. Using this concept, the system performance can be specified in terms of linguistic variables (i.e. acceptable, over-qualified, or unsatisfactory) based on the crisp value of the oscilla-tion error index corresponding to the control signal. Frequency [Hz] Frequency [Hz] (a) (b) Figure 4.8 : Fourier spectrum analysis in control signal — (a) clean signal, (b) noisy signal 4.4.2. Stability margin analysis The stability of the system response can be considered as another attribute to evaluate the system performance. In control design, the stability of the closed-loop system is ensured if the Nyquist curve does not encircle the critical point [-1,0]. Otherwise, the system becomes unstable. Generally, the Nyquist criterion can be further simplified if the loop system and its inverse are sta-ble (Fig. 4.9) [7]. For system stability analysis, gain margin and phase margin are common mea-Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 106 sures of stability and sensitivity for the system response. The gain margin (G m ) and phase margin (<j>m ) are defined as, Gain Margin = Gm= -. r => in decibels (db), Gm = 20 • l o g 1 0 PiU-a>u)\ & Phase Margin = (pm = n + arg[G; (j • Q ) g ) ] where G[(j-co) is the loop transfer function corresponding to the linear system model in fre-quency domain. cou is called the ultimate frequency which corresponds to the frequency where the phase angle of the loop transfer function Gt(j-aj) is equal to -n . The gain cross-over fre-quency cog is the frequency where the magnitude of the loop transfer function G[(j-co) is equal to unity. The gain margin and phase margin can be interpreted using the Nyquist curve or the bode plot, as shown in Fig. 4.10. In control design, the Nyquist curve corresponding to the loop system response is usually pushed away from the critical point [-1,0] with a certain range of gain margin and phase margin to avoid the instability due to the unmodeled disturbance or noise. Typ-ical values of phase margin (f>m range from 30 [degree] to 60 [degree]. Gain margin Gm could typically vary from 2 to 5 (i.e. around from 6 [db] to 15 [db]). The evaluation of the gain margin and phase margin can be used to indicate the system performance corresponding to the stability level of the loop system response. In order to reduce the complexity for defining the stability level, only the phase margin 0m is used as the measure of the system stability. Again, the system performance corresponding to the stability level can be expressed in terms of linguistic variables, based on the control knowledge and tuning experience. For example, the phase margin of 30 [degree] or less indicates that the level of system stability is relatively low. In this case, the sys-tem performance is considered to be unsatisfactory. On the other hand, the system stability is considered as over-qualified (i.e. too stable or consecutive) if the phase margin is over 60 [degree]. The phase margin with the range from 30 [degree] to 60 [degree] corresponds to the system having a reasonable level of stability. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 107 > Im G|(jco) . C0 = oo j -1 0 Re G,Gco) ' ( 0 = 0 > Im G|(jco) ^ CO = oo "7 I 0 Re G,Gco) co = 0 (a) (b) Figure 4.9 : Nyquist curve in loop response analysis — (a) unstable system, (b) stable system (a) (b) Figure 4.10: Evaluation of gain margin and phase margin from -- (a) Nyquist curve, (b) Bode plot 4.4.3. Tracking accuracy analysis During the input response diagnosis test (i.e. back-and-forth motion test), the maximum absolute tracking error can be determined by comparing the reference input and the actual output at the same time stamp. The analytical expression used to compute the maximum absolute track-ing error is given as, TREindex = max{xr (t) - Xa (r)|), 0 < t < Tend (4.5) where TREindex denotes the index of deviation corresponding to the position tracking accuracy. Xr(t) and Xa{t) are the data sequences of the reference axis position input and the actual out-Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 108 put measured by the position feedback device, respectively. Tend corresponds to the total time duration needed for one cycle of back-and-forth motion test. If the maximum tracking error is larger than a certain threshold value, then the control parameters may not be fine-tuned; and adjustments are required. Using this knowledge-based concept, the index of deviation for the position tracking accuracy used to describe the system performance can be mapped into the lin-guistic languages (such as okay, small, or large). 4.4.4. Mapping from index of deviation to discrete performance index Since the indices of deviation corresponding to the system performance attributes (i.e. oscil-lation level of control signal, system stability, and position tracking accuracy) relate to the context of the rule-base of auto-tuning using high-level fuzzy logic control, these indices should be cate-gorized into different linguistic values. These linguistic values correspond to the fuzzy states of condition variables, and they must be fuzzified into their default membership functions in order to perform the fuzzy inference process (i.e. control parameters adjustment) at the upper layer fuzzy logic control. In the proposed auto-tuning process, the indices of deviation are mapped to the dis-crete performance indices which correspond to the pre-defined linguistic values. In order to obtain a discrete set of performance indices, threshold values are defined for each index of devia-tion. In this particular S M C parameters tuning algorithm, five primary fuzzy states for each index of deviation are selected. The number of fuzzy states relates to the degree of fuzziness. In other words, more number of fuzzy states means that fuzzy resolution increases and the information resolution also increases. However, high fuzzy resolution may induce a heavy computational load during the tuning process. Therefore, five fuzzy states are fairly enough to balance the degree of fuzziness and the computational efficiency. The mappings from the indices of deviation based on oscillation level of control signal, system stability, and axis position tracking accuracy to the discrete performance indices are designed as, Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 109 Discrete Performance Index Index of Deviation for OSC 5 0 < OSC < 0.25 4 0.25 < OSC < 0.50 3 0.50 < OSC < 0.75 2 0.75 < O S C < 1.00 1 1.00 <OSC Table 4.2 : Mapping from index of deviation for oscillation level to discrete performance index Discrete Performance Index Index of Deviation for PHM 5 6 0 ° < PHM 4 4 5 ° < PHM < 6 0 ° 3 4 0 ° < PHM < 4 5 ° 2 3 0 ° < PHM < 4 0 ° 1 PHM < 3 0 ° Table 4.3 : Mapping from index of deviation for stability level to discrete performance index Discrete Performance Index Index of Deviation for TRE 5 0<TRE< 0.100 mm 4 0.100 mm < TRE < 1.00 mm 3 1.00 mm < TRE < 5.00 mm 2 5.00 mm < TRE < 20.00 mm 1 20.00 mm < TRE Table 4.4 : Mapping from index of deviation for tracking level to discrete performance index In Table 4.2 through 4.4, the abbreviations of O S C , P H M , and T R E correspond to the oscilla-tion level of control signal, the system stability based on the measure of phase margin, and the axis position tracking accuracy, respectively. The threshold values for each index of deviation are selected according to expertise and experience. In order to define the nominal threshold values for classifying the oscillation level of control signal, the scaling factor Sc is chosen to be 20, in this particular case. Furthermore, the relationship between the discrete performance indices and the primary fuzzy states of the condition variables (i.e. O S C , P H M , and T R E ) are given in Table Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 110 4.5 and 4.6. The performance indices computed by the given mappings are considered as the inputs to a fuzzy decision table for tuning the control parameters in feed drive servos. The outputs from this fuzzy decision table correspond to the tuning actions that are required to improve the current system performance with respect to the desired control objective. Discrete performance index Primary fuzzy states (for OSC and PHM) Fuzzy variable (linguistic value) Abbreviation 5 Highly Over-Qualified H I O Q 4 Little Over-Qualified L I O Q 3 Acceptable A C C P 2 Little Unsatisfactory L I U N 1 Highly Unsatisfactory H I U N Table 4.5 : Context fuzzy states corresponding to discrete performance indices for O S C and P H M Discrete performance index Primary fuzzy states (for TRE) Fuzzy variable (linguistic value) Abbreviation 5 Okay O K 4 Small S M 3 Medium M E 2 Large L A 1 Extremely Large E L Table 4.6 : Context fuzzy states corresponding to discrete performance indices for T R E 4.5. Fuzzy logic control at upper layer In the proposed hierarchical control structure, the upper layer with high-level fuzzy logic control represents a knowledge base for tuning the control parameters in the low-level in-loop direct control. For each status of the system performance, a conceptual abstraction is determined. The expert knowledge is then converted into an analytical form by the use of fuzzy logic theories and operations. Through the processes of fuzzification, compositional rules of influence, and def-fuzzification, the fuzzy decision table is developed using fuzzy decision table approach [23]. This Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 111 table gives the directions of tuning corresponding to the performance indices that represent the status of the process. Since the universe of discourse of the condition variables and the tuning variables are designed to be discrete and finite, the fuzzy decision table can be constructed off-line in order to reduce the on-line computational burden. The steps of developing a fuzzy deci-sion table for S M C tuning are presented in the following sub-sections. 4.5.1. Membership functions for condition and action variables In developing the fuzzy decision table for S M C tuning, the membership functions for the condition variables and for the action variables are established for the fuzzy quantities which are present in the fuzzy rules. A common way of developing a membership function for each fuzzy quantity is to discretize the universe of discourse into desired primary states, and then assign a degree of membership for each value in the universe. A standard procedure is to apply a triangu-lar shape function with full membership grade (i.e. value of unity) assigned at the representative value of each fuzzy quantity. The resolution of fuzziness is introduced by assigning uniformly decreasing membership grades to the remaining element values. The membership functions of each fuzzy quantity for the condition variables (i.e. O S C , P H E , T R E ) are designed in a discrete form, as shown in Table 4.7. Condition variables OSC, PHM, TRE 1 2 3 4 5 HIUN 1 0.7 0.3 0 0 LIUN 0.7 1 0.7 0.3 0 ACCP 0.3 0.7 1 0.7 0.3 LIOQ 0 0.3 0.7 1 0.7 HIOQ 0 0 0.3 0.7 1 Table 4.7 : Membership functions for condition variables O S C , P H M , and T R E Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 112 The action variables should be also expressed into a set of linguistic values that represent the required tuning actions. In the auto-tuning for S M C control, the action variables are the adjust-ment in the feedback gain Ks (with the notation of D K S ) and the adjustment in the disturbance adaptation gain p (with the notation of D R H O ) . In order to achieve a fine tuning action, seven fuzzy states for each tuning variable are considered. The mapping between the discrete values and the fuzzy states for the action variables are shown in Table 4.8. The representative discrete values given in Table 4.8 are of significance only in a relative sense, but a reasonable physical meaning should be related to each numerical value [23]. The membership functions for the action variables are designed, as shown in Table 4.9. Tuning Fuzzy Set (DKS, DRH( 3) Discrete value Fuzzy state Abbreviation +3 Positive Large P L +2 Positive Medium P M +1 Positive Small PS 0 Zero (No Change) Z R -1 Negative Small NS -2 Negative Medium N M -3 Negative Large N L Table 4.8 : Mapping between discrete values and fuzzy states for D K S and D R H O Fuzzy Action Variables DKS, DRHO -3 -2 -1 0 +1 +2 +3 NL 1 0.9 0.8 0.7 0.6 0.5 0.4 NM 0.9 1 0.9 0.8 0.7 0.6 0.5 NS 0.8 0.9 1 0.9 0.8 0.7 0.6 ZR 0.7 0.8 0.9 1 0.9 0.8 0.7 PS 0.6 0.7 0.8 0.9 1 0.9 0.8 PM 0.5 0.6 0.7 0.8 0.9 1 0.9 PL 0.4 0.5 0.6 0.7 0.8 0.9 1 Table 4.9 : Membership functions for action variables D K S and D R H O Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 113 4.5.2. Fuzzy linguistic rules for SMC tuning After establishing the membership functions for the condition variables and for action vari-ables, an expert knowledge on tuning a S M C feed drive servo is expressed as a set of linguistic statements (rules) containing fuzzy quantities. These rules are used to setup a bridge between the condition inputs and the control action outputs through the fuzzy logic connectives (i.e. I F - T H E N , OR). The mapping between the system performance attributes and the control actions for S M C tuning should first be constructed in order to design the appropriate linguistic rules. The basic idea for developing this relationship is to run a number of simulations or experiments with differ-ent values of the control parameters. Then, the corresponding system performance attributes are evaluated and recorded. After a number of trials, the simple relationship between the control parameters and the status of system performance can be realized. In order to clarify this relation-ship, a second test is conducted. In this test, a set of control parameters yielding an appropriate system performance is chosen as a benchmark. By adjusting one of these control parameters up and down, the influence of the system performance due to this change can be recognized. Same test is conducted for the other flexible control parameters that are considered as the tuning vari-ables in the fuzzy tuning scheme. Using this methodology, the mapping between each fuzzy tun-ing variable and each system performance attribute is developed. The heuristics of the S M C tuning is investigated, as shown in Table 4.10. The linguistic rules for S M C tuning are summa-rized in Table 4.11. Action for performance improvement Context / Performance attribute Ks P Control Signal Oscillation (OSC) Decrease No Change (or slightly decrease) System Stability (PHM) Decrease Decrease Tracking Accuracy (TRE) No Change (or little decrease) Increase (Decrease when the system become unstable) Table 4.10 : Knowledge-based guideline for S M C tuning Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 114 (1) OSC -- Oscillation in Control Signal Condition Action if osc = HIUN then DKS = N L and DRHO = NS or if osc = L I U N then DKS = N M and D R H O = ZR or if osc = A C C P then DKS = ZR and DRHO = ZR or if osc = LIOQ then DKS = PS and DRHO = ZR or if osc = HIOQ then DKS = P M and DRHO = PS (2) PHM - System Stability Condition Action if P H M = HIUN then DKS = N M and DRHO = N M or if P H M = L I U N then DKS = NS and DRHO = N M or if P H M = A C C P then DKS = ZR and DRHO = ZR or if P H M = LIOQ then DKS = ZR and DRHO = PS or if P H M = HIOQ then DKS = PS and DRHO = P M (3) TRE -- Position Tracking Accuracy Condition Action if T R E = HIUN then DKS = NS and DRHO = N L or if TRE = L I U N then DKS = ZR and DRHO = N M or if TRE = A C C P then DKS = PS and DRHO = PL or if TRE = LIOQ then DKS = PS and DRHO = PS or if TRE = HIOQ then DKS = ZR and DRHO = ZR Table 4.11 : Rule-base table for S M C tuning 4.5.3. Composite fuzzy relation table In the fuzzy rule-base table, each fuzzy state of the condition variables is linked to the corre-sponding fuzzy quantity of the tuning variables through the fuzzy implication (IF-THEN). In fuzzy logic theories, the I F - T H E N operation for two fuzzy sets can be interpreted as a min opera-tion on the corresponding membership functions. The membership function of this fuzzy relation for each individual rule is expressed as [23], MRi (COND, ACT) = min| / / A . (COND), juc. (ACT)] (4.6) where A,- is a fuzzy state corresponding to the condition variable COND and C, is a fuzzy state representing the action variable ACT . The subscript"/" denotes the index of the rule in the rule-Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 115 base table. For each individual rule, the membership function of the corresponding fuzzy state for the condition variable is formed as a column vector. Similarly, the membership function of the corresponding fuzzy state for the action variable is formed as a row vector. Using a min operation on these membership grades, the fuzzy relation table between these two membership functions in Cartesian product space is established by taking the lower value of each pair of membership grades. The general expression of the fuzzy relation table for each individual rule is given as fol-low: HR. (COND, ACT) = min 81 82 COND=Aj '[hi I12 ACT=Ci (4.7) p:R. (COND, ACT) = m i n i f y ) min(g,,/i2) min(g 2 ,fy) min(g 2 , / i2) m i n ( g 2 , / i „ ) mini KgmA) minCSmA) ™in(gm,hn)\ACT=Ci COND=Aj (4.8) where g ;- (i.e. j = 1,2, • • •, m ) and hk (i.e. k = 1,2, • • •, n) are the membership grades in the mem-bership functions of Ai and Q , respectively, m is the number of fuzzy states in the condition variable COND and n is the number of fuzzy states in the action variable ACT . Then, the individual rules in the rule-base table are joined through E L S E connective which corresponds to a union operation (OR connective). In fuzzy logic theories, the O R operation can be interpreted as a max operation on the corresponding membership functions. Therefore, the resulting composite fuzzy relation table between the condition variable COND and the action variable ACT is expressed as: Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 116 juR (COND, ACT) = max[uRj (COND, ACT)] (4.9) where NR is the total number of individual rules relating COND to ACT . By comparing each element of the fuzzy relation tables for individual rules, the maximum of the membership grades corresponding to each pair of condition-action states is chosen. Using a similar fashion, the com-posite fuzzy relation tables between all condition and action variables are constructed for the pro-posed S M C auto-tuning system. These tables are given in Appendix F. 4.5.4. Fuzzy decision table Once the composite fuzzy relation tables are developed, the fuzzy decision table is developed by matching the inference of system performance response (i.e. condition values) to the compos-ite fuzzy relation tables, through the use of the compositional rule of inference. The general expression for the compositional rule of inference is given as, / / c =sup-min(/ / D , / %) (4.10) where juc , jUD, and fiR are the membership functions of the fuzzy output variable (fuzzy set C), the context data or fuzzy input variable (fuzzy set D), and the knowledge base (relation R), respectively. Considering Eq. (4.10), the sup operation can be represented by the max operation in fuzzy logic theories. In the use of a sup of min operation, the membership function vector of the condition variables should first be compared with each column of a fuzzy relation table. Then, the lower value in each pair of compared elements is taken. This action corresponds to the min operation in the composition rule of inference. For each column, the largest value of the vec-tor elements are selected, and thus resulting in a row vector. This action represents the sup (or max) operation in the composition rule of inference. This resulting vector relates to the control inference in a fuzzy form. In order to obtain a crisp value that determines the degree of tuning action, a defuzzification is applied using a discrete centroid method: Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 111 Scr//C(c,-) c = I>c(c;) where c is the crisp output corresponding to the final aggregated set. S denotes a support set corresponding to the control inference C . Using a similar fashion, the overall decision table for the proposed S M C tuning in feed drive servos is established, as shown in Table 4.12. Based on this fuzzy decision table, the tuning actions are decided according to the current system perfor-mance attributes (OSC, P H M , and T R E ) . These tuning actions may be scaled by a sensitivity fac-tor, if necessary. The formulation used for updating the S M C parameters is expressed as, P = P + ^ 1 new old P ' sen (3(OSC,PHM,TRE) ^ XPold i=l (4.12) where Pnew corresponds to the new parameters after fuzzy decision making, and Pold corre-sponds to the old parameters needed to be adjusted. AfJ is the tuning action obtained from the fuzzy decision table. Psen is a sensitivity factor introduced for adjusting the sensitivity of tuning. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 118 Action Condition DKS DRHO OSC = HIUN -0.2545 -0.1552 LIUN -0.2456 0 ACCP 0 0 LIOQ 0.1552 0 HIOQ 0.2456 0.1552 PHM = HIUN -0.2456 -0.2456 LIUN -0.1552 -0.2456 ACCP 0 0 LIOQ 0 0.1552 HIOQ 0.1552 0.2456 TRE = EL -0.1552 -0.2545 LA 0 -0.2456 M E 0.1552 0.2545 SM 0.1552 0.1552 OK 0 0 Table 4.12 : Fuzzy decision table for S M C tuning 4.6. Simulation and experimental verification In order to verify the effectiveness of the proposed auto-tuning scheme for S M C in feed drive servos, several tests are conducted under different initial conditions. As the proposed Virtual C N C system is able to predict the feed drive control performance, these verification tests can be carried out in a virtual environment. 4.6.1. Simulation setup The proposed Virtual C N C system, corresponding to the F A D A L V M C 2216 C N C machine, is used as the test bed. The feed motion planning with a trapezoidal acceleration profiling is used for generating the reference axis trajectories. The physical feed drive parameters and the kine-Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 119 matic parameters can be found in Appendix D . In the verification tests, only the feed drive track-ing control system for X-axis, integrated with the proposed hierarchical fuzzy logic control, is demonstrated. In this particular case study, the desired sliding surface bandwidth A is pre-selected to be 200 [rad/sec] (around 30 [Hz]). A back-and-forth motion test is used as a reference input for system performance diagnosis. The length of traveled distance L and the desired fee-drate F are selected to be 100 [mm] and 200 [mm/sec], depending on the physical limits of the machine. The corresponding reference axis kinematic profiles for the back-and-forth motion test are given in Appendix G. In addition, the time duration for one cycle motion test is found to be around 1.28 [sec]. The sensitivity factor Psen is chosen to be 2 for adjusting the sensitivity of tuning. During the auto-tuning process, the feed drive control system is initially designed with a set of control parameters that gives a poor axis position tracking. Then, the drive moves along the X-axis to the desired position and comes back to the initial position. After each cycle, the perfor-mance attributes for O S C , P H M , and T R E are evaluated, and then fuzzified. For each of these attributes, a context value (i.e. discrete performance index) is obtained. Using these context val-ues, the appropriate tuning action is determined by the high-level fuzzy logic control, if required. This process is automatically repeated until the system performance is satisfactory. 4.6.2. First scenario -- Noisy control signal In the first case, the initial values of Ks and p are chosen to be 1 and 100, respectively. Although the tracking error is less than 0.010 [mm], this set of control parameters gives an unsat-isfactory control performance as the initial system response is very oscillatory (Fig. 4.11). In addition, the initial system response has a poor stability margin (Fig. 4.12). Experience indicates that this set of control gains is not acceptable and more appropriate tuning is required. By apply-ing the proposed auto-tuning scheme, the control parameters Ks and p have been fine-tuned adaptively. The corresponding system performance response and the evolution of context values during the auto-tuning process are shown in Fig. 4.11 and Fig. 4.12, respectively. The values of Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 120 Ks and p are tuned to be 0.363 and 47.16, respectively. After auto-tuning, the system response becomes more stable. The control signal and the tracking error profile looks more clean and desirable. The resulting maximum tracking error is 0.009 [mm] and the phase margin is found to be 42.2 [degree]. Furthermore, the time duration needed for this auto-tuning is around 6.4 sec-onds which corresponds to 5 cycles. It is much shorter than the time spent in finding an appropri-ate set of control parameters using manual tuning (i.e. trial-and-error approach). Initial System Response 0.6 0.8 time [sec] •=• 0.010 r 0.005 o fc LU 0 CO I -0.005 ro I 0.010 0.2 After Cycle #1 0.4 0.6 0.8 time [sec] 1.2 1.4 After Cycle #2 0.6 0.8 time [sec] •=• 0.010 r 0.005 L U 0 o I -0.005 ro I- -0.010 After Cycle #3 ! ' i ; j — — j - — 0.2 0.4 0.6 0.8 time [sec] 1.2 1.4 After Cycle #4 0.6 0.8 time [sec] After Cycle #5 (Satisfactory) 0.2 0.4 0.6 0.8 time [sec] 1.2 1.4 Figure 4.11 : Scenario 1) Noisy control signal — System response during auto-tuning process Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 121 0 2 4 6 0 2 4 6 cycle #, i cycle #, i Figure 4.12 : Scenario 1) Noisy control signal — Summary and evolution of context values during auto-tuning process Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 122 4.6.3. Second scenario -- System response with very high stability margin In the second scenario, the initial system performance is highly stable and over-qualified. According to this assumption, the initial values of Ks and p are chosen to be 0.01 and 1, respec-tively. With these initial control gains, the phase margin is found to be 76.3 [degree] that corre-sponds to have an over-qualified discrete performance index. In addition, the initial tracking error is up to 0.136 [mm]. Although the initial system response is very stable, the control parameters in the low-level direct control should be adjusted by the high-level fuzzy logic control in order to achieve the desired control objective. After auto-tuning, the control gains Ks and p are tuned, resulting in better tracking performance. Fig. 4.13 shows the system response during the auto-tuning process. Fig. 4.14 summarizes the context values for each tuning cycle. The values of Ks and p are fine-tuned to be 0.315 and 39.12, respectively. The resulting tracking error is drasti-cally reduced to 0.011 [mm]. Although the control parameters have been adjusted, the system sta-bility is still satisfactory. The corresponding phase margin and the gain margin are found to be 44.2 [degree] and 12.6 [db], respectively. After 27 cycles, the system performance reaches the desired level and no more tuning action is required. In this particular example, the time duration needed for tuning the control parameters is around 34.5 [sec]. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 123 Initial System Response 0.6 0.8 time [sec] After Cycle #3 0.6 0.8 time [sec] •E- 0.100 r o.o5o L U -0.050 -0.100 After Cycle #6 0.6 0.8 time [sec] 1.2 1.4 •H- 0.100 0.050 0 -0.050 -0.100 0.2 After Cycle #9 0.4 0.6 0.8 time [sec] 1.2 1.4 0.040 After Cycle #12 0.6 0.8 time [sec] After Cycle #15 0.6 0.8 time [sec] 0.020 0.010 0 -0.010 -0.020 0.2 After Cycle #18 \ ; ; . L J L i .^ : ' i lr ] j 0.4 0.6 0.8 time [sec] 1.2 1.4 After Cycle #21 0.6 0.8 time [sec] •E- 0.015 E 0.010 5 0.005 w 0 . i -0.005 t -0010 H -0.015 After Cycle #24 0.2 0.4 0.6 0.8 time [sec] 1.2 1.4 •E- 0.015 E, 0.010 5 0.005 L U 0 § -0.005 t "0010 H= -0.015 After Cycle #27 (Satisfactory) I. i_. . ' ] 0.2 0.4 0.6 0.8 time [sec] 1.2 1.4 Figure 4.13 : Scenario 2) High stability margin - System response during auto-tuning process Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 124 cyc le #, i cyc le #, i cyc le #, i 0 10 20 30 0 10 20 30 cyc le #, i cyc le #, i Figure 4.14 : Scenario 2) High stability margin - Summary and evolution of context values during auto-tuning process Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 125 4.6.4. T h i r d scenario -- Unstable system response In order to demonstrate the effectiveness of the proposed auto-tuning scheme that can be used as an auto-tuner in the control design stage, the initial system response is considered to be unsta-ble in the last scenario. The initial values of Ks and p are randomly chosen to be 10 and 10000, respectively. With these initial control gains, the Nyquist curve encircles the critical point [-1,0]. Some of the zeros and poles in the closed-loop control system are found to be outside a unit circle, in the discrete time domain. This initial parameter selection is definitely unacceptable in the con-troller design and the corresponding system performance is highly unsatisfactory. Because of this improper initial setting, a tuning of the control gains is required. In this extreme case, the test can only be conducted in a virtual platform, due to the unstable system response. Fig. 4.15 shows the system response during the auto-tuning process. Fig. 4.16 shows the evolution of the context val-ues with the tuning cycles. After auto-tuning, the control gains Ks and p are found to be 0.269 and 37.16, respectively. The system response becomes stable. The resulting phase margin and gain margin are calculated to be 44.8 [degree] and 13.2 [db] which are in the desired ranges. Fur-thermore, the tracking performance is satisfactory as the maximum tracking error is found to be around 0.012 [mm]. In this particular case, 42 cycles are required to fine-tune the control param-eters. The corresponding time duration for the auto-tuning process is around 53.7 [sec] which is still negligible compared to manual tuning. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 126 t ID Initial System Response 0.6 0.8 time [sec] 1.2 1.4 300 200 100 0 f -100 o -200 CD H -300 E JE 1 L U 0.2 After Cycle #5 1 !_ i ^ ^ ~ \ ~~ j i ^ \ _ . . . . ! 1 1 1 0.4 0.6 0.8 time [sec] 1.2 1.4 After Cycle #10 0.6 0.8 time [sec] 1.2 1.4 t L U After Cycle #15 0.6 0.8 1 time [sec] E E, I LU 0.010 0.005 0 -0.005 -0.010 After Cycle #20 ." y' i i l l ! 0.2 0.4 0.6 0.8 1 time [sec] 1.2 1.4 0.020 E r 0.0101— i L U 0 o> | -0.010 CD H -0.020 f|Vv—< 0.2 After Cycle #25 0.4 0.6 0.8 time [sec] 1.2 1.4 After Cycle #30 0.6 0.8 time [sec] •j? 0.020 r 0.010 g L U 0 D ) | -0.010 co I- -0.020 l / -0.2 After Cycle #35 0.4 0.6 0.8 time [sec] 1.2 1.4 •j? 0.015 E, 0.010 After Cycle #35 0.015 E, 0.010 | 0.005 L U 0 .c -0.005 I -0.010 K -0.015 After Cycle #42 (Satisfactory) 0.2 0.4 0.6 0.8 time [sec] 1.2 1.4 Figure 4.15 : Scenario 3) Unstable system — System response during auto-tuning process Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 127 0 10 20 30 40 50 60 0 10 20 30 40 50 60 0 10 20 30 40 50 60 cyc le #, i cyc le #, i 0 10 20 30 40 50 60 0 10 20 30 40 50 60 cyc le #, i cyc le #, i Figure 4.16 : Scenario 3) Unstable system — Summary and evolution of context values during auto-tuning process The simulation results for these three scenarios are summarized in Table 4.13. These results prove that the proposed auto-tuning system is not only able to handle the cases with different ini-tial conditions, but consistency and robustness are also accomplished. Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 128 Simulation results Scenario 1 Scenario 2 Scenario 3 Pre-selected A, [rad/sec] 200 200 200 Initial/Fine-Tuned Ks, [V/(mm/sec)] 1 / 0.363 0.01 / 0.315 10 / 0.269 Initial / Fine-Tuned p , [V/mm] 100 / 47.16 1 / 39.12 10000 / 37.16 Total number of cycles required 5 27 42 Time duration for auto-tuning [sec] 6.4 34.5 53.7 Initial / Final maximum tracking error, [mm] 0.009 / 0.009 0.136 / 0.011 Unstable / 0.012 Table 4.13 : Summary of simulation results for three scenarios 4.6.5. Experimental validation In order to validate the resulting control parameters tuned by the proposed auto-tuning pro-cess, an experimental validation for each set of fine-tuned parameters is carried out. The experi-mental results are shown in Fig. 4.17 and the summary is given in Table 4.14. These results indicate that the resulting control parameters, after auto-tuning, yield good tracking performance. For each case, the maximum tracking error measured from the experimental result is less than 0.015 [mm]. This experimental validation proves that the direct in-loop controller is fine-tuned regardless of initial control parameters using the proposed auto-tuning scheme. Experimental results Scenario 1 Scenario 2 Scenario 3 A, [rad/sec] 200 200 200 Ks, [V/(mm/sec)] 0.363 0.315 0.269 p , [V/mm] 47.16 39.12 37.16 Maximum tracking error, [mm] 0.00929 0.01155 0.01277. Table 4.14 : Summary of experimental validation for three scenarios Chapter 4. Auto-Tuning Using Fuzzy Logic Hierarchical Control 129 "E 1 E I LU C D C IS o CO 0.010 0.005 0 -0.005 -0.010 -0.015 experiment simulation o 0.2 0.4 0.6 0.8 Time [sec] (a) 1.2 " 0.015 E E. I— I LU D ) C XL O CO 0.0101-0.005 u > -0.005 • -0.010 r -0.015 y experiment simulation 0.2 0.4 0.6 0.8 Time [sec] (C) 1.2 1.4 1.4 r— 0.015 E 0.010I-O 0.005 LU 0 c -0.005 " -0.010 CO f~ -0.015 experiment simulation 0.2 0.4 0.6 0.8 Time [sec] 1.2 1.4 (b) Figure 4.17: Experimental validation for control parameters after fine-tuning — (a) 1st scenario, (b) 2nd scenario, (c) 3rd scenario Chapter 5 Reference Toolpath Modification F o r Cornering Motion 5.1. Overview In this chapter, a methodology for improving the feed drive performance at cornered contour-ing motion is presented in detail. Typically, the most critical geometric error usually occurs at sharp corners where large transients in reference trajectory occur. Fig. 5.1 shows the contouring errors against the toolpath with various cornered angles. Due to the reversal of motion that occurs in the tracking of sharp corners, the feed direction becomes different after crossing the sharp cor-ner. This sudden change in feed direction may not only induce the discontinuity of friction torque at zero velocity crossing, but it may also excite the natural modes of the mechanical structure and servo control system. In addition, the large transients for acceleration and deceleration at sharp corners lead to high frequency harmonics in reference input. Consequently, it may result in degrading the axis tracking performance, and thus contouring accuracy. In order to improve the feed drive performance in tracking cornered toolpath, the reference toolpath is modified by fitting a small curve at the corners (i.e. transition points), as shown in Fig. 5.2. With the proposed refer-ence toolpath modification, the feed direction can continuously change at the transition points, resulting in better tracking at the corners. In this proposed methodology, a quintic spline is cho-sen to smooth the sharp corners. In Section 5.2, the scheme of quintic spline toolpath generation is presented. The technique of parameterization and interpolation for quintic spline are also reported in this section. In order to determine the quintic spline coefficients and the total length of the composite spline, the boundary conditions at the control knots should be evaluated. The sys-tematic way to define the coordinates of the reference knots for spline fitting at the corners and the derivatives at the knots is presented in Section 5.3. The analytical determination of the feed 130 Chapter 5. Reference Toolpath Modification For Cornering Motion 131 traveled along the spline toolpath is presented in Section 5.4. In order to consider more general case, an algorithm for modifying a composite reference toolpath (i.e. with multiple toolpath seg-ments) is presented in Section 5.5. Experimental verification is carried out in Section 5.6. reference \ 36 reference 35 X S actual / actual 34 34 35 36 37 84 85 86 30 — 20 co > 10 o--10 — reference - - Actual 0- O" Pstart 0 10 20 30 40 50 60 70 80 X-axis [mm] 0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 time [sec] Figure 5.1 : Contouring errors against toolpath with various cornered angles start Pend Original Reference Toolpath transition Figure 5.2 : Modified reference toolpath associated with small curve at corner Chapter 5. Reference Toolpath Modification For Cornering Motion 132 5.2. Quintic spline toolpath generation In quintic spline toolpath generation, the objective is to connect a series of reference knots (or called control knots) with a series of fifth-order spline segments. The splines are constructed in such a way that the first and second derivatives are preserved and continuous at the knots along the overall composite curve. The overall process in generating a quintic spline toolpath is shown in Fig. 5.3. Typically, the toolpath generation for quintic spline consists of two major parts: parameterization and interpolation. In spline parameterization, the raw knot coordinates are first defined. Then, the first and second derivatives at the knots and the chord lengths between the consecutive knots are analytically determined in order to evaluate the spline coefficients for each spline segment. In the mechanism of trajectory generation used in C N C executive, the traveled distance along the toolpath is known in advance, so that the kinematic profiles of the spline tool-path is developed. The length for each spline segment is estimated by approximating its chord length. By superposing all spline segment lengths together, the total travel length of the compos-ite spline toolpath is obtained. Using spline interpolation algorithm, the reference axis coordi-nates of the spline toolpath are generated. Quintic Spline Parameterization ^ Initial parameterization ^ 41 Boundary conditions (coordinates of control knots, 1st and 2nd derivatives at knots) 4 1 ~ ~ f Approximation of spline segment length J 41 ^ (^ Evaluation of quinitc spline coefficients ^ ) Quintic Spline Interpolation (^interpolation of composite quintic spl inej) (Veed motion planning) Geometric displacement j commands ) Figure 5.3 : Overall scheme of quintic spline toolpath generation Chapter 5. Reference Toolpath Modification For Cornering Motion 133 5.2.1. Quintic spline parameterization In general, a quintic spline segment connecting two control knots, in Cartesian space, can be expressed by a fifth-order polynomial as follows [27], S,(u) = Aru5+Bi -w4 +C( •u3+Di •u2+Ei-u + F{ (5.1) where S ,•(«) = Bxi r • ^Xl Dxi ; 4 = Ayi ; *,• = ; c{ = r • Dyi Jzi. Czi. Pzi. 'Fxi~ Ayi ; Fi = Fyi _v fzi_ (5.2) Sxi, Syi, and Szi are the axis position polynomials for the ith spline segment fit between the two consecutive control knots /?,• (x;-, yt, z(-) and Ri+l (xi+l, y,-+1, ) (Fig. 5.4). Ai, Bt, C{,..., F{ are vectors containing the spline coefficients for each axis coordinate, corresponding to the ith spline segment St. u is the spline parameter that is inclusively bounded between zero and the spline segment length . Since there are six unknown coefficients in a quintic spline polynomial given in Eq . (5.1), six boundary conditions are required to evaluate them. These six boundary conditions are the coordinates of the two consecutive control knots ( Rt, Ri+l), the first deriva-tives (i?" , R"+l), and second derivatives (R" u , R"^) at these two knots. Ri+l(Xi+1, zi+l) » R N Figure 5.4 : Composite quintic spline defined by N control knots Chapter 5. Reference Toolpath Modification For Cornering Motion 134 For simplicity, these boundary conditions for each spline segment can be further expressed in a vector form, Pi=Si(uiu=o=Ri = 3x1 dS; (u) t; = L L J -du = R? = u=0 -y,i -z,i Pi+i = Si(u)\u=h =RM - _dSt(u) H+\ du — p " — - Ki+l -_d%(u) du2 u=0 3x1 Z,l . z«+i. lx,i+l ry,i+l 3x1 _d2Sj(u) du2 - Ki+l ~ 3x1 3x1 nx,i+l ny,i+l nz,i+l 3x1 (5.3) where pt and are the position vectors corresponding to the axis coordinates of two consec-utive knots. tt and are the tangent vectors corresponding to the first derivatives at the knots R( and RM . n,- and hi+l denote the normal vectors corresponding to the second derivatives at the knots. Differentiating Eq. (5.1) with respect to the spline parameter u gives the first and second derivative profiles of the quintic spline as, ?^^ = 5-Aru4 +4-Bru3 +3-Cru2 +2-Dru + Ei du d2Si(u) = 2 Q A ^ u 3 + U . B . . U 2 +e.Cru + 2-Di du (5.4) By substituting the boundary conditions into Eq. (5.1) and (5.5), the spline coefficients A{,BhCi,...,Ft can be analytically solved: Chapter 5. Reference Toolpath Modification For Cornering Motion 135 i C , . = i - \0-(pi+x-pi)-(Afi+x+6-ti)-li+c]--nM~-li (5.5) The boundary conditions ( pt, p M , tt, tM , ht, and hi+l) and the spline segment length should be known in order to determine the spline coefficients. The evaluation of the boundary conditions for the add-in quintic spline toolpath is discussed in Section 5.3. Therefore, the only unknown term is the spline segment length . Usually, the spline is parameterized with respect to the chord length between two consecutive reference knots (R t , Rj+l). In this chord length parameterization, the length of a spline segment is approximated to be a straight line between the two consecutive knots: linear chord length parameterization =>/,• ~^(xM - xt)2 +(y,-+i - y , - ) 2 +(z ( + 1 - z , ) 2 (5-6) However, the spline segment length is better estimated by assuming an arc length instead of a straight line, due to the discrepancy between the chord and arc lengths. When the spline is parameterized by its arc length, it must have a unit tangent vector along the spline segment [1]. In order to obtain a closed arc length with respect to the spline segment, the deviation between the arc length and the spline parameter throughout the spline segment should be minimized. The least square solution is expressed as, (5.7) Chapter 5. Reference Toolpath Modification For Cornering Motion 136 Wang and Yang [75] pointed out the difficulty to solve the above objective function analyti-cally with respect to the spline segment length . Therefore, they proposed a near-arc length parameterization by considering the mid-point of the chord: dS, du h u=± = 1 (5.8) 2y Solving Eq. (5.8) gives the analytical solution with respect to the spline segment length /• as, a0 • /,-4 + a, • / ; 3 + a2 • I2 + a3 • /,• + a 4 = 0 (5-9) where a0 = (ni+l - nt f • (hi+1 - n{); a, =-28-(hi^-riiY - ( j M + h ) a2 =-1024 + l96-{tM+ti)T-{tM +ti) + 120ipi+l-pifini+l-ni) a 3 = -1680 • {pM - Pif -(ti+l+ti) a4 = 3600 • (pi+l - pi f • {pi+l - pi) where the superscript "T' denotes the vector transpose. Using Newton-Raphson's method, Eq. (5.9) can be solved iteratively. The coefficients a,- of the polynomial for spline segment length can be determined using the feasible knowledge of the boundary conditions at the two consec-utive knots. Once the spline segment length is estimated and the boundary conditions are known, the quintic spline coefficients can be evaluated from Eq. (5.5). In addition, the total length of the composite spline L s is calculated by summing up the segment lengths, AM AM i=i /=i where st is the actual arc length of the ith spline segment and N is the total number of reference control knots. In order to perform the feed motion planning along the quintic spline toolpath, the numerical value of the total travel length of spline L s is required. Chapter 5. Reference Toolpath Modification For Cornering Motion 137 5.2.2. Quintic spline interpolation with minimum fluctuation Typically, a quintic spline interpolation with constant spline parameter increment Au results in significant feedrate fluctuations due to the difference between the chord and arc lengths. In order to minimize the feedrate fluctuations in spline interpolation, an iterative interpolation tech-nique [27] is applied. In this spline interpolation algorithm, the spline parameter increment is adjusted recursively to realize a desired displacement magnitude (i.e. desired path increment Asdes) at each interpolation step, so that the feed fluctuations could be avoided. 5.2.2.1. Iterative spline interpolation method Once the total length of the composite spline toolpath is evaluated, the resulting kinematic profiles for the spline toolpath can be analytically developed using the mechanism of trajectory generation, which has been discussed in Chapter 3. For each interpolation period, the desired path increment can be achieved using the information of the spline toolpath displacement profile s(t). Therefore, the desired path increment for each interpolation step, Asdes •, can be described as fol-lows, tedesj=s(TJ+l)-s(Tj) where Tj+l = 0' +1) •7] n t and Tj = (j) • 7 j n t <= j = 1,2,3,• • •, Ntotal where 7] n t is the interpolation sampling period and Ntola[ is the total number of interpolation step required for realizing the total time duration of the motion for spline toolpath. In general, the path increment can be approximately defined in terms of axis increments: As = ^ Axf+{Ayf+{Azf (5-12) where A x , Ay , and Az are the axis increments. Considering Eq. (5.12), the reference position commands for ith spline segment S ; , at each interpolation step, can be numerically evaluated as, Chapter 5. Reference Toolpath Modification For Cornering Motion 138 where Axtj = xtJ - x^_x, AytJ = ytJ - y ; > j M , AztJ = z{J - zitj-i (5.13) Pi j-i »yi j-i»Z{ j-i) is the previous reference point that was computed and Pt j(x; j,yt j,Zj j) is the current reference position coordinate, in Cartesian space. Considering Eq. (5.1), the spline toolpath is parameterized in terms of the spline parameter increment u ; therefore, the current reference point P{ j of spline segment 5, can be expressed as, xi,j = AxiuiJ + Bxiuif + Cxiui,/ + Dxiui,j2 + ExiuiJ + Fxi yi,j = AyiuiJ + Byiui,f + CyiuiJ + Dyiui,j2 + Eyiui,j + Fyi Zij = Aziui,/ + BziuiJ4 + Cziui,j3 + DziuiJ2 + EziuiJ + Fzi (5.14) Since the previous reference position P-j-i(x{>;-_i,y,-j-\,Zij_i) and the spline coefficients A,-, F(- are known, the new chord parameter ulr • is computed in such a way that the desired path increment Asdes is realized. Combining Eq. (5.13) and (5.14), a tenth-order polyno-mial with respect to the new chord parameter ut y- can be obtained as, (5.15) where the coefficients at are expressed in terms of the spline coefficients, the previous reference point, and the desired path increment as [27]: g(utJ) = a 0 - u i } w + ax • Uif + a2 • u t J s + — + al0 Chapter 5. Reference Toolpath Modification For Cornering Motion 139 ^ ~ 4» + + Azi <*\ = 2(Axi • Bxi + Ayi • Byi + Azi • Bzi) a2 = Bxi2 + B 2 + B 2 + 2(Axi • Cxi + Ayi • Cyi + Azi • Czi) a3 = 2(Bxi • Cxi + Byi • Cyi + Bzi • Czi + Axi • Dxi + Ayi • Dyi + Azi • Dzi) aA = C 2 + Cy2 + C 2 + 2(Axi • Exi + Ayi • Eyi + Azi • Ezi + Bxi • Dxi + Byi-Dyi + BzrDzi) ®5 = 2Wi • (Fxi ~ xiJ-l) + Ayi • (Fyi ~ yi,j-l) + Azi • (Fzi ~ ) + Bxi • Exi + Byi • Eyi + Bzi ' Ezi + Cxi ' Dxi + Cyi " Dyi + C z i " Dzi 1 > ( 5 1 5 ) a6 = D 2 + D 2 + D 2 + 2[Bxi • (Fxi - ) + Byi • (Fyi - ) ~KBzi ' (Ezi ~ zi,j-i)+ Cx{ • Exi + Cyi • Eyi + Czi • Ezi ] a7 = 2[Dxi • Exi +Dyi • Eyi +Dzi • Ezi + Cxi • (Fxi -xiJ_l) + Cyi • (Fyi - y ^ ) + Czi-(Fzi-zij-1)] <h = Exi2 + Eyi2 + Ezi2 + 2iDxi • (Fxi ~ XitH ) + Dyi • (Fyi - y,-y_j) + Dzr(Fzi-zUH)} a9 = 2iExi • (Fxi - xitj_x) + Eyi • (Fyi - yUj_x)+ Ezi • (Fzi - zithl )J «10 = (Fxi ~ Xi,j-l)2 + (Fyi - ViJ-l)2 + (Fu ~ ZiJ-l)2 ~ {^des f This tenth-order polynomial g(ut j) can be solved iteratively using Newton-Raphson's method with a close initial guess of the spline parameter uinit • This initial guess uinit is chosen as the previous chord parameter «• -_ j . Once the new chord parameter utj is obtained, the cur-rent reference position Pt j(xt j, y,-j, z,- 7 ) of the ith quintic spline segment can be evaluated from Eq. (5.14). Using this iterative interpolation technique, the reference axis commands for the whole quintic spline toolpath are generated. For simplicity, the reference velocity and accelera-tion trajectories for each axis are simply estimated from the reference position commands using the Euler technique. With this approach, the feedrate fluctuations arising from the spline interpo-lation with constant parameter increment can be avoided as the desired path increment is accu-rately maintained in the spline toolpath generation. Chapter 5. Reference Toolpath Modification For Cornering Motion 140 5.3. Development of boundary conditions for add-in quintic spline As mentioned earlier, the boundary conditions for each quintic spline segment, such as the coordinates of the reference knots, first and second derivatives at the knots, should be identified in order to determine the spline coefficients and the total length of the composite spline. A system-atic methodology to define the control knots for the add-in spline as well as the derivatives at the knots are investigated and it is presented in the following sub-sections. 5.3.1. Control knots for add-in spline toolpath In practice, the geometric deviation between the modified toolpath and the original toolpath cannot be too large; otherwise, the desired part geometry would be destroyed. Therefore, the tool-path should be modified in such a way that it is constrained by the specified part tolerance in order to preserve the desired toolpath geometry. According to this assumption, one of the control knots for the add-in spline, called delta control knot RA , can be identified by considering the part toler-ance limit. In fact, there are two approaches to determine the coordinate of RA . The first approach is called the under-corner method where the spline is inserted under the corner. The second approach is called the over-corner method where the spline is added over the corner. These two approaches are illustrated as follows: Figure 5.5 : Methodology for fitting spline at corner - (a) under-corner approach, (b) over-corner approach Chapter 5. Reference Toolpath Modification For Cornering Motion 141 In Fig. 5.5, Pstart and Pend are the reference starting and ending tool positions for cornered motion. Ptran represents the tool position at the corner (i.e. transition point). These coordinates pstart(xs>ys>Zs)' Ptran(xt»z,), Pend(xe,ye,ze) are assumed to be known in advance. Before defining the coordinate of RA , the normalized tangent vectors of the original cornered toolpath segments (i.e. path vectors P1ranPstart and PtranPend ) are first defined: P P 1 tran1 start P P 1 tran1 start (xs-xt)-i + (ys-yt)-j + (zs-z,)-k j(xs-xt)2+(ys - y,)2+(zs-zt)2 = xts-i + y,s-j + zts-'k = . PtranPend _ (xe ~ xt) '» + (?e ~ 3>t) ' J + JZe ~ Zt)k _ ^  'te — II „ „ ll - / 7. ^ T — te ' ' /te J T ^ l | p t « « p ^ l ^(xe-xt)2+(ye-yt)2+(ze-ztY (5.17) where r w is the unit path vector from Ptran to P s t a r t , and rte is the unit path vector from Ptran to P e w J . The unit bi-normal vector bt, bisecting the corner angle ZPstartPtranPend , is also deter-mined as, r rts+rte _(xts+xte)-i + (yts + yte)-3 + (Zts+Zte)-k _ y j , v j , 7 k + xte) +(yts+yte) +(Zts+Zte) (5.18) The position vector pA of spline control knot RA is identified as (Fig. 5.6), P& = Ptran+k•bt=x^•i + y^•i + z^•'k Ptran =x t - i + y t - i + Z t - k A - Kp -SA -ep 5Ae[0,l] (5.19) where ptran is the position vector of the transition point Ptran and ep is the specified part toler-ance. ep denotes the specified part tolerance. SA is introduced to adjust the maximum desired geometric deviation, called A , between the modified toolpath and the original toolpath. The value of SA should be bounded inclusively by 0 and 1, so that A will be always within the spec-Chapter 5. Reference Toolpath Modification For Cornering Motion 142 bi-normal of /L PstartPtranPend R A ( x A > YA> Z A ) ( u s i n 9 'over-corner' approach) Ptran ( xt' Yt> zt)~-—i^ A ^ A ( x A ' yA' z A ) ( u s i n 9 'under-corner' approach) Pstart (xs> Vs< z s ) Figure 5.6 : Spline control knot RA The next step is to define the starting and ending coordinates of the add-in spline toolpath fit at the corner. In practice, it is always possible to perfectly fit a circle with a pre-specified radius, rsp , inside the corner (Fig. 5.7a). These tangent points, where the circle touches the edges of the corner, are considered as the starting and ending control knots for the add-in spline. The radius rsp can be solved systematically by considering the cornered angle, f3, and the shortest distance, dc , between the circular arc and the transition point Ptran . The cornered angle (3 can be real-ized from the coordinates Pstart, Ptran , and Pend . The value of dc can be determined by intro-ducing the following relationship: where rd is a pre-defined ratio used to adjust for the shortest distance dc. From experience, the distance dc must be greater than the maximum desired geometric deviation A ; otherwise an improper spline may be generated. Therefore, the ratio rd should be chosen to be above 1. dc=rd-A <= rd>l (5.21) Chapter 5. Reference Toolpath Modification For Cornering Motion 143 Once J3 and dc are defined, the radius rsp is calculated as, sin(/?/2) J (5.22) s p l - s i n ( ^ / 2 ) After the radius of the circular arc is identified, the position vectors of the starting and ending knots ( Rsc(xsc,ysc,zsc), Rec(xec>yec>Zec)) f ° r t n e add-in spline, i.e. tangent points, are defined as (Fig. 5.7b), Psc ~ Ptran + ((rsp + ^ c ) rsp )' rts ~ xsc ' 1 + ' J + zsc ' ^ (5.23) Pec - /WJ + +^c) 2 _ r 5 p 2 ) ' 'fe -xec'*+yec'i+zec'k The position vector of the center Pcen(xcen, ycen, zcen) of the circle can be also written as, Pcen = Ptran +dc-Bt= Xcm • \ + ycm • j + Zcen • k (5.24) tangent points To-tran end start (a) (b) Figure 5.7 : Starting control knot Rsc and ending control knot Rec for add-in spline Although a spline can be implemented through three specified reference knots i? A , Rsc, and R e c , two more reference knots are required in order to obtain a better spline fitting. These two new reference knots are assumed to be fully dependent on the three pre-defined control knots (RA , Rsc , Rec), as well as, the transition point ( Ptran ). The first new reference knot, Rsm , can Chapter 5. Reference Toolpath Modification For Cornering Motion 144 be realized from the coordinates of RA , Ptran , and Rsc . Similarly, the second new reference knot, Rem , can be identified from the coordinates of i? A , Ptran , and Rec . In order to define the coordinate of Rsm , the mid-point, M^ , between RA and Rsc , as well as, the mid-point, Mts , between Ptran and Rsc are first evaluated, as shown in Fig. 5.8a: MAS = Mts = R A + R s 2 r xA+xs yA + ys ZA + ZS^ V 2 ' 2 ' 2 f xt+xs yt + ys zt + zs _r mid mid mid \ - \xAs ' y&s ' zAs > , mid ..mid mid\ \xts ' yts > zts > (5.25) Then, the first new reference knot Rsm is assumed to be the mid-point between M^ and Mts, as shown in Fig. 5.8b: 2 ( mid , mid Ymid , mid mid , mid ^  xAs ' xts xAs "*" xts xAs "*" xts V (xsm' ysm' zsm ) (5.26) i-e- Psm = Xsm + V S I M " j+ Zsm -k where p i w denotes the position vector of the reference knot Rsm . The other new reference knot Rem can be obtained using a similar fashion. Therefore, the mid-point, MAe, between RA and Rec , as well as, the mid-point, Mle , between Ptran and Rec are expressed as, R*+R0 fxA+xe yA + ye zA + ze^ V -<vmid mid „midx - \ x A e ' ^ A e > z Ae / P -4- 7? «^ _ rtran "*" e _ , e ~ 2 ~ xt+xe yt + ye zt + ze _ l mid ..mid mid\ — \xte ' / fe > <-fe / (5.27) The other new reference knot Rem is defined as, = MAe+Mte 2 ( mid , mid mid , mid mid , mid \ •*Ae "*" xte xAe "*" -*fe -*-Ae "*" xte (xem' yem' ^em ) (5.28) i.e. pem xem • i + yem ' j + zem ' k Chapter 5. Reference Toolpath Modification For Cornering Motion 145 where psm corresponds to the position vector of the reference knot Rem . Once the coordinates of all control knots are realized, the boundary conditions of the first and second derivatives at the knots are identified in order to evaluate the spline length and the spline coefficients for each seg-ment. Figure 5.8 : Identification of control knots Rsm and Rem - (a) mid-points M A j and Mts, (b) control knots Rsm and Rem for add-in spline 5.3.2. Identification of derivatives at control knots Theoretically, the first and second derivatives at the control knots can be estimated by approximating a parabola between three consecutive knots, or estimated by fitting a cubic polyno-mial between four consecutive knots [1]. However, these techniques are not applicable due to the small number of control knots (i.e. 5 control knots only). Instead, the first and second derivatives (i.e. tangents and normals) at the knots are solved analytically using the feasible information such as the coordinates of reference knots ( Rsc , Rsm , RA , Rem , Rec), the center of the circle ( Pcen), the path vectors of the original toolpath segments ( rts, rte), and bi-normal vector (b t ) . Consid-ering Fig. 5.9a, the tangents at the starting and ending control knots should have same feed direc-tions along the original toolpath segments PstartPtran and PtranPend , respectively. Therefore, the Chapter 5. Reference Toolpath Modification For Cornering Motion 146 unit tangent tsc at the starting knot Rsc and the unit tangent tec at the ending knot Rec are expressed as, he ~ *ts ~ xts'* yts ' J zts ' k he = ^te ~ xte ' * + /^e ' J + zte ' ^  (5.29) Since the starting and ending control knots Rsc and Rec are defined as the tangent points between the circle with specified radius rsp and the corner paths, the unit normals at these two knots are considered to be the unit vectors towards the center Pcen of the circle from its points. Therefore, the unit normal nsc at the knot Rsc and the unit normal hec at the knot Rec are eval-uated as, Psc Pcen - _ Pec Pcen nec " 11 (xsc xcen) * (Xyc Veen) J (^sc c^en) 2 2 I  Pec Pcen II (•^ •ec ^cen) '^ (3^ ec ^ce/i) J (zec ^cen)'^ (^ ec — "^cen) (^ ec — ^cen) (^ ec — ^cen) (5.30) The tangent tA at the knot RA can be assumed to be the resultant unit vector of tangent tsc and tangent tec . The normal nA at the knot RA is equal to the bi-normal vector bt. Therefore, the expressions corresponding to the unit tangent tA and unit normal nA at the knot RA are: (~xts + xte) •1 + (~yts + yte) • J + (-Zts +Zte)-k V (~xts + xte ) 2 + ( " ^ + >re ) 2 + + z f c ) 2 ^c he _ . ^JC he (5.31) The tangent Fjm at the control knot Rsm can be determined by combining the tangent tsc at the knot Rsc and the tangent tA at the knot RA as: hm Wytsc+W2-tA Wrhc+W2-tA\ & n = Wvnsc+W2-nA (5.32) Chapter 5. Reference Toolpath Modification For Cornering Motion 147 where Wj and W2 are weighting factors that are introduced to adjust the weighting from the components of the tangents tsc and fA . For equal weighting, W± and W2 are equal to unity. Similarly, the normal nsm at the control knot Rsm can be determined by combining the normal nsc at the knot Rsc and the normal fiA at the knot RA . The unit tangent tem and the unit nor-mal nem at the knot R„m can be identified in a similar fashion as: Figure 5.9 : Identification of derivatives at control knots — (a) tangents and normals at Rsc , Rec , and RA , (b) tangents and normals at Rsm and Rem Once the first and second derivatives at the knots are determined, the quintic spline coeffi-cients, the spline segment length, and the total length of the composite spline toolpath are calcu-lated using Eq. (5.5), (5.9), and (5.10). 5.4. Determination of feedrate along add-in quintic spline toolpath In the proposed reference toolpath modification approach, the feedrate along the spline tool-path is assumed to be constant. In other words, the feed direction changes from one direction to another continuously at a constant rate. With this assumption, the desired path increment Asdes at each interpolation period becomes constant, resulting in less computational complexity for interpolating the spline. In order to maintain a constant feedrate along the add-in spline toolpath, Chapter 5. Reference Toolpath Modification For Cornering Motion 148 the magnitude of acceleration in the reference trajectory profiles changes due to the variations in the curvatures of the spline. At the highest curvature of the spline toolpath, the maximum acceler-ation occurs. In practice, the maximum acceleration cannot exceed the physical limit of the machine. Based on this constraint, the transition feedrate, Ftran , can be analytically determined using a simple iterative searching algorithm. 5.4.1. Transition feedrate iterative searching algorithm In the proposed transition feedrate searching method, an initial guess, Finit, of the transition feedrate is first set. In practice, the initial guess Finit is selected using simple linear interpolation technique between the cornered angle and the desired command feedrates along the original tool-path: where (3 is the cornered angle at the transition point, in [rad]. Fst is the desired command fee-drate from Pstan to Ptran , and Fte is the desired command feedrate from Ptmn to Pend . Once the initial guess is defined, the kinematic profiles for the add-in spline toolpath are developed using trajectory generation algorithms. By looking at the acceleration profile for the add-in spline, the magnitude of the maximum acceleration is realized. If the maximum acceleration is greater than the acceleration limit of the machine, then the new transition feedrate is updated by reducing the current transition feedrate to half. Otherwise, the new transition feedrate is evalu-ated by increasing the current transition feedrate by half. Once the acceleration condition is checked, the updated transition feedrate is applied to generate trajectories for the add-in spline toolpath again. By continuously checking the maximum acceleration, the resulting transition fee-drate can be solved iteratively until the change in the transition feedrate becomes insignificant. Due to the availability of a reasonable initial guess, this simple iterative searching method usually converges within several iterations. init 1 st T 1 te I 2 J (5.34) Chapter 5. Reference Toolpath Modification For Cornering Motion 149 5.5. Modification of composite reference toolpath For a more general case, a reference toolpath composed by multiple toolpath segments, shown in Fig. 5.10, is considered. The algorithm to modify the multi-segment reference toolpath using the proposed toolpath modification technique is outlined in Fig. 5.11. The whole reference toolpath is assumed to be constructed by N reference points. Therefore, JV-1 toolpath seg-ments are found. By checking the geometric profiles for each toolpath segment, the availability of the corner between the current and next toolpath segments is identified. For example, if the current and next toolpath segments are both linear, it indicates that a corner may occur between the current and next toolpath segments. However, these two toolpath segments may be parallel to each other. In this critical case, no corner is found between them and modification is not neces-sary. If a cornered angle between the current and next toolpath segments is found to be less than 180 [deg], then the current toolpath segment is resolved by combining a linear toolpath and a small quintic spline toolpath. In the proposed toolpath modification, the tool first moves linearly from the current position to the position where the starting knot of the add-in spline is located. Then, the tool continuously moves along the pre-defined add-in spline path with a constant transi-tion feedrate, using either the under-corner approach or the over-corner approach. By checking each toolpath segment iteratively, the whole composite reference toolpath is systematically modi-fied. PN-1 Y 4 X Pi Figure 5.10 : Composite reference toolpath with multiple toolpath segments Chapter 5. Reference Toolpath Modification For Cornering Motion 150 ^ Reference points for commanded tool positions - P 2 P, PN ^ c Number of toolpath segments, M = N -1 1 M = 1 ? Yes j=j+1 Terminate No forj = 1 to M, set i = j +1 ) c ± • M ? Ves No Normal Mode starting position: -*• set Psj = Pej. 1 end position: — set Pej = PN ( j l h toolpath segment = "Linear toolpath" ? ) Wo Yes ( toolpath segment = "Linear toolpath" ? ^ Wo Normal Mode starting position: — set Psj = P e^ t end position: set Pej = P,-1^  Angle between j 1 " and j+1 t h toolpath segments ^ Pj-jPiPn-i = 1 8 0 ° ? J-Yes Fitting a quintic spline at corner 1 Wo Cornered toolpath is found, reference toolpath is modified by adding a tiny spline Spline-fitting - Under-Corner or Over-Corner approach (1) Identify boundary conditions for add-in spline (i.e. coordinates of knots, 1 s t and 2 n d derivatives at knots) (2) Determine Transition feedrate along add-in spline Resolve j t h toolpath segment 1) Linear Toolpath starting position: -»• if j = 1, set P S J = P<; otherwise, set Psj = Paj.-, ending position: —Pscj = starting knot of add-in spline 2) Add-in spline Toolpath - Spline parameterization - Iterative Spline Interpolation Method starting position:P^j = starting knot of add-in spline ending position:Pej = ending knot of add-in spline Figure 5.11 : General algorithm of proposed reference toolpath modification using spline fitting at corners Chapter 5. Reference Toolpath Modification For Cornering Motion 151 5 . 6 . Experimental Verification The improvement of the feed drive servo control performance obtained with the proposed reference toolpath modification are demonstrated in the experiments. In order to verify the pro-posed toolpath modification using spline fitting at the corners, a composite reference cornered toolpath composed by four linear toolpath segments with the length of 50 [mm] is tested. The kinematic profiles of the original and modified reference toolpaths are compared and shown in Fig. 5.12. Three cornered angles 0{, 62, and 03 are specified to be 90 [deg], 60 [deg], and 30 [deg], respectively. Experience indicates that the actual toolpath is usually found under the cor-ners in the reference toolpath during the cornering motion. Using the reverse concept, an over-corner approach is used. In this particular case, the specified part tolerance ep is set to 0.200 [mm] and the scaling factor 5 A is assumed to be 1. Therefore, the maximum desired geometric deviation A between the original and modified toolpaths is always assigned to be the same as the part tolerance ep . In addition, the ratio rd , used to control the distance dc , is chosen to be 2. Moreover, the weighting factors Wj and W2 , used to identify the boundary conditions at the con-trol knots Rsm and Rem , are assigned to be 5 and 1, respectively. Once all initial parameters are defined, the whole reference toolpath can be resolved using the proposed modification algorithm described in Fig. 5.11. The toolpaths are generated using the trapezoidal acceleration based feed motion profiling algorithm that is presented in Appendix B. The command feedrate, the tangen-tial acceleration and jerk limits are set to 200 [mm/sec], 2000 [mm/sec ] , and 5000 [mm/sec ] respectively. Considering the modified reference toolpath, the resultant feedrates at the transition period are constant. The transition feedrates are found to be 16.7 [mm/sec] at the first corner (i.e. 6{), 12.2 [mm/sec] at the second corner (i.e. 6>2), and 9.4 [mm/sec] at the third corner (i.e. d3 ), respectively. It can be seen that the transition feedrate is dependent on the sharpness of the cor-ner between two consecutive toolpath segments (i.e. cornered angle). The transition feedrate is larger if the cornered angle is wider. In addition, the feed direction can change continuously and smoothly from one direction to another. Furthermore, the maximum resulting acceleration found Chapter 5. Reference Toolpath Modification For Cornering Motion 152 in the kinematic profiles of the add-in spline toolpath, where a constant transition feedrate is con-sidered, is always bounded by the physical limits of the machine. The zoomed views in Fig. 5.12 indicate that the original reference toolpath is modified by fitting a quintic spline over the corners using the proposed reference toolpath modification technique. The generated original and modified toolpaths are experimentally tested on a 2-1/2 axis F A D A L V M C 2216 C N C machine, explained in Chapter 3. The physical feed drive parameters are given in Appendix D. The drives are controlled using a conventional P-PI control running at a loop closure period of 1 [msec]. The axis controller parameters are given in Appendix D as well. The experiment consists of two scenarios: original reference toolpath contouring test and modi-fied reference toolpath contouring test. Experimental results corresponding to the original and modified reference toolpaths are compared and shown in Fig. 5.13. The control signals and con-touring errors during the contouring tests are plotted in Fig. 5.14. The contouring error analysis for each case is summarized in Table 5.1. Considering the zoomed view in Fig. 5.13, the geomet-ric deviations between the actual toolpath and the desired toolpath are significantly reduced after modifying the reference toolpath. For the contouring test based on the original reference toolpath, the maximum contouring errors corresponding to the cornered angles t9j, 62 , and t93 are found to be 0.285 [mm], 0.322 [mm], and 0.347 [mm], respectively. (Fig. 5.14). As the contouring errors at the corners are larger than the specified part tolerance of 0.200 [mm], violation spots are illustrated on the corresponding actual toolpath, as shown in Fig. 5.13. The time duration for the case of the original reference toolpath contouring test is around 1.563 [sec]. Considering the con-touring test based on the modified reference toolpath, the maximum contouring errors are reduced to 0.125 [mm] at the first corner, 0.093 [mm] at the second corner, and 0.064 [mm] at the third corner, respectively (Fig. 5.14). Even in the sharpness case, the contouring accuracy is signifi-cantly improved (Fig. 5.13c). The geometric deviations between the actual toolpath and the desired toolpath are found to be within the specified part tolerance; therefore, no violation spot is indicated on the actual toolpath. Although the time duration needed in the modified case is Chapter 5. Reference Toolpath Modification For Cornering Motion 153 slightly longer than the time duration for the original case, the performance of the feed drive servo control system with the proposed reference toolpath modification approach is significantly improved. Experimental results for original and modified reference toolpath contouring tests P-PI Control with Trapezoidal Acceleration Feed Motion Planning Commanded federate = 200 [mm/sec] Specified Tolerance = 0.20 [mm] Experimental Results Comparison Analysis Original Toolpath Modified Toolpath Difference Contouring Error at 6\ [mm] 0.285 0.125 0.160 Contouring Error at d2 [mm] 0.322 0.093 0.229 Contouring Error at #3 [mm] 0.347 0.064 0.283 Max. Contouring Error along whole toolpath [mm] 0.347 0.125 0.222 Time Duration [sec] 1.563 1.950 0.387 Table 5.1 : Summary of experimental results for original and modified reference toolpath contouring tests Chapter 5. Reference Toolpath Modification For Cornering Motion 154 50.5 50.0 49.5 49.0 48.5 Modified (Quintic Spline) ) Original O i l -0.5 0 0.5 1.0 1.5 X-Axis Reference trajectories -10 0 10 20 30 40 50 60 70 80 X-Axis [mm] Y-Axis Reference trajectories Resultant trajectories along desired toolpath 0.5 1 1.5 Time [sec] 0.5 1 1.5 Time [sec] 0.5 1 1.5 Time [sec] Figure 5.12 : Trajectory profiles of original and modified reference cornered toolpaths Chapter 5. Reference Toolpath Modification For Cornering Motion 155 Reference Toolpath VS. Actual Toolpath 50.2 50 — 49.8 49.6 B 18.4 49.2 49 488 48.6 E E, I 100 90 80 70 60 50 40 30 20 10 0 1 1 Pi -20 -10 0 10 20 30 40 50 60 70 80 X-Axis [mm] — — Original Reference Toolpath Modified Reference Toolpath Actual Toolpath corresponding to Original Reference Toolpath Actual Toolpath corresponding to Modified Reference Toolpath Violation Spot Modified Reference Toolpath (Quintic Spline) Original Reference Toolpath \ Actual Toolpath (Original) Violation Spot »Actual Toolpath (Modified) 0 51.2 51 — 50.8 £ 50.6 CO 1 504 ? 50.2 50 498 49.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 X-Axis [mm] (a) e2 48.8 49 49.2 49.4 49.6 49.8 50 50.2 50.4 X-Axis [mm] (b) 24.8 25 25.2 25.4 25.6 25.8 26 26.2 26.4 X-Axis [mm] (c) Figure 5.13 : Experimental results for original and modified reference toolpath contouring tests -- (a) zoomed view at first corner (6X = 90 [deg]), (b) zoomed view at second corner (02 =60 [deg]), (c) zoomed view at third corner (03 =30 [deg]) Chapter 5. Reference Toolpath Modification For Cornering Motion 156 c CD W 2.5 -trol Si Y-Axi [Volt] c c o — -2.5 -O -5.0 -Modified Case 0 0.2 0.4 0.6 0.8 1.0 1.2 Time [sec] 1.4 1.6 1.8 2.0 0.40 0.35 i_ 0.30 2 >— LU ~L ,_, 0.25 g — 0.20 -4—' c o O 0.15 0.10 0.05 0 1 I ] I Specified Part Tolerance i i i i i Original Case 1(b) r A \ Modified Case (a) \ > V i' U*)l\ i IV j 0.2 0.4 0.6 0.8 1.0 1.2 Time [sec] 1.4 1.6 1.8 2.0 Figure 5.14 : Control signals and contouring errors during contouring tests ~ (a) at first corner (6>! =90 [deg]), (b) at second corner (02 =60 [deg]), (c) at third corner (<93 = 30 [deg]) Chapter 6 Conclusion 6.1. Conclusion A virtual design and simulation of a C N C system incorporating with auto-tuning method and reference toolpath modification technique is presented in this thesis. The Virtual C N C system can be used to test different trajectory generation algorithms, physical properties of feed drives, and control laws in machining a variety of part shapes under desired cutting conditions. The thesis has the following contributions: The ultimate goal of the Virtual C N C system is to predict the contouring errors due to the servo control performance in machining a particular part when a particular C N C system is selected. This thesis presents a virtual C N C platform which accepts Cutter Location files based on the industry standard A P T format and processes the cutter motion commands through trajec-tory generation and axis servo control algorithms. The actual tool position delivered by the C N C model is predicted and compared against the reference toolpath generated by the C A D systems. The Virtual C N C system automatically calculates the contouring errors, and predicts the part locations where the specified tolerance is violated. The Virtual C N C system considers trajectory generation when a tool follows a complex path in Cartesian Space. The discrete axis trajectory commands sent to each drive are generated by a reconfigurable trajectory generator which allows various feed profiles with low or high smooth-ness level governed by the specified acceleration and jerk limits. The non-linear friction of the drives is incorporated to the axis control simulation module by specifying the parameters of the Stribeck friction curve. The actuator saturation due to voltage/ current limits of the motor amplifiers or torque limit of the motor, velocity and encoder measure-157 Chapter 6. Conclusion 158 ment noise, quantization error, and backlash effect are also considered in the time domain simula-tion of the axis servo drives. The type of drive, transmission mechanism, physical dimensions of the drive, and the charac-teristics of the motor and amplifier are specified as input to the system. The control law is either selected from the existing library, or added as a new module to the Virtual C N C tool kit. Machine tool feed drive system is interactively configured and the corresponding transfer functions are modeled analytically. In addition, the Virtual C N C system is furbished with various experimentally proven axis control laws such as P-PI, PID, Lead Lag Control ( L L C ) , Pole Placement Control (PPC), General-ized Predictive Control (GPC), and Sliding Mode Control (SMC) that can be used as references during the design stage of C N C machine tools. The Virtual C N C system is experimentally verified on a commercial 2-1/2 axis C N C machine and is shown to be capable of predicting the feed drive servo control performance for various toolpath geometries, trajectory generation schemes, and axis control laws. Furthermore, the Virtual C N C system can be used for monitoring and diagnosis of the system performance for C N C machine tools. This thesis presents an auto-tuning of a non-linear controller, S M C , based on high-level fuzzy logic control. The performance of an overall feed drive system is classified as good, satis-factory and unsatisfactory by the expert. The controller of a complete feed drive system is auto-matically but iteratively tuned. The auto-tuning method is experimentally verified, and it is shown that the in-loop direct controller is fine-tuned regardless of initial control parameters. For system performance evaluation, a traditional step-input response diagnosis test is not adequate for tuning the control parameters in the feed drive servo control system. A new method-ology to evaluate the system performance is presented. The performance of the feed drive servos are evaluated based on: the oscillation level of the control signal, the system stability margin, and the tracking accuracy of the axis feed drives. Chapter 6. Conclusion 159 A n automatic reference toolpath modification technique by fitting splines at sharp corners is investigated to improve the contouring accuracy for cornering motion. This developed technique prevents the tolerance violations caused by the discontinuities in the reference trajectory com-mands. Experimental verification of the modification technique proves that the contouring accu-racy of the feed drive system is significantly improved, especially at sharp corners. In summary, the thesis presents a comprehensive simulation system which is capable of machining a part on a Virtual Model of a C N C system. The Virtual C N C system allows testing and optimization of various C N C models and control parameters before the part is cut on actual C N C machine tools. 6.2. Future Research Directions The proposed system creates the foundation of a complete Virtual C N C system which requires the following additional capabilities: The effect of cutting process disturbances on the feed drive system must be considered in order to predict machining errors originating from the C N C feed drive servos more accurately. The current axis feed drive dynamics model assumes that the feed drive has a rigid body motion. However, torsional modes of the ball screw drive and bending modes of the linear drive may contribute towards the performance of the feed drive control system at high machining speeds and accelerations. The dynamic structural flexibilities of the drive system must be included in the transfer function model of the drives. The current Virtual C N C system does not consider the volumetric errors of the machine. The metrology model of the machine can be created, integrated into Virtual C N C system, and the position dependent errors can be automatically compensated or simulated along the toolpath. The current Virtual C N C system considers only three axis C N C in Cartesian coordinates. Most dies, molds and airspace parts are machined on 5 axis C N C machine tools, which need to be considered. Bibliography [I] Altintas, Y., 2000, Manufacturing Automation: Metal Cutting Mechanics, Machine Tool Vibrations, and CNC Design, Cambridge University Press. [2] Altintas, Y., Erkorkmaz, K . , 2003, "Feedrate Optimization for Spline Interpolation in High Speed Machine Tools", Annals ofCIRP, Vol. 52, No. 1, pp. 297-302. [3] Altintas, Y., Erkorkmaz, K. , Zhu, W. -H. , 2000, "Sliding Mode Controller Design for High Speed Drives", Annals ofCIRP, Vol. 49, No. 1, pp. 265-270. [4] Altintas, Y , Erol, N . A . , 1998, "Open Architecture Modular Tool Kit for Motion and Machining Process Control," Annals ofCIRP, Vol. 47, No. 1, pp. 295-300. [5] Armstrong, H .B . , Dupont, P., Canudas De Wit, C , 1994, "A Survey of Models, Analysis Tools and Compensation Methods for the Control of Machines with Friction", Automatica, Vol. 30, No. 7, pp. 1083-1138. [6] Astrom, K . J . , Hagglund, T., 1995, PID Controllers: Theory, Design, and Tuning, Second Edition, Instrument Society of America. [7] Astrom, K . J . , Wittenmark, B. , 1997, Computer-Controlled Systems: Theory and Design, Third Edition, Prentice-Hall Inc., NJ. [8] Bandyopadhyay, R., Chakraborty, U . K . , Patranabis, D. , 2001, "Auto-Tuning a PID Con-troller: A Fuzzy-Genetic Approach", Journal of Systems Architecture, Vol. 47, pp. 663-673. [9] Berger, M . , 1996, "Self-Tuning of a PI Controller using Fuzzy Logic for a Construction Unit Testing Apparatus", Control Engineering Practice, Vol. 4, No. 6, pp. 785-790. [10] Bollinger, J.G., Duffie, N . A . , 1988, Computer Control of Machines and Processes, Addi-son-Wesley. [II] Boric, M . , Cohen, I., 2001, "Trajectory Profiler Classification", IFAC. [12] Brigham, E . O . , 1988, The Fast Fourier Transform and Applications, Englewood Cliffs, N.J. , Prentice Hall. [13] Butler, J . , Haack, B . , Tomizuka, M . , 1988, "Reference Generation for High Speed Coordi-nated Motion of a Two Axis System", Symposium on Robotics, ASME Winter Annual Meeting, Chicago, IL, U S A , D S C Vol. 11, pp. 457-470 160 Bibliography 161 [14] C A M L , 1973, Encyclopedia of the APT Programming Language, Computer Aided Manu-facturing International, Arlington, Texas. [15] Chan, K . C . , 1996, "Development of a Feedback Controller Tuner using Virtual Fuzzy sets", Computers in Industry, Vol. 28, pp. 219-232. [16] Chen Y . C . , Tlusty J. , 1995, "Effect of Low-Friction Guideways and Lead-Screw Flexibil-ity on Dynamics of High-Speed Machines", Annals ofCIRP, Vol. 44, pp. 353-356. [17] Chidambaram, M . , Sree R., 2003, "A Simpled Method of Tuning PID Controllers for Inte-grator/Dead-Time Processes", Computers and Chemical Engineering, Vol. 27, pp. 211-215. [18] Chu, S.Y., Teng, C . C . , 1999, "Tuning of PID Controllers based on Gain and Phase Margin Specifications using Fuzzy Neural Network", Fuzzy Sets and Systems, Vol. 101, pp. 21-30. [19] Chuang H . Y , Liu , C . H . , 1991, "Cross-Coupled Adaptive Feedrate Control for Multiaxis Machine Tools", Journal of Dynamic Systems, Measurement, and Control, Vol. 113, No. 3, pp. 451-457. [20] Control System Toolbox User's Guide, 1999, The MathWorks Inc. [21] Cuttino, J.F., Dow, T .A . , Knight, B.F. , 1997, "Analytical and Experimental Identification of Nonlinearities in a Single-Nut, Preloaded Ball Screw", ASME Journal of Mechanical Design, Vol. 119, No. 1, pp. 15-19. [22] de Silva, C.W., 1991, "An Analytical Framework for Knowledge-Based Tuning of a Servo Controller", Engineering Applications in Artificial Intelligence, Vol. 4 No. 3, pp. 177-189. [23] de Silva, C.W., 1995, Intelligent Control - Fuzzy Logic Applications, C R C Press L L C . [24] Erkorkmaz, K . , 1999, M . A . S c . Thesis: "High Speed Contouring Control for Machine Tool Drives", University of British Comlumbia, Department of Mechanical Engineering, BC, Canada. [25] Erkorkmaz, K . , 2004, Ph.D. Thesis: "Optimal Trajectory Generation and Precision Track-ing Control for Multi-Axis Machines", University of British Comlumbia, Department of Mechanical Engineering, BC, Canada. [26] Erkorkmaz, K . , Altintas, Y , 1998, "High Speed Contouring Control Algorithm for C N C Machine Tools", Proceedings of the ASME Dynamic Systems and Control Division, D S C -Vol. 64, pp. 463-469. [27] Erkorkmaz, K . , Altintas, Y , 2001, "High Speed C N C 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. Bibliography 162 [28] Erkorkmaz, K . , Altintas, Y., 2001, "High Speed C N C System Design: Part II - Modeling and Identification of Feed Drives", International Journal of Machine Tools and Manufac-ture, Vol. 41, No. 10, pp. 1487-1509. [29] Erkorkmaz, K . , Altintas, Y , 2001, "High Speed C N C System Design: Part III - High Speed Tracking and Contouring Control of Feed Drives", International Journal of Machine Tools and Manufacture, Vol. 41, No. 11, pp. 1637-1658. [30] 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 Dies and Molds, Kusadasi, Turkey, DM_46. [31] Erkorkmaz, K . , Altintas, Y , 2003, "Quintic Spline Interpolation with Minimal Feed Fluc-tuation", Proceedings of the ASME Manufacturing Engineering Division, 2003 ASME International Mechanical Engineering Congress and Exposition, M E D - I M E C E 2 0 0 3 -42428. [32] Fuzzy Logic Toolbox User's Guide, 1999, The MathWorks Inc. [33] Goodwin, G.C. , Graebe, S.F., Salgado, M . E . , 2001, Control System Design, Prentice-Hall. [34] Goulet, J . - E , 1999, M . A . S c . Thesis: "Intelligent Hierarchical Control of a Deployable Manipulator", University of British Comlumbia, Department of Mechanical Engineering, BC, Canada. [35] Goulet, J . - E , de Silva, C.W., Modi , V.J. , 2002, "Hierarchical Knowledge-Based Control of a Deployable Orbiting Manipulator", Acta Astronautica, Vol. 50, pp. 139-148. [36] Huang, S.H., Bhura, K .R. , Wang, G , 2000, "Cutter Path Simulation and Product Visual-ization Using AutoCAD", Computer Application Eng. Education, Vol. 8, pp. 113-126. [37] Inoue, K . , Izumi, T., Nakaoka, M . , 1996, "An Advanced D C Brushless Servo Drive Sys-tem with a Fuzzy Logic-Based Self-Tuning Control Scheme and its Practical Evaluation", International Journal of Electronics, Vol. 80, No. 2, pp. 223-233. [38] Jouaneh, M . K . , Dornfeld, D . A . , Tomizuka, M . , 1990, "Trajectory Planning for Coordi-nated Motion of a Robot and a Positioning Table: Part 2 — Optimal Trajectory Specifica-tion", IEEE Transactions on Robotics and Automation, Vol. 6, No. 6, pp. 746-759. [39] Jouaneh, M . K . , Wang, Z . , Dornfeld, D . A . , 1988, "Tracking of sharp corners using a robot and a table manipulator", in Proc, USA-Japan Symp., Flexible Automation, pp. 271-278. [40] Jouaneh, M . K . , Wang, Z . , Dornfeld, D . A . , 1990, "Trajectory Planning for Coordinated Motion of a Robot and a Positioning Table: Part 1 - Path Specification", IEEE Transac-tions on Robotics and Automation, Vol. 6, No. 6, pp. 735-745. Bibliography 163 [41] Kanayama, Y., Miyake, N . , 1986, "Trajectory Generation for Mobile Robots", The Third International Symposium of Robotics Research, Cambridge, M.A., pp. 333-340. [42] Kao, J . Y , Yeh, Z . M . , Tarng Y.S., L in , Y.S., 1996, "A Study of Backlash on the Motion Accuracy of C N C Lathes", International Journal of Machine Tools and Manufacture, Vol. 36, No. 5, pp. 539-550. [43] Koren Y , 1980, "Cross-Coupled Biaxial Computer Control for Manufacturing Systems", Journal of Dynamics Systems, Measurement, and Control, Vol. 102, pp. 265-272. [44] Koren Y , Lo , C . C . , 1991, "Variable-Gain Cross-Coupling Controller for Contouring", Annals ofCIRP, Vol. 40, pp. 371-374. [45] Koren, Y , 1983, Computer Control of Manufacturing Systems, McGraw-Hil l , NY. [46] Krai, I.H., 1986, Numerical Control Programming in APT, Prentice-Hall, Englewood Cliffs, N.J. [47] Lewis III, H.W., 1997, The Foundations of Fuzzy Control, Plenum Press, New Work. [48] Ljung, L . , 1998, System Identification: Theory For The User, 2nd Edition, Prentice-Hall O f Canada Ltd. [49] L o , C . C . , 1999, "Cutter Path Preview for Contouring Machining based on Efficient Identi-fication of Motion Error Sources", International Journal of Production Research, Vol. 37, No. 15, pp. 3429-3444. [50] MacFarlane, A .G.J . , de Silva, C.W., 1988, "Knowledge-Based Control Structure for Robotics Manipulators". Proceedings of the IFAC Workshop on Artificial Automatic Con-trol, pp. 143-148. [51] Macfarlane, S., Croft E . A . , 2001, "Design of Jerk Bounded Trajectories for On-Line Indus-trial Robot Applications", Proceedings IEEE International Conference on Robotics and Automation, Vol. 1, pp. 979-984. [52] Makino H . , Ohde T , 1991, "Motion Control of the Direct Drive Actuator", Annals of CIRP, Vol.40, pp. 375-378. [53] Matlab Reference Guide, 1992, The Math Works, Inc. [54] Mei , X . , Tsutsumi, M . , Yamazaki, T , Sun, N . , 2001, "Study of the Friction Error for a High-Speed High Precision Table", International Journal of Machine Tools and Manufac-ture, Vol. 41, pp. 1405-1415. [55] Nordin, M . , Galic, J. , Gutman, P., 1997, "New Models for Backlash and Gear Play", Inter-national Journal of Adaptive Control and Signal Processing, Vol. 11, pp. 49-63. [56] Ogata, K . , 1997, Modern Control Engineering, Third Edition, Prentice-Hall Inc., NJ. Bibliography 164 [57] Ong, S.K., Jiang, L . , Nee, Y . C . , 2002, "An Internet-Based Virtual C N C Milling System", International Journal of Manufacturing Technology, Vol. 20, pp. 20-30. [58] Patyra, M . J . , Mlynek, D . M . , 1996, Fuzzy Logic - Implementation and Applications, John Wiley & Sons Ltd. and B.GTeubner. [59] Polycarpou, A . A . , Soom, A . , 1996, "A two-component mixed friction model for a lubri-cated line contact", ASME, Journal ofTribology, Vol. 118, pp. 183-189. [60] Pritschow, G , Philipp, W., 1992, "Research on the Efficiency of Feedforward Controllers in M Direct Drives", Annals ofCIRP, Vol. 41, pp. 411-415. [61] Rad, A . , Lo , W., Tsang, K . , 1997, "Self-Tuning PID Controller Using Newton-Raphson Search Method", IEEE Transactions on Industrial Electronics, Vol. 44, No. 5, pp. 717-725. [62] Sciavicco, L . , Siciliano, B . , 2000, Modeling and Control of Robot Manipulators, Second Edition, Springer-Verlag. [63] Selmic, R.R., Lewis, F . L . , 1999, "Backlash compensation in Nonlinear Systems using Dynamic Inversion by Neural Networks", Proc. IEEE International Conference on Con-trol Applications and IEEE International Symposium on Computer Aided Control System Design, pp. 1163-1168. [64] Shaw L S . 1998, Fuzzy Control of Industrial Systems — Theory and Applications, Kluwer Academic Publishers. [65] Shpitalni, M . , Koren, Y., Lo , C . - C , 1994, "Realtime Curve Interpolators," Computer Aided Design, Vol. 26, No. 11, pp. 832-838. [66] Slovum, H.S., 1992, Precision Machine Design, Prentice-Hall. [67] Srinivasan, K . , Tsao, T . C . , 1997, "Machine Tool Feed Drives and Their Control - A Sur-vey of the State of the Art", ASME Transactions, Journal of Manufacturing Science and Engineering, Vol. 119, pp. 743-748. [68] Tomizuka, M . , 1993, "On The Design of Digital Tracking Controllers", ASME Transac-tions, Journal of Dynamic Systems, Measurement and Control, Vol. 115, pp. 412-418. [69] Tounsi, N . , Bailey, T , Elbestawi, M . A . , 2003, "Identification of acceleration deceleration profile of feed drive systems in C N C machines", International Journal of Machine Tools and Manufacture, Vol. 43, pp. 441-451. [70] Tung, E . D . , Anwar, G , Tomizuka, M . , 1993, "Low Velocity Friction Compensation and Feedforward Solution based on Repetitve Control", ASME Transactions, Journal of Dynamic Systems, Measurement and Control, Vol. 115, pp. 297-284. Bibliography 165 [71] Tung, E . D . , Tomizuka, M . , 1993, "Feedforward Tracking Controller Design Based on the Identification of Low Frequency Dynamics", ASME Transactions, Journal of Dynamic Systems, Measurement and Control, Vol. 115, pp. 348-356. [72] Utkin, V I . , 1977, "Variable Structure Systems with Sliding Modes", IEEE Transactions on Automatic Control, Vol. AC-22 , No. 2, pp. 212-222. [73] Visioli, A . , 2001, "Tuning of PID Controllers with Fuzzy Logic", IEEE Proc. Control The-ory Appl., Vol. 148, No. 1. pp. 1-8. [74] Wang, F . - C , Wright, P.K., Barsky, B . A . , Yang, D . C . H . , 1999, "Approximately Arc-Length Parameterized C3 Quintic Interpolatory Splines," Journal of Mechanical Design, Transactions of the ASME, Vol. 121, No. 3, pp. 430-439. [75] Wang, F . - C , Yang, D . C . H . , 1993, "Nearly Arc-Length Parameterized Quintic-Spline Interpolation for Precision Machining," Computer Aided Design, Vol. 25, No. 5, pp. 281-288. [76] Week, M . , Meylahn, A . , Hardebusch, C , 1999, "Innovative Algorithms for Spline-Based C N C Controller", Production Engineering Research and Development in Germany; Annals of the German Academic Society for Production Engineering, Vol. 6, No. 1, pp. 83-86. [77] Wickramachchi, N . , de Silva, C.W., 1998, "Knowledge-Based Supervisory Control System of a Fish Processing Workcell - Part I: System Development", Engineering Applications of Artificial Intelligence, Vol. 11, pp. 97-118. [78] Wickramachchi, N . , de Silva, C.W., 1998, "Knowledge-Based Supervisory Control System of a Fish Processing Workcell — Part II: Implementation and Evaluation", Engineering Applications of Artificial Intelligence, Vol. 11, pp. 97-118. [79] Wickramarachchi, N . , 1995, Ph.D. Thesis: "Development of a Knowledge-Based Hierar-chical Control Structure for Process Automation", University of British Comlumbia, Department of Mechanical Engineering, BC, Canada. [80] Wickramarachchi, N . , de Silva, C.W., 1992, "Knowledge-Based Development for an Intel-ligent Control System for a Process Workcell", ASME Intelligent Control Systems, Vol. 45, pp. 113-119. [81] Yeh S.S., Hsu, P.L., 2002, "Estimation of the Contouring Error Vector for the Cross-Cou-pled Control Design", IEEE/ASME Transactions on Mechatronics, Vol. 7, No. 1, pp. 44-51. [82] Yoshikawa, T , 1990, Foundations of Robotics, The M I T Press, Cambridge, M A . Bibliography 166 [83] Younkin, G.W., 1991, "Modeling Machine Tool Feed Servo Drives Using Simulation Techniques to Predict Performance", IEEE Transactions on Industry Applications, Vol. 27, No. 2, pp. 268-274. [84] Yun, W., Ko, J. , Cho, D. , Ehmann, K . , 2002, "Development of a Virtual Machining System — Part 1: Approximation of the size effect for cutting force prediction", International Jour-nal of Machine Tools and Manufacture, Vol. 42, pp. 1595-1605. [85] Yun, W., Ko , J. , Cho, D. , Ehmann, K . , 2002, "Development of a Virtual Machining System — Part 2: ", International Journal of Machine Tools and Manufacture, Vol. 42, pp. 1607-1615. [86] Yun, W., Ko , J. , Cho, D. , Ehmann, K . , 2002, "Development of a Virtual Machining System — Part 3: Cutting Process Simulation in Transient Cuts", International Journal of Machine Tools and Manufacture, Vol. 42, pp. 1617-1626. [87] Ziegler, J.G., Nichols, N .B . , 1942, "Optimum Settings for Automatic Controllers", Trans-actions of the ASME, Vol. 64,Vol. 6, pp. 759-768. Appendix A Example O f C L File Interpretation A simple example of a C L file generated by C A T I A (a widely used commercial C A D / C A M application) is shown as follows: $$ Manufacturing Program.1 $$ Part Operation.1 $$*CATIA0 PARTNO PART TO BE MACHINED COOLNT/ON CUTCOM/OFF PPRINT OPERATION NAME : Tool Change.1 $$ Start generation of : Tool Change.1 TLAXIS/ 0.000000, 0.000000, 1.000000 $$ TOOL CHANGE BEGINNING CUTTER/ 20.0000, 2.0000 0.0000, 50.0000 TOOLNO/2, 20.0000 TPRINT/T2 End M i l l D 10 LOADTL/2 $$ End of generation of PPRINT OPERATION NAME : Pocketing.1 $$ Start generation of : Pocketing.1 LOADTL/2,1 FEDRAT/ 6000.0000,MMPM SPINDL/ 1000.0000,RPM,CLW / 0.0000, 0.0000, Comments 8.0000, 2.0000, 0.0000, Tool Change.1 v. Initial ' Setup FROM RAPID GOTO GOTO GOTO / 0.0000, 0.0000, / 0.0000, 0.0000, / 0.0000, 50.0000, INDIRV/ 0.0000, 1.0000, TLON,GOFWD/ (CIRCLE/ 25.0000),ON,(LINE/ GOTO / 50.0000, 0.0000, GOTO / 0.0000, 0.0000, GOTO / 0.0000, 0.0000, RAPID GOTO / 0.0000, 0.0000, $$ End of generation of SPINDL/OFF REWIND/0 END 50.0000 5.0000 -10.0000 -10.0000 0.0000 25.0000, 25.0000, 50.0000, -10.0000 -10.0000 5.0000 50.0000 Pocketing.1 f- Cutting conditions J (e.g. spindle speed, feedrate) 50.0000, 50.0000, 50.0000, -10.0000, -10.0000, -10.0000) Toolpath geometry and motion types J Figure A . l : Example of C L file created by C A T I A 167 Appendix A. Example Of CL File Interpretation 168 A . l . Comment Syntax In A P T programming, the character $$ means the comment syntax code. The statement fol-lowing the sign $$ is considered to be comment syntax and is ignored in the interpretation pro-cess. A .2. Initial Setup The initial configuration for machining process is defined. This initial setting includes the coordinate system setup, the coolant start, and the tool changing (if necessary). A .3. Cutting Condition The cutting conditions such as spindle speed and commanded feedrate are also identified from the C L file (Fig. A . L ) . In A P T standards, the codes corresponding to spindle speed and fee-drate are SPINDL and F E D R A T , respectively. In this example, the spindle speed and feedrate are set to 1000 R P M (revolution per minute) with clockwise rotation and 6000 M M P M (mini-meter per minute), respectively. A.4. Toolpath Geometry and Motion Type After understanding the basic structures of the geometric statements and tool motion state-ments, the positions of the tool and the motion commands are recognized. The following exam-ples shows the toolpath geometry and the interpolation types interpreted from the given C L file. A P T statement: F R O M / 0.0000, 0.0000, 50.0000 Toolpath coordination: P0 (0, 0, 50) Description: The starting position of the tool with respect to the part program zero is set to be 0 mm, 0 mm, and 50 mm in x, y, and z axis respectively. Appendix A. Example Of CL File Interpretation 169 A P T statement: R A P I D G O T O / 0.0000, 0.0000, 5.0000 Toolpath coordination: from P0 (0, 0, 50) to PI (0, 0, 5) Description: Rapid traverse ~ The tool is commanded to move rapidly from the cur-rent position to the new position coordinate PI (0, 0, 5). A P T statement: G O T O / 0.0000, 0.0000, -10.0000 Toolpath coordination: from PI (0, 0, 5) to P2 (0, 0, -10) Description: Linear interpolation — The tool is commanded to move linearly from the current position to the new position coordinate P2 (0, 0, -10). A P T statement: INDRIV / 1.0000, 0.0000, 0.0000 G O F W D / ( C I R C L E / 25.0000, 50.0000, -10.0000, 25.00000), O N , (LINE / 25.0000, 50.0000, -10.0000, 50.0000, 50.0000, -10.0000) Toolpath coordination: from P3 (0, 50, -10) to P4 (50, 50, -10) Description: Circular interpolation — The tool is commanded to move along a circu-lar path with the center at Pc (25, 50, -10) and radius of 25 mm in the clockwise direction. The tool is prompted to stop at the position coordinate P4 (50, 50, -10) Appendix A. Example Of CL File Interpretation 170 The way to interpret the circular tool motion and the overall toolpath obtained after interpre-tation are given in Fig. A.2 and Fig. A.3 , respectively. GOT(K0.0000, 50.0000, -10.0000 INDIRVvO.0000, 1.0000, 0.0000 Current position of tool tip Direction vector which is a tangent vector relative to the circular arc at current tool position TLON, GOFWD/^QRCLE/ 25.0000, 50.0000, -10.0000, 25jjpjl5?h ON, rCjIJNE/ 25.0000,50.0000, -10.0000, 50.0000, 50.0000, -10.0000) Drive surface — Circular path with centre coordinates in x, y, and z axis, and circular radius Check surface - Boundary path; the intersection between the line created by 2 points (PI & P2) and the circular motion path is defined as the ending position of the tool tip Figure A.2 : Interpretation of circular tool motion Rapid trasverse. Po, Ps (0,0,50) X X Y Linear Interpolation 1 PLPzfo.o.S) Ps (50,0,-10) PA (50,50,-10)" Circular Interpolation wi th c lockwise direct ion Figure A.3 : Toolpath geometry and motion commands interpreted from given C L file Appendix B Trapezoidal Acceleration Profiled Feed Motion Planning In order to realize the general methodology for developing the feed profiles with high smoothness level, an example is given as follows, Phase region: (T)Acceleration Increase ©Acceleration Saturation ©Acceleration Decrease ©Constant Feedrate ©Deceleration Increase ©Deceleration Saturation ©Deceleration Decrease Figure B . l : Kinematic profiles for trapezoidal acceleration feed motion planning 171 Appendix B. Trapezoidal Acceleration Profiled Feed Motion Planning 172 B.l . Analytical expressions of kinematic profiles The acceleration profile is trapezoidal with pre-specified slopes, as shown in Fig. B . l [27]. The jerk profile has constant jerk limits for the phase regions 1, 3, 5, and 7 where acceleration profile is linear, velocity profile is parabolic, and displacement profile is cubic. The analytical expression for the jerk profile, j(t), corresponding to this example is given as, Integrating the jerk profile with respect to time gives the tangential acceleration profile, a(t), as, m= Jx, 0<t<tx, Phase(1): Acceleration increase 0, tx<t<t2, Phase(2): Acceleration saturation J3, t2<t<t3, Phase(3): Acceleration decrease 0, 13 < t < t4, Phase (4): Constant feedrate (B.l) 7 5 , t4 < t < t5, Phase (5): Deceleration increase 0, t5<t<t6, Phase(6): Deceleration saturation J7, t6<t<t7, Phase(7): Deceleration decrease a(0 = Jrt, 0<t<tlt aXe = Jx-Tx=A A, tx<t<t2, a2e=A a2e + J3-^ h<t<t3, a3e=a2e+J3-T3=0 0, t3<t<t4, a4e=0 a4e+J5-t, t4<t<t5, a5e=a4e + J5-T5=D D, t5<t<t6, a6e=D a6e + J r t , t6<t<t7, ale=a6e + J7-T7 = 0 (B.2) Appendix B. Trapezoidal Acceleration Profded Feed Motion Planning 173 The analytical expressions for the feedrate profile, f(t), and displacement profile, s(t), are obtained by integrating Eq . (B.2) two more times with respect to time: f(t) = 0Zt<tlt fu=fs+\-Ji-Ti2 h<t<t2, f2e=fle+A-T2 f2e+A-t + ~J3-t2, t2<t<t3, h e = h e + A-T2+jJrT32=F F, fse+D-t, t3<t<t4, f4e=f3e = F t4<t<t5, fse^Ue+\-J5-T52 h^t<t6, f6e=f5e + D-T6 f6e+D-t + j J 7 - t 2 , t6<t<t7, fle=f6e + D-T7+jJ1-T12=fe (B.3) s(t) = s0 + fst + jJit3, o 0<f <r,, sle 1 3 = S0 + fsTl + ^ J l T l r, <t<t2, s2e = Sle+fle-T2+\A-T22 S2e+f2et+\At2 + e J 3 t , t2<t<t3, = S2e+f2eT3+^AT2+l-J3T33 2 6 s3e + Ft, t3<t<t4, s4e = s3e + F-T4 1 3 S4e+ f4et + — 5^? , 0 t4<t<t5, s5e 1 3 = S4e + f4eT5 + — J5T5 6 SSe+fse' + ^Dt2, ts<t<t6, s6e = *5e+f5e-T6+\D-T62 S6e + feet+ \Dt2 + — Jit , 0 t6<t<t7, sle = see + feeTi+^DT72+±J1T13 = SQ+L (BA) Appendix B. Trapezoidal Acceleration Profded Feed Motion Planning 174 The finite jerk values for the phase regions 1 and 3 are selected to have same magnitude (i.e. |7j| = | y 3 | ) , from symmetry. Same assumption is applied to the jerk values for the phase regions 5 and 7 (i.e. |7 5 | = |7 7 | ) . J\-~J?>- J A J 5 = - J 7 = J D (B.5) By solving the boundary conditions for the acceleration, velocity, and displacement profiles given in Eq. (B.2), (B.3), and (B.4), the analytical expressions of time duration for each phase 7} ( i = 1,2, • • • ,7 ) are derived as, To = JA (F-fs)_A_ JA A T A = - - \ L -1 > (A D ] Fl + + K2A 2D J {2JA 2JD/ + \2JA 2A J 27 D 2D T5 = D 'D (fe-F) D D J D Tn = D D 0<t<tx h<t<t2 t2<t<t3 t3<t<t4 t4<t<t5 t5<t<t6 tf,<t<U (B.6) Appendix B. Trapezoidal Acceleration Profded Feed Motion Planning 175 B.2. Checking of compatibility conditions The kinematic parameters such as the commanded feedrate, acceleration, deceleration, and jerk limits must be checked so that the kinematic profiles are compatible with each other. The compatibility for trapezoidal acceleration feed motion profiling are summarized below: (i) Sign correction The signs of the acceleration, deceleration, and jerk limits should be checked: A = sign(F-fs)-\A\ D = sign(fe -F)-\DI & JA = sign(A) • JA JD =sign(D)- JD (B.7) (ii) Jerk condition The jerk limits (i.e. JA and JD ) cannot be greater than its achievable maximum value 7 m a x . Otherwise, the corresponding jerk limits should be decreased to 7 m a x . JA (JD) = JAVD)\ ifJA(JD)^Jr Jr where otherwise max(]A|, \D\) (B.8) "^ max lint (iii) Acceleration condition If an acceleration stage exists in the motion, the time duration T2 for the phase region 2 cor-responding to the constant acceleration period should be a non-negative value. If this condition does not hold, then the magnitude of acceleration should be reduced to its maximum possible limit A' as, A = A; if T2 ^ 0; where T2 (F-fs) A A JA (B.9) A' = -d"JA -{F- fs)\ otherwise; set T2=0 Appendix B. Trapezoidal Acceleration Profded Feed Motion Planning 176 (iv) Deceleration condition If a deceleration zone exists in the motion, the time duration T6 for the phase region 6 corre-sponding to the constant deceleration period should be a non-negative value. If this condition does not hold, then the magnitude of deceleration should be reduced to its maximum achievable limit D' as, D = D; ifT6>0; where T6 = (fe F ) - — 6 D J D (B.10) \D'--yJjD - (fe -F); otherwise; set T 6 = 0 (v) Constant feedrate duration The last compatibility check is to ensure that the time duration TA for the phase region 4 relating to the constant velocity period should be greater or equal to zero. If this condition does not hold, the desired feedrate F cannot be reached and should be reduced to its maximum possi-ble value F', where time duration T4 is set to zero: F = F; ifT4>0; F'; otherwise; set T 4 = 0 where a = 2a 1 1 2A 2D A A D • + -2JA 2J, 27, 2 A 2J D 2D -L (B . l l ) A l l of these five compatibility conditions have to be realized. If any one of them requires a modification, then the dependent conditions should be checked again. Appendix B. Trapezoidal Acceleration Profiled Feed Motion Planning 111 B.3. Motion duration After the compatibility check is completed, the total duration of motion Ttotal required to travel the length L should be checked so that Ttotal is an integer multiple of the interpolation period Tm. In this case, the new total time duration T'total is calculated as, 1"total ~ Ntotal X i^nt where Ntotai = ceil 1 total V i^nt J Ttotal =TX+T2 +T3+T4+T5 +r6 +r7 (B.12) The duration of each phase is then re-adjusted as, T;= 1 total \Ttotai j xT, where i = 1,2,3,4,5,6,7 (B.13) Considering Eq . (B.6), the expression of the nominal feedrate Fnom is derived in terms of the updated time durations for each phase (T{,T{,--,T7 ), the initial and ending feedrates (fs, fe), and the distance of travel ( L ) as: 3 2 aQ • Fnom + al * Fnom + a2 ' Fnom + a3 = 0 (B.14) where I I I i i i i a0=7} +T2 +T3 +2T4 +T5 +T6 +T7 ax = -{/•, • (27/4' + 2T5 +Ts) + fe- (2Ti + T2 +2T4') + 2- L] a2 = -\fs2 • (2T[ + r2') + fe2 • QTS' + r6') - 2 f J e • TA' - 2 • (fs + fe) • i] l « 3 =f,-fe-\fs- +T2) + fe- Ws + r/) - 2 • L] Appendix B. Trapezoidal Acceleration Profded Feed Motion Planning 178 By solving the cubic polynomial of Fnom given in Eq . (B.14), the nominal feedrate is obtained to realize the correct motion duration. Once Fnom is found, the acceleration, decelera-tion, and jerk values are updated again using the following expressions, _ (Fnom fs) 7i +T2 _ (Fnom fs~) 7iVi'+:r2') ^nom (f ~F ) yj e nom> T*+T1 & J _ (fe Fnom) (B.15) By considering the compatibility and the kinematic parameter modifications, the kinematic profiles for trapezoidal acceleration feed motion planning are generated using Eq . (B.l), (B.2), (B.3), and (B.4). Appendix C Case Studies — Revision O f Axis Tracking Control Scheme The following examples demonstrate the proposed idea to reconstruct the axis control laws in a feedforward part and a feedback part: C . I . P-PI Control In the first example, the P-PI control scheme is assumed to be used as the axis tracking con-trol law. P-PI control is a common motion control scheme that has been widely used in C N C industry. The standard P-PI control consists of digital and analog control parts — Proportional gain (P) in the digital position control loop and Proportional and Integral gains (PI) in the analog velocity control loop. The overall scheme of the P-PI control is depicted in Fig. C .I : P-PI Axis Control DAC with ZOH + + Digital Position Proportional Control (P) Analog Velocity Proportional-Integral Control (PI) - • u c Figure C.I : Overall scheme of standard P-PI control where Kp , Kv , and Kt are the controller parameters corresponding to the proportional gain in digital position loop, the proportional gain, and integral gain in analog velocity loop, respectively. As P-PI control has a velocity control in the continuous time domain, a transformation from the s-179 Appendix C. Case Studies — Revision Of Axis Tracking Control Scheme 180 domain to the z-domain is applied in order to obtain the overall control scheme in the discrete time domain. Using Euler Backward Difference Approximation, the standard P-PI control is re-modeled as, P-PI Axis Control with Euler Approximation . DAC I with ZOH I I T * > | K v ] — • © — L - ^ * -T s - z 1 _ J + 1 K l ^ T I y A Figure C.2 : Revised P-PI control in discrete time domain Therefore, the transfer function of the P-PI control in the discrete time domain is approxi-mately defined as, " c m (z) = lUiz) -xm(z))-K-com(z)\ T -z K„+Kr s (Cl) ' z - 1 . The states of the input in the control system should only correspond to the axis motion instead of the angular motion. Therefore, revising Eq . ( C l ) yields, uPcP'(z) = (xr{z)-xm(z))-K - — -xm(z) T -z Eq. (C.2) is then expressed in feedforward and feedback components as, (C.2) [KP{KV+TS-K.)-Z-KP-KV] (z-l) 0 0 xr(z) xr(z) xr(z) '[KP{KV+T,-K,).Z-KP-Kv] [(Ky+T^Kj-z-K,] iz-l) xm(z) xm(z) xm(z) (C.3) Appendix C. Case Studies — Revision Of Axis Tracking Control Scheme 181 In addition, the digital control law is written at the sampling interval number k by taking the inverse z~l transform as: = {[KP{KV + TS • K;)]• xr(k)- [KP -Kv}-xr(k-1)} - {[K.{KV + TS • KT)\xm(k)-[K. •Kv\xm(k-\)} •xm(k)-_r8 _ + i i c m ( J k - l ) (C .4 ) C.2. PID Control In the second example, PID control is considered as the axis tracking control scheme. The standard PID control has three controller parameters ( Kp , K{, and Kd ) which correspond to the proportional action, the integral action, and the differentiation action, respectively. The PID control law in continuous and discrete time domains are expressed as follows, In continuous time domain, u (s) = Kp-+Kr- + Kd-s s •{xr(s)-xm(s)) (C.5) In discrete time domain, U P I D ( z ) Kp-+Kt •{xr(z)-xm(z)) (C6) Rewriting Eq . (C.6) into a feedforward component and a feedback component, in discrete time domain, gives, uP'D(z) = (Kp-Ts + KrTs2 + Kd)-z2+(-Kp-Ts-2-Kd).z + Kd T-z -T-z 0 0 (Kp-Ts + KrTs2 + Kd)-z2+(-Kp-Ts-2-Kd)-z + Kd Ts-z -Ts-z 0 0 xr(z) xr{z) xr(z)_ Xm(z) (C.I) Appendix C. Case Studies -- Revision Of Axis Tracking Control Scheme 182 The digital control law of PID control at the sampling interval number k is given as follows, P M [K • T + Kj • T2 + Kd) i-K-Ts-2-Kd) A T . . <™(*)= P ' J-xr(k)+K p s i l . X r ( k - i ) + - 4 - X r i k - 2 ) s s *s (K • T + KT • T2 + KD) ( - K - T s - 2 - K D ) A T , V P r ~ - ^W+ V P T dJ-xm(k-\) + ^-xm(k-2) (C.8) + u"lD(k-l) C.3. Sliding Mode Control In order to demonstrate a more complex case, a non-linear tracking control law, called Slid-ing Model Control (SMC), is considered as the axis tracking controller in C N C machine tool. Although the adaptive sliding control technique is not commonly used in the industry, it has been proposed and experimentally verified for the control of the high speed feed drives in C N C design literature [3]. S M C is robust and is capable of coping with changing external disturbances such as friction and cutting force, and uncertainties in the inertia of the drive. The control law of S M C is given as follows: uscMC(z)^Je-[Aixr(z)-xJz))+xr(z))+Be-xJz) + Ks-S(z) + d(z) (C9 ) where S(z) = A, • [xr (z) - xm (z)]+ [xr (z) - xm (z)] J T-z T-z s xr{z)—s—-xm(z) z-l Ka-Kt- rg & z - l B =• + [xr(z)-xm(z)]\ B Ka-Kt- r Je and Be are the equivalent inertia and viscous damping reflected on the motor shaft, respectively. S is a function of the desired sliding surface and d is the axis disturbance esti-mated using simple observer for adaptation. A , Ks, and p are the controller parameters of the Appendix C. Case Studies — Revision Of Axis Tracking Control Scheme 183 S M C design which correspond to the bandwidth of the sliding surface in [rad/sec], the feedback gain of the system in [Volt/(mm/sec)], and the disturbance adaptation gain in [Volt/mm], respec-tively. Substituting the expressions of S and d into Eq . (C.9) becomes, Ks-A + p + p-A Ks -A + p + p-A Ts-z z-l Ts-z z-l Je-A + Ks Je Je-A + Ks-Be 0 (CIO) The digital control law of S M C is expressed at the sampling interval counter k as, uscMC(k)= [(KsA + p + pATs)-xr(k)-(KsA + p)-xr(k-l)} + [(JeA + Ks)-xr(k)-(JeA + Ks)-xr(k-l)] + [je-xr(k)-Je-xr(k-l)] -[(KsA + p + pATs)-xm(k)-(KsA + p)-xm(k-l)] -[(JeA + Ks-Be)-xm(k)-(JeA + Ks-Be)-xm(k-l)) Appendix D Initial Setup For Experimental Test Platform D.l . Feed drive parameters for identified feed drives in experimental test platform Parameters in feed drive system X-Axis Y-Axis Feed Drive Rigid Body Dynamics Current amplifier gain, K a [A/Volt] 6.4898 7.5768 Motor gain, T m [N-m/A] 0.4769 0.4769 Total reflected inertia, J [kg-m2] 0.0077736 0.0098109 Viscous damping, B [kg -m Is] 0.019811 0.028438 Pitch length, h p [mm] 10 10 Leadscrew ratio, r g [mm/ rad] 1.5915 1.5915 Quantization and Saturation Limits D / A Convertor bit, nb [] 16 16 Voltage range of D / A chip, V D A C [Volt] ± 1 0 ± 1 0 D / A resolution, 8u [Volt] 3 .0518X10" 4 3.0518xl0~ 4 Quantization variance, R s [Volt2] 7.761X10" 9 7.761xl0" 9 Voltage saturation limits, u, mn 1 Umax [Volt] -10, +10 -10, +10 Measurement noise Linear encoder resolution, 8x [mm] 1.22X10" 3 1.22xl0~ 3 Linear encoder noise variance, R x [mm2] 1.2418xlO" 7 1.2418xl0~ 7 Tachometer noise variance, R < 2 > [{rad/sec)2] 0 0 Non-Linear Friction Characteristics Static friction, T ^ j [N-m] 2.6256, -1.8672 2.7658, -2.4520 Coulomb friction, T ^ [N-m] 2.1529, -1.4730 2.5228, -2.3887 Velocity threshold 1, cojjh/" [rad 1 s] 3.88, -3.51 2.37, -4.41 Velocity threshold 2, c o ^ [rad 1 s] 4.20, -3.52 3.01, -4.20 Backlash Backlash / Deadband, Db [mm] 0.003 0.003 Table D . l : Summary of feed drive parameters for experimental test platform 184 Appendix D. Initial Setup For Experimental Test Platform D.2. Kinematic parameters for trajectory generation The kinematic parameters for trajectory generation are summarized in Table D.2: Kinematic parameters for Trajectory Generation Feed motion planning with low smoothness level Acceleration limit, A [mm/sec ] 2,000 Deceleration limit, D [mm/sec ] -2,000 Feed motion planning with high smoothness level Acceleration limit, A [mm/sec ] 2,000 Deceleration limit, D [mm/sec ] -2,000 Jerk value, J [mm/sec3] 50,000 Interpolation period Interpolation period, T j n t [sec] 0.001 Table D.2 : Summary of kinematic parameters for trajectory generation Appendix D. Initial Setup For Experimental Test Platform 186 D.3. Controller parameters for axis tracking control schemes The controller parameters for various axis tracking control schemes used in simulations and experiments are summarized in Table D.3: Controller Parameters X-Axis Y-Axis P-PI Control Proportional gain in Digital Position Loop, K p [(rad 1 s)/mm] 30 30 Proportional gain in Analog Velocity Loop, K v [Volt /(rod 1 s)] 0.93 1.00 Integral gain in Analog Velocity Loop, Ki [Volt/rad] 128 138 Max. Overshoot in Analog [%] 1 1 Velocity Loop, Mpv Rise time in Analog Velocity Loop, trv [sec] 0.02 0.02 PID Control Proportional gain, K p [Volt 1 mm] 70 70 Integral gain, K; [Volt /(mm • s)] 800 800 Derivative gain, IQ [Volt /(mm/s)] 0.30 0.30 SMC Control Sliding surface bandwidth, X [rad 1 s] 200 200 Feedback gain, K s [Volt /(mm/ s)] 0.30 0.50 Disturbance adaptation gain, p [Volt 1 mm] 30 50 Control Sampling Control sampling period, T s [sec] 0.001 0.001 Table D.3 : Summary of controller parameters for axis tracking control schemes Appendix E Reference Kinematic Profiles For Diamond And Circle Shaped Toolpaths Diamond shaped toolpath -50 -40 -30 -20 -10 6 10 20 30 40 50 X-Axis [mm] X-Axis Y-Axis Resultant trajectories Reference trajectories Reference trajectories along desired toolpath 200 100 200 0 0.5 1 1.5 0 0.5 1 1.5 0 0.5 1 1.5 200 -200 -200 0 0.5 1 1.5 0 0.5 1 1.5 0 0.5 1 1.5 2000 2000 -2000 -2000 5000 -5000 0 0.5 1 1.5 0 0.5 1 1.5 0 0.5 1 1.5 Time [sec] Time [sec] Time [sec] Figure E . l : Reference trajectories for diamond-shaped toolpath with low smoothness level 187 Appendix E. Reference Kinematic Profdes For Diamond And Circle Shaped Toolpaths 188 Diamond shaped toolpath -50 -40 -30 -20 -10 0 10 20 30 40 50 X-Axis [mm] X-Axis Y-Axis Resultant trajectories Reference trajectories Reference trajectories along desired toolpath 50i 1 100i -1 200r 0.5 1 1.5 Time [sec] 0.5 1 1.5 Time [sec] 0 0.5 1 1.5 Time [sec] Figure E.2 : Reference trajectories for diamond-shaped toolpath with trapezoidal acceleration profiled feed motion planning Appendix E. Reference Kinematic Profdes For Diamond And Circle Shaped Toolpaths Circle shaped toolpath X-Axis [mm] Figure E.3 : Reference trajectories for circle-shaped toolpath with low smoothness level Appendix E. Reference Kinematic Profiles For Diamond And Circle Shaped Toolpaths 190 Circle shaped toolpath X-Axis Reference trajectories -50-40-30-20-10 0 10 20 30 40 50 X-Axis [mm] Y-Axis Reference trajectories Resultant trajectories along desired toolpath 0 0.5 1 1.5 Time [sec] 0 0.5 1 1.5 Time [sec] 0.5 1 1.5 Time [sec] Figure E.4 : Reference trajectories for circle-shaped toolpath with trapezoidal acceleration profiled feed motion planning Appendix F Composite Fuzzy Relation Table For SMC Tuning The composite fuzzy relation tables connecting the condition variables (OSC, P H M , and T R E ) to the action variables (DKS, and D R H O ) are given below: (1) OSC to DKS DKS -3 -2 -1 0 1 2 3 1 1 0.9 0.8 0.7 0.7 0.6 0.5 OSC 2 0.9 1 0.9 0.8 0.7 0.7 0.7 3 0.7 0.8 0.9 1 0.9 0.8 0.7 4 0.7 0.7 0.8 0.9 1 0.9 0.8 5 0.6 0.7 0.7 0.8 0.9 1 0.9 Table F . l : Composite Fuzzy-Relation Table - O S C to D K S OSC to DRHO DRHO -3 -2 -1 0 1 2 3 1 0.8 0.9 1 0.9 0.8 0.7 0.7 OSC 2 0.7 0.8 0.9 1 0.9 0.8 0.7 3 0.7 0.8 0.9 1 0.9 0.8 0.7 4 0.7 0.8 0.9 1 0.9 0.8 0.7 5 0.7 0.7 0.8 0.9 1 0.9 0.8 Table F.2 : Composite Fuzzy-Relation Table - O S C to D R H O PHM to DKS DKS -3 -2 -1 0 1 2 3 1 0.9 1 0.9 0.8 0.7 0.7 0.6 PHM 2 0.8 0.9 1 0.9 0.8 0.7 0.7 3 0.7 0.8 0.9 1 0.9 0.8 0.7 4 0.7 0.8 0.9 1 0.9 0.8 0.7 5 0.7 0.7 0.8 0.9 1 0.9 0.8 Table F.3 : Composite Fuzzy-Relation Table - P H M to D K S 191 Appendix F. Composite Fuzzy Relation Table For SMC Tuning PHM to DRHO DRHO -3 -2 -1 0 1 2 3 1 0.9 1 0.9 0.8 0.7 0.6 0.5 PHM 2 0.9 1 0.9 0.8 0.7 0.7 0.7 3 0.7 0.8 0.9 1 0.9 0.8 0.7 4 0.7 0.7 0.8 0.9 1 0.9 0.8 5 0.6 0.7 0.7 0.8 0.9 1 0.9 Table F.4 : Composite Fuzzy-Relation Table - P H M to D R H O TRE to DKS DKS -3 -2 -1 0 1 2 3 1 0.8 0.9 1 0.9 0.8 0.7 0.7 TRE 2 0.7 0.8 0.9 1 0.9 0.8 0.7 3 0.7 0.7 0.8 0.9 1 0.9 0.8 4 0.7 0.7 0.8 0.9 1 0.9 0.8 5 0.7 0.8 0.9 1 0.9 0.8 0.7 Table F.5 : Composite Fuzzy-Relation Table - T R E to D K S TRE to DRHO DRHO -3 -2 -1 0 1 2 3 1 1 0.9 0.8 0.7 0.7 0.6 0.5 TRE 2 0.9 1 0.9 0.8 0.7 0.7 0.7 3 0.7 0.7 0.7 0.7 0.8 0.9 1.0 4 0.7 0.7 0.8 0.9 1 0.9 0.8 5 0.7 0.8 0.9 1 0.9 0.8 0.7 Table F.6 : Composite Fuzzy-Relation Table - T R E to D R H O Appendix G Reference Kinematic Profiles F o r Back-And-Forth Mot ion Test The reference axis kinematic profiles for the back-and-forth motion response test is shown as follows: o u £ CD 0£ Q) O c <D c o "</> "E" o c a. E </> •""' 3 O CD © -i2 > E .<2 E 100 200 100 0 -100 -200 I i -v 1 1 1 1 ^ J ! \ 1 i ... ... . I i i ^ I 06 08 Time [sec] Figure G. 1 : Reference axis kinematic profiles for back-and-forth motion response test 193 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

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

Comment

Related Items