A Dynamic Circuit-Based Model for Ferromagnetic Materials by Kenneth Wicks B.A.Sc., The University of British Columbia, 1997 M.A.Sc., The University of British Columbia, 2001 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF Doctor of Philosophy in The Faculty of Graduate Studies (Electrical and Computer Engineering) The University Of British Columbia (Vancouver) March 2008 c© Kenneth Wicks 2008 Abstract In recent years there has been increased interest in the development of sensorless switched reluctance machine drives. The proper operation of a switched reluctance machine (SRM) requires knowledge of the position of the rotor of the machine. The inclusion of a physical position sensor compromises the inherent robustness of this type of machine. Thus, there has been a need to develop techniques to estimate the position of the rotor in SRM drives. Switched reluctance machines are able to operate over a large range in speed. A fully loaded SRM is typically designed to saturate the ferromagnetic material that comprises the stator and rotor of the machine whereas a lightly loaded machine does not. Therefore, the model of the machine should be able to handle both a large range in frequency and input excitation levels of the magnetic material in the machine. The development of a new dynamic circuit-based ferromagnetic model is described in this thesis. The investigation of the behaviour of 24 gauge M19 silicon steel led to the conclusion that, for this material, a circuit model that has static parameters is unable to accurately reproduce the behaviour of the actual material over a large range of input frequencies and excitation levels without resorting to retuning the parameters of the model. This thesis provides two new mechanisms that dynamically adjust the resistance values of the flux tubes of the model. Comparisons using a normalized vertical least-squares metric between the newly proposed dynamic model and a model that has static resistance values clearly show the improvement that is gained by using these mechanisms. A practical implementation of the new model is also given. Timing using a general purpose CPU shows that this implementation of the model will most likely be able to be used as part of a multi-phase lumped parameter model for a SRM in realtime. ii Table of Contents Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Table of Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii Acronyms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Switched Reluctance Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1.1 Machine Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1.2 Control of Switched Reluctance Machines . . . . . . . . . . . . . . . . . . . . 3 1.1.3 The Multi-Phase Lumped Parameter SRM Model . . . . . . . . . . . . . . . 5 1.1.4 Modification of the Multi-Phase Lumped Parameter SRM Model . . . . . . . 7 1.2 Intended Contribution of this Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.3 Utilized Material and its Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.4.1 Ferromagnetism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 1.4.2 Hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 1.4.3 Eddy currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.4.4 Relating the Magnetization of a Material to Other Field Quantities . . . . . 16 1.5 State of the Art . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.5.1 Finite Element Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1.5.2 Solution of the Diffusion Equation . . . . . . . . . . . . . . . . . . . . . . . . 18 1.5.3 Incorporation of Empirically Determined Equations for Eddy Current Losses 20 1.5.4 Circuit-Based Ferromagnetic Models . . . . . . . . . . . . . . . . . . . . . . 20 1.5.5 The Jiles-Atherton Model of Hysteresis . . . . . . . . . . . . . . . . . . . . . 21 1.6 Outline of this Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 2 Hysteresis Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.1 The Classical Preisach Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.1.1 The Hysteresis Operator γ̂αβ . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.1.2 The Preisach-Krasnoselskii Model . . . . . . . . . . . . . . . . . . . . . . . . 28 2.1.3 Explicit Formulation of the Preisach-Krasnoselskii Model . . . . . . . . . . . 30 iii Table of Contents 2.1.4 The Everett Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.1.5 Limitations of the Classical Preisach Model . . . . . . . . . . . . . . . . . . . 35 2.2 The Modified Preisach Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.1 The Model Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.2 Model Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 2.3 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 3 Existing Circuit-Based Ferromagnetic Models . . . . . . . . . . . . . . . . . . . . . 47 3.1 Circuit Based Modeling: A Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . 47 3.1.1 Basic Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 3.1.2 Tube Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3.2 Performance Trends in the Existing Circuits . . . . . . . . . . . . . . . . . . . . . . 55 3.2.1 Basic Circuit Performance with Fixed Rk . . . . . . . . . . . . . . . . . . . . 56 3.2.2 Static Modification to Rk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.2.3 Variation of Rk Based on the Variation of J . . . . . . . . . . . . . . . . . . 63 3.2.4 Variation of Rk Based on a Correction Factor for the Excess Currents . . . . 68 3.3 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 4 New Mechanisms for Circuit-Based Ferromagnetic Models . . . . . . . . . . . . 70 4.1 Mechanisms that Failed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 4.1.1 Direct Use of the Derivatives of the Circuit Mmfs . . . . . . . . . . . . . . . 70 4.1.2 The Use of the Flux and Mmf Derivatives Together . . . . . . . . . . . . . . 71 4.2 Proposed New Circuit Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 4.2.1 A Partially Successful Attempt . . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.2.2 Variation of Rk Based on Λk(Ḟk+1) . . . . . . . . . . . . . . . . . . . . . . 78 4.2.3 Accounting for Eddy Currents due to Domain Wall Motion . . . . . . . . . . 80 4.2.4 Procedure for Identifying the Parameters of the Model . . . . . . . . . . . . 85 4.3 Accuracy of the Proposed Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 4.3.1 Analytical Determination of the Accuracy . . . . . . . . . . . . . . . . . . . 88 4.3.2 Graphical Comparison Between a Dynamic and a Static Ten Tube Models . 95 4.4 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5 Implementation Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 5.1 An Implementation of the Modified Basic Circuit . . . . . . . . . . . . . . . . . . . 101 5.1.1 Discretization of the Basic and Modified Basic Circuits . . . . . . . . . . . . 102 5.1.2 Practical Implementation of the Modified Preisach Model . . . . . . . . . . . 104 5.1.3 Elimination of Stack Overflow Errors . . . . . . . . . . . . . . . . . . . . . . 108 5.1.4 Update of the Modified Preisach Model Based on the Value of B . . . . . . . 110 5.1.5 Modification of the Basic Circuit . . . . . . . . . . . . . . . . . . . . . . . . . 111 5.1.6 Putting it All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 5.2 Solution Convergence, Stability, and Computation Time . . . . . . . . . . . . . . . 122 5.2.1 Solution Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 5.2.2 Solution Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 5.2.3 Solution Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 5.3 Chapter Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 iv Table of Contents 6 Conclusions and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 6.1 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 Appendices A Acquisition of the Experimental Data . . . . . . . . . . . . . . . . . . . . . . . . . . 140 A.1 Test Material and Its Associated Coils . . . . . . . . . . . . . . . . . . . . . . . . . . 140 A.2 The Drive Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 A.3 The Data Acquisition Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 A.4 Test Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 A.5 Limitations of this Testing Approach . . . . . . . . . . . . . . . . . . . . . . . . . . 145 B Analysis Data and Supporting Curves . . . . . . . . . . . . . . . . . . . . . . . . . . 147 B.1 Error Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147 B.2 A Graphical Comparison Between Four Tube Dynamic and Static Models . . . . . . 148 B.3 Variation of Tube Resistances and Magnetic Intensity Profile Inside the Material . . 152 C ANSI C Code of the Realized Model . . . . . . . . . . . . . . . . . . . . . . . . . . 154 C.1 stdafx.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 C.2 main.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154 C.3 cpu time.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 C.4 cpu time.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 C.5 hysteresis.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163 C.6 lookup gain.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 C.7 lookup gain.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164 C.8 output m Bpv.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169 v List of Tables 1.1 Specifications of the test material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1 Data structure for µ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.2 Data structure for "Mj . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 4.1 Operating conditions for comparing the models . . . . . . . . . . . . . . . . . . . . . 89 5.1 Parameters of the IIR filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.2 Data structure for µ and Bpv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 B.1 Error data for the comparison of various models . . . . . . . . . . . . . . . . . . . . 147 vi List of Figures 1.1 Sensorless SRM drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Lumped parameter model for a 6/4 SRM . . . . . . . . . . . . . . . . . . . . . . . . 6 1.3 Geometry of the test material . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.4 Orbital and electron spin magnetic moments in an atom . . . . . . . . . . . . . . . . 11 1.5 Ferromagnetic and antiferromagnetic structures . . . . . . . . . . . . . . . . . . . . . 12 1.6 An illustration of hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.7 Sequence of magnetization changes due to an external H . . . . . . . . . . . . . . . . 15 2.1 The elementary hysteresis operator γ̂αβ . . . . . . . . . . . . . . . . . . . . . . . . . 28 2.2 The β − α plane showing the geometric interpretation of Equation 2.1 . . . . . . . . 29 2.3 A typical first order reversal curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.4 The β − α plane and the path of the material for sequence of reversals of H . . . . . 32 2.5 Definition of the triangular area T (α,β) . . . . . . . . . . . . . . . . . . . . . . . . . 34 2.6 Experimental first order reversal curves for test material . . . . . . . . . . . . . . . 39 2.7 Piecewise linearized first order reversal curves for test material . . . . . . . . . . . . 40 2.8 The relationship between the variables that are used to interpolate other first order reversal curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.9 The relationship between the variables that are defined in Equations 2.19 – 2.24 . . 43 3.1 Basic circuit that exhibits eddy current effects . . . . . . . . . . . . . . . . . . . . . 50 3.2 Three tube model with its magnetic equivalent circuit parameters defined . . . . . . 51 3.3 Electrical equivalent circuit of the basic eddy current model . . . . . . . . . . . . . 52 3.4 Classical and domain eddy current models . . . . . . . . . . . . . . . . . . . . . . . . 53 3.5 Tube Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3.6 60 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels 56 3.7 250 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 3.8 500 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 3.9 Variation of tube DC resistances with n . . . . . . . . . . . . . . . . . . . . . . . . . 61 3.10 Modification to Rk for n = 4 and 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 3.11 Definition of unit vectors for Equations 3.23 - 3.25 . . . . . . . . . . . . . . . . . . . 64 3.12 60 Hz curves for γ = 2/3 at three excitation levels . . . . . . . . . . . . . . . . . . . 66 3.13 500 Hz curves for γ = 2/3 at three excitation levels . . . . . . . . . . . . . . . . . . 67 4.1 Gain function g(Ḟ ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.2 Performance of a 10 tube model with the 1 + g(Ḟk+1)φ̇k correction factors . . . . . 74 vii List of Figures 4.3 Performance of a 4 tube model with the modification Rµk(µk) . . . . . . . . . . . . 78 4.4 Variation of Λ with |Ḟ | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 4.5 Definition of gz for a ten tube model . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 4.6 Variation of Γ with |Ḟ | . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4.7 Comparison between a dynamic and two static four tube models with 50 µs timesteps 90 4.8 Comparison between dynamic four tube models for two timesteps . . . . . . . . . . 91 4.9 Comparison between dynamic four and ten tube models with 25 µs timesteps . . . . 92 4.10 Effect of discretizing an inductor with the backward Euler integration rule . . . . . . 93 4.11 Response of ten tube models for 60 Hz input excitations . . . . . . . . . . . . . . . 96 4.12 Response of ten tube models for 250 Hz input excitations . . . . . . . . . . . . . . . 97 4.13 Response of ten tube models for 500 Hz input excitations . . . . . . . . . . . . . . . 98 4.14 Response of ten tube models for 1 kHz input excitations . . . . . . . . . . . . . . . 99 5.1 Circuit representation of the circuit elements . . . . . . . . . . . . . . . . . . . . . . 102 5.2 Determination of "Lpv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 5.3 Three possible new branches of the solution near (H0, B0) . . . . . . . . . . . . . . . 105 5.4 Flowchart for the hysteresis algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 106 5.5 Modified trajectory of the material . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 5.6 Flowchart for the hysteresis algorithm based on B . . . . . . . . . . . . . . . . . . . 110 5.7 Minimal realization of the IIR filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 5.8 A typical cell in the definition of gz . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 5.9 Three sided cells near the initial magnetization curve . . . . . . . . . . . . . . . . . . 115 5.10 Discretized three tube model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 5.11 Norton equivalent discretized three tube model . . . . . . . . . . . . . . . . . . . . . 119 5.12 Main flowchart for the implemented model . . . . . . . . . . . . . . . . . . . . . . . . 121 5.13 Iteration 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.14 Iteration 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 5.15 Iteration 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 A.1 Test material, driving, and sense coils . . . . . . . . . . . . . . . . . . . . . . . . . . 141 A.2 Drive circuit for the magnetic core . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 A.3 Schematic of the drive circuit for the magnetic core . . . . . . . . . . . . . . . . . . . 143 A.4 Testing apparatus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145 B.1 Response of four tube models for 60 Hz input excitations . . . . . . . . . . . . . . . 148 B.2 Response of four tube models for 250 Hz input excitations . . . . . . . . . . . . . . 149 B.3 Response of four tube models for 500 Hz input excitations . . . . . . . . . . . . . . 150 B.4 Response of four tube models for 1 kHz input excitations . . . . . . . . . . . . . . . 151 B.5 Magnetic intensity profile inside the material in time for a 10 tube model . . . . . . 152 B.6 Variation of the outermost tube resistances of a 10 tube model for the profile above 153 viii Acronyms AC Alternating Current DC Direct Current BE Backward Euler (integration rule) PI Proportional Integral (controller) A/D Analog to Digital emf Electromotive Force. Otherwise known as voltage mmf Magnetomotive Force 1D 1-Dimensional 2D 2-Dimensional 3D 3-Dimensional DSP Digital Signal Processing FEA Finite Element Analysis LTI Linear Time Invariant SISO Single Input Single Output MIMO Multiple Input Multiple Output MISO Multiple Input Single Output UBC The University of British Columbia FIR Finite Impulse Response (filter) IIR Infinite Impulse Response (filter) SRM Switched Reluctance Machine CPU Central Processing Unit ID Inner Diameter OD Outer Diameter ix Acknowledgements I would like to first thank my supervisors Dr. William Dunford and Dr. Luis Linares for their insight and guidance through the trails of this work. Without their help I would never have progressed to this point. I would also like to thank all of the members of the power group that I have had the pleasure to meet during my studies over the years . In particular, I would like to thank Magnus Lind, Michael Winch, Tom De Rybel, and Marcelo Tomim for all of your help and encouragement. You have brightened many otherwise dark days. I would not be here today without the support and love of my parents and family. It would take me many lifetimes to repay their boundless support. Finally, I am forever indebted to my dear wife, Cathay Zhang-Yi-Ying Wicks, for putting up with me over the last few years. Her patience and understanding has made this journey so much easier for me. x Chapter 1 Introduction The use of ferromagnetic materials is widespread since they allow the generation of large magnetic fields for relatively small values of current. Their use can be seen in many devices including power frequency transformers and electric machinery. Thus, the development of models that are suitable for characterizing the behaviour of ferromagnetic materials has been a focus of research for many decades in several fields. The ability to be able to predict the behaviour of ferromagnetic materials with models provides great advantages to the user of the materials. These models allow designers to do many things ranging from validating their designs to being part of an optimization algorithm for the geometry of the material. The literature contains many different approaches to modeling ferromagnetic materials. Every class of models have their own strengths and weaknesses. The choice of which class of model is appropriate for a given application depends on three major things: speed, accuracy, and ease of use. The work that is presented in this thesis provides an extension to a specific class of models that have been available for many years. The intended application of the new model is in the sensorless control of switched reluctance drives 1.1 Switched Reluctance Drives With the development of reliable power semiconductor devices and powerful microcontrollers, switched reluctance machine (SRM) drives have become feasible. Switched reluctance machines have several advantages over the more traditional types of electric machines. One of the chief advantages of SRMs is their ability to be operated at very high speeds – in some cases in excess of 100,000 rpm. Another important feature of SRMs is their ability to be used in hostile environments such as space. These machines are able to operate in these conditions because their construction is very simple and, therefore, very robust. However, one very limiting issue in the operation of SRMs is the requirement of the knowledge of the position of the rotor. If a physical sensor is utilized to measure the position then the robustness of the machine is severely compromised. Thus, a substantial amount of work in the area of sensorless control of SRMs has appeared recently in the literature [1–26]. Most of the literature on sensorless control of SRM drives has been focused on low to medium speed applications. The few papers that have dealt with very high speed SRM control are rare [1–3]. With the exception of a couple of papers by Panda et al. [4, 5], no current position estimation 1 Chapter 1. Introduction techniques have explicitly included the dynamic behaviour of magnetic materials in their models. There has been a fair amount of offline modeling work on the estimation of the behaviour of SRMs that includes some dynamic effects of magnetic materials [27–31]. However, based on the experience that has been gained from undertaking this work, the author of this work believes that all of the currently available models for SRMs have a major shortcoming. This shortcoming is that these papers present magnetic models that have static parameters. Based on the findings of this work, it is concluded that a static model with a single set of parameters cannot accurately reproduce the behaviour of ferromagnetic materials over a large range of frequencies and input excitation levels. This is particularly relevant to very high speed SRMs because they in fact do operate over a large range of speeds and levels of excitation of the magnetic material. Due to the nature of the operation of SRMs, a large range in speed equates to a large range in frequency. The major goal of this work was to provide a model that can be potentially used in realtime to accurately predict the position of the rotor of a SRM over a large range in operating speeds and load levels. Due to time constraints only part of this goal was achieved. However, the work that was completed constitutes the major part of the work that is needed to be done to achieve the stated goal. 1.1.1 Machine Structure A switched reluctance machine is typified by its double salient structure. This means that the machine has teeth (otherwise known as poles) on both its stator and rotor. For the vast majority of applications, the ability to be able to control the torque at any position and in either direction of rotation is necessary. Thus, configurations of SRMs that have this characteristic prevail over others that do not. Examples of SRMs that have this property include machines with six stator poles and four rotor poles, eight stator poles and six rotor poles, and twelve stator poles and eight rotor poles. A shorthand for specifying the structure of the machine has been developed. For the case of a SRM with six stator poles and four rotor poles the machine is called a 6/4 SRM. As with other machines, pairs of poles are electrically connected to become the phases of the machine. Furthermore, multiple pairs of poles can be electrically connected. Machines with this type of configuration tend to have shorter magnetic paths compared to machines that have single pairs of poles. Unfortunately, connecting more that one pair of poles to become a phase effectively increases the excitation frequency that is seen by the magnetic material. Depending on the char- acteristics of the magnetic material of the machine, this can potentially eliminate any benefits that are gained by having shorter magnetic paths in the material. A 6/4 SRM is an example of a three phase machine with a single pair of poles per phase while a 12/8 SRM is an example of a three phase machine with two pairs of poles per phase. Thus, for the same speed of rotation and the same size of machine, the excitation frequency of a 6/4 SRM is half that of the 12/8 SRM but its magnetic paths are double the length. 2 Chapter 1. Introduction Another defining characteristic of SRMs is their phase currents are unidirectional. This is in contrast to AC machines which require bidirectional currents. The orientation of the phase currents are set up to minimize the magnetic path length of the material during the commutation between the phases of the machine. The necessity for only unidirectional currents is the direct result of the physical mechanism behind the generation of the torque in this type of machine. SRMs operate on the principle that a force is produced on a structure in a magnetic field in order to decrease the reluctance of the magnetic path of the field. The reluctance of a magnetic circuit is analogous to the resistance in electric circuit theory. In the case of a SRM, the structure in the field is the rotor and the field is generated by concentrated windings on the poles of the stator of the machine. Thus, when a pair of stator poles is excited with a current in either direction, a force is generated on the rotor poles that are the nearest to the excited stator poles in order to align the rotor poles with the stator poles. If the phase currents of the machine are suitably generated and the number of stator and rotor poles of the machine are as described above then the machine can exhibit continuous torque in either direction. A silhouette of a 6/4 SRM is given later when an equivalent circuit model of the machine is presented. 1.1.2 Control of Switched Reluctance Machines In order to understand how SRMs are controlled, consider a typical block diagram of a sensorless SRM drive that is given in Figure 1.1. PI ! Kt θo θc A B C d dt Vdc A/D A/D θ θo θc ω v i p p imax imin i*T*e m ωm* d rise/fall angle generator position estimator selector/ phase hysteresis controller torque controller hysteresis band generator SRM power electronics circuit speed controller controller Figure 1.1: Sensorless SRM drive While the specifics of the control algorithms of SRMs are beyond the scope of this work, a 3 Chapter 1. Introduction general description is given to emphasize the need for the estimation of the rotor position. As mentioned above, the phase currents of the machine generate a magnetic field in the machine that tends to align the poles of the rotor with the currently excited stator poles. If the rotor poles that are closest to the excited stator poles are moving towards the stator poles then the torque on the rotor is positive. Conversely, if the rotor poles are moving away from the stator poles then the torque on the rotor is negative. As a result, the phase current should be reduced to zero as close to the alignment position of the poles as possible to minimize the generation of negative torque. The number of degrees of rotation that is required to do this depends on both the current speed of the rotor of the machine, ωm, and the value of the current. The rise/fall angle generator block in Figure 1.1 is a predetermined 2-dimensional lookup table that outputs the required fall (or turn-off) angle, θc, of the machine based on the speed of the machine and the desired value of the phase current, i∗. Similarly, the rise (or turn-on) angle, θo, is determined by the desired value of current for the next phase of the machine and the current speed of the rotor. The current is controlled with a hysteresis type of controller. A band around the desired value of current is specified based on the amount of allowable ripple in the current and the update rate of the control algorithm. If the measured value of the phase current, ip, is larger than the upper value of the band, imax, then a negative voltage is applied to the phase to decrease the value of the phase current. Conversely, if the phase current is lower than the lower value of the band, imin, then a positive voltage is applied to the phase to increase the value of the phase current. For all other cases the value of the phase voltage is maintained at its current value. The phase that the voltage is applied to is determined by the current value of the position of the rotor, θ. This is determined by the phase selector/controller block in Figure 1.1. In fact, the hysteresis controller block in Figure 1.1, actually contains a hysteresis controller for each phase of the machine. The phase selector/controller block either enables or inhibits the actions of each hysteresis controller based on the state of the machine. For example, the value of the desired current is overridden in order to properly switch the current off in the current phase i.e. the current is set to zero when the block determines that it is time to switch off the current in the conducting phase. Likewise, when it is time to ramp up the current in the next phase of the machine then the appropriate hysteresis controller is enabled. For high speed operation of the machine, the control of the machine becomes wholly based on the generated rise and fall angles since the phase currents can no longer be arbitrarily controlled. In this mode of operation, the output of the hysteresis controller block is completely determined by the phase selector/controller block. In all modes of operation of the machine the duty cycle, d, of each phase is either set to one to increase the current in that phase or to zero to decrease the current in that phase. The duty cycle signals are given to a power electronics circuit that is fed with a voltage that is fixed at some value. Note that the structure of the power electronics circuit effectively blocks negative values of current except for a typically small undershoot that occurs when a phase current goes to zero. 4 Chapter 1. Introduction Since the controller for the machine is typically implemented in a microcontroller such as a digital signal processor, the analog phase currents and voltages need to be converted into digital. This is performed with analog-to-digital (A/D) converters. Typically, microcontrollers have on- board A/D conversion. The value of the desired current is generated by the torque controller block that is shown in Figure 1.1. The input of this block is the desired electrical torque, T ∗e that is generated by the speed controller that is also shown in Figure 1.1. The torque constant Kt is not necessarily constant as it is in other machines. The error in the speed of the machine is the input to the speed controller. The speed controller is typically a saturable proportional-integral (PI) type of controller. The last block in the sensorless controller of a SRM is the position estimator. As is mentioned above, it is the improvement in the accuracy of this block that is the motivation for this work. The approach to achieve this goal is given next. For further details on the structure, design, and control of SRMs please refer to a comprehensive book on this subject by Miller [32]. There is also another book that is available that gives a collection of topics on SRM control that is edited by Miller [33]. 1.1.3 The Multi-Phase Lumped Parameter SRM Model From the above discussion, it is clear that the current position of the rotor is required to properly control the switching of the phases of the machine. To this end, an estimation of the position of the rotor is required. One important phenomenon that occurs in the high speed operation of SRMs is the simultaneous conduction of current in more than one phase of the machine at a time. This can occur for significant periods of time at high speeds. Since the characteristics of ferromagnetic materials are very nonlinear, a simple superposition of the results of separate phases can produce large errors in the estimation of the position. To account for the mutual effects of the phases and to allow for the multi-phase excitation of the machine, a lumped parameter model by Lyons et al. provides an excellent way of consistently finding the position of the rotor [6, 7]. Figure 1.2 illustrates this model for a 6/4 machine. Note that the airgaps that are shown in the machine silhouette are greatly exaggerated to show the relationship between the physical machine and the parameters of the model. Also, only the winding for phase A is shown. The parameters of the model as given in Figure 1.2 are as follows: FA is the input magnetomotive force of phase A; FB is the input magnetomotive force of phase B; FC is the input magnetomotive force of phase C; RSP is a saturable element that represents the reluctance of the base of the stator poles; RRP is a saturable element that represents the reluctance of the base of the rotor poles; 5 Chapter 1. Introduction R SC F A F A F B F B F C F C R SC R SC R SC R SC R SC R PP R PP R PP R PP R PP R PP R SP R SP R SP R SP R SP R SP R PC R PC R PC R PC R PC R PC R RP R RP R RP R RP R RP R RP RRC R RC R RC R RC R RC R RC R RPT R RPT R RPT R RPT R RPT R RPT R G R G R G R G R G R G R SPT R SPT R SPT R SPT R SPT R SPT Figure 1.2: Lumped parameter model for a 6/4 SRM RSPT is a saturable and position dependent element that represents the reluctance of the tips of the stator poles; RRPT is a saturable and position dependent element that represents the reluctance of the tips of the rotor poles; RG is a non-saturable and position dependent element that represents the reluctance in the airgaps of the machine; RSC is a saturable element that represents the reluctance of the backplane (or core) of the 6 Chapter 1. Introduction stator; RRC is a saturable element that represents the reluctance of the core of the rotor; RPP is a non-saturable element that represents the reluctance of the air path between adjacent stator poles of the machine; RPC is a non-saturable element that represents the reluctance of the 3-dimensional end effects of the machine and the leakage paths in air between the stator poles and backplane. The magnetomotive forces (mmf) FA, FB, and FC are equal to the number of turns on each individual stator pole multiplied by the appropriate phase current e.g. FA = NiA where N is the number of turns. In order to determine the position of the rotor, the simultaneous sampled values of the phase currents and fluxes are necessary. Flux is analogous to current in electric circuits theory, however, there is an inherent danger in using this analogy. This danger is explained later in Chapter 3 when the flux is defined. The phase currents are already available since the hysteresis controller requires their values. The fluxes can be estimated from the phase voltages, phase currents, and the winding resistances. In the existing model, the values of the mmf drops across the position independent reluctances as a function of the flux through the element are stored in a look-up table. The reluctances of the stator and rotor pole tips and the airgap are combined to form a single position and flux dependent reluctance, RGT . This gap-tip reluctance function can be inverted at a known flux levels to obtain a set of curves that relate the position as a function of reluctance and flux level. Thus, once the values of the reluctance across the airgaps are calculated from the rest of the model, the value of the position can be determined with a 2-dimensional lookup table that stores the values of the position as a function of the gap-tip reluctance and flux level. Due to the typical relationship between the rotor position and the current for different levels of flux, it is well documented that there are optimum ranges of position to calculate the position for each phase [6]. Outside of these regions, the error in the position estimate can be potentially very large. One drawback of the model that was proposed by Lyons et al. is it does not account for the dynamic effects of the material. Since this model is inherently very accurate, it was decided to modify the model to include these missing effects. These modifications are discussed next. 1.1.4 Modification of the Multi-Phase Lumped Parameter SRM Model The base model that was proposed by Lyons et al. is modified by replacing the time-invariant saturable inductances with time variant reluctances that exhibit hysteresis and eddy current ef- fects. This involves both the determination of a suitable model for the new reluctances and the 7 Chapter 1. Introduction modification to the existing implementation of the SRM model for the inclusion of the new circuit elements. The work that is presented in this thesis is entirely focused on the first task. However, some comments on the second task are presented to give a sense of what still needs to be done. The position in the new framework can be calculated in a similar fashion to the original model. First, the mmf drops are computed for the position independent reluctances. The sum of these mmf drops for each phase then gives the mmf drop across the position dependent RGT reluctances. The mmf drop for the phase with the least expected error in the position is then compared to the mmf drop that is calculated by using the elements for RGT . It is likely that the position data will be stored in small increments instead of being continuous. The estimate of the position is obtained by minimizing the difference between the two mmf drops across the position dependent reluctances. Note that this determination of the position gives the rotor angle relative to the aligned position of the chosen phase but not which side of the aligned position. The other phases are used to determine what side of the stator pole this angle refers to in order to find the absolute position of the rotor. The big disadvantage of this approach is it numerically quite complex. The determination of the rotor angle needs to be performed many times between commutations of the phases in order to preserve the proper dynamic behaviour of the new reluctance elements as opposed to only a few times for the original model. Furthermore, the time to calculate a single rotor position is also significantly longer compared to the original model. Finally, a mechanism also needs to be devised to update the history terms of the model when the accuracy in the absolute position is poor. 1.2 Intended Contribution of this Work The intended contribution of this thesis is: to produce a model that can be potentially used in realtime to predict the behaviour of a given ferromagnetic material of a given geometry over a large range of excitation frequencies and over a large range of saturation levels without resorting to retuning the parameters of the model. The key to the stated objective is the requirement that the parameters of the model are only determined at the time of the model’s formulation and thereafter remain fixed. As was briefly mentioned above, the pre-existing schemes are unable, in general, to achieve this without a loss in accuracy. As will be seen, this loss in accuracy can be quite severe. It is hoped that this new type of model can then be used for the online prediction of the position of the rotor of a switched reluctance machine. Note that the application of this type of model is not just limited to the prediction of the rotor position of a SRM. It can also be used as part of an offline model to design and validate the performance of many different kinds of devices including but not limited to fast acting solenoids and SRMs. 8 Chapter 1. Introduction 1.3 Utilized Material and its Geometry The magnetic material that was studied in this work is used by a commercial SRM. Since the efficiency of the machine is not a factor for this particular machine, the SRM is designed as cheaply as possible. As a result, the magnetic material is relatively thick for this type of machine. Based on the information from the manufacturer of the machine, the material is industrial grade M19 silicon steel. The magnetic material is doped with a small percentage of silicon to decrease the resistivity of the material. This comes at a cost to the magnetic properties of the material but this cost is relatively small. The specified thickness of the material is 0.635 mm. In the gauge system of specifying thicknesses, this corresponds to 24 gauge. The material was cut into a torus with a rectangular cross-section. This geometry is shown in Figure 1.3. The coil that drives the material is wound such that the excitation H field is in the direction that is shown in the figure. The other details for the winding arrangement of the driving coil and the sense coil are given in Appendix A. However, it is worth noting here that the coils are arranged in order to minimize any leakage paths of the flux. Leakage flux tends to vary the value of the magnetic field density along the magnetic path. Thus, large errors can occur in the measurements of the characteristics of the material if significant leakage paths exist. The specifications of the material along with the dimensions of its geometry are tabulated in Table 1.1. H ½ID ½OD w Figure 1.3: Geometry of the test material The material was cut using an abrasive high pressure water cutter. Since this process does not generate heat it is assumed that magnetic properties of the material were not overly affected 9 Chapter 1. Introduction by this process. The act of manipulating the material can cause minute stresses and deformities in the crystal lattice of the material. As is discussed below, the work that is required to move the domain walls of the material will increase if there are more irregularities or stresses in the lattice. Typically, laminations that are punched out of raw materials need to be heat treated by a process called annealing to bring the magnetic properties back to those that are specified by the manufacturer. It is hoped that the process of abrasive water cutting essentially leaves the magnetic properties of the material intact. The material was cut from the stator of the aforementioned machine. Initially, the material in the stator of the machine was tested but the irregular shape of the stator makes it very difficult to isolate the properties of the material from other effects such as air leakage paths between stator poles. However, the general shape and magnitude of the response of the material in the uncut stator and the test geometry are quite similar. This gives confidence that the process of abrasive water cutting is relatively unobtrusive. Table 1.1: Specifications of the test material Parameter Value Unit Type M19 silicon steel Grain-oriented ? No Nominal resistivity 2× 10−5 Ω-m 1/2ID 57.5 mm 1/2OD 62.3 mm w 0.635 mm 1.4 Basic Concepts Before the discussion can proceed any further some basic concepts of ferromagnetic materials need to be discussed. Most of the discussion that is presented here is taken from Magnetoelectric Devices: Transducers, Transformers, and Machines by Slemon [34]. The properties of ferromagnetic materials can be split into two broad categories: time rate dependent and time rate independent. This is not to say that the time rate independent properties do not vary with time but that their variation is not a function of the rate of change of time. The properties that are of interest to this work are hysteresis and eddy current effects. Hysteresis 10 Chapter 1. Introduction effects are time rate independent whereas eddy current effects are time rate dependent. Before these properties can be discussed, however, a basic definition of ferromagnetism is required. 1.4.1 Ferromagnetism Magnetic effects in all materials are the result of the orbital motions of electrons about the nuclei of atoms and the spin motion of each electron as is depicted in Figure 1.4. A net magnetic moment exists in atoms that have an incomplete inner shell of electrons. In these atoms the spins of electrons in one direction are not completely cancelled by electrons with the opposite spin direction. Thus, a net magnetic moment is produced. For illustration purposes an atom with a net magnetic moment can be considered as equivalent to a small constant current loop. Only changing the orientation of the spin axis of the electrons can alter the direction of this equivalent current loop. pm pm Figure 1.4: Orbital and electron spin magnetic moments in an atom The alignment of an equivalent current loop in proximity to other current loops dictates whether or not a material is ferromagnetic. Consider the two potential cases that are given in Figure 1.5 below. The case of antiferromagnetism that is shown in Figure 1.5(b) occurs when the atoms are in too close proximity to each other. Materials with this arrangement have no benefit because the magnetization M that is produced can not link an external current carrying coil. On the other hand, the magnetization that is produced in the ferromagnetic case that is depicted in Figure 1.5(a) is useful since it does have the ability to link an external coil. However, materials made of pure elements that are naturally ferromagnetic at useable temperatures are not the only materials that can display ferromagnetism. If an antiferromagnetic element is combined with a nonmagnetic element then the spacing between the atoms can become larger. In these cases the resulting material 11 Chapter 1. Introduction M pm M i (a) ferromagnetic M pm M i (b) antiferromagnetic Figure 1.5: Ferromagnetic and antiferromagnetic structures can display ferromagnetic properties. In summary, materials that display ferromagnetism are, at a minimum, partially composed of atoms that are able to produce a net magnetic moment. The magnetic moments in the crystal lattice of the material also need to be orientated as is shown in Figure 1.5(a) for ferromagnetism to occur. 1.4.2 Hysteresis Hysteresis is defined by the Oxford American Dictionary as: the phenomenon in which the value of a physical property lags behind changes in the effect causing it, as for instance when a magnetic induction lags behind the magnetizing force. This lag is best illustrated by considering a typical hysteresis loop in a ferromagnetic material that is shown in Figure 1.6. The quantity H is the magnetic (field) intensity whereas the quantity B is the magnetic field (density). The B field is also sometimes called the magnetic flux density. The units for H are typically given in A/m while the units for B are typically given in T. The trajectory from the origin to the positive extremum in the trajectory is called the initial magnetization curve. It is called this since the material starts from a demagnetized state and increases (or decreases) until the direction of H is reversed. Notice that for a negative-going trajectory the value of B is non-zero when H becomes zero. In fact, the B becomes zero for a negative value of H. Clearly, the B field (the response) lags behind the H field (the cause). The cause of hysteresis in ferromagnetic materials is due to physical structure of the material. Ferromagnetic materials are comprised of magnetic domains. In a given domain all of the magnetic 12 Chapter 1. Introduction H B Figure 1.6: An illustration of hysteresis moments are aligned in the same direction. Without an external H field, the alignment of the moments within the domains are in directions that minimize the total energy of the crystal structure of the material. The number of minimum energy alignments of the magnetic moments within the crystal structure of the material is highly dependent on the structure of the crystal itself. The application of a sufficiently large external H field allows the magnetic moments to be rotated in the direction of the field. The resulting additional energy that is stored in the crystal lattice of the material is called the magnetic anisotropy energy. If at a later time the H field is removed, the magnetic moments move to the closest minimal energy alignment. The new alignment of the magnetic moments are not necessarily the same as the configuration before the external field was applied. The rotation of the magnetic moments within the domains of the material is associated with domain rotation. Adjacent domains are separated by a thin wall. The magnetic moments within the wall are smoothly rotated from the alignment on one side of the wall to the opposing alignment on the other side. Since the magnetic moments within the wall are not aligned in any of the minimal energy configurations of the crystal, energy is stored within the wall. If a sufficiently large external H field is applied to the crystal lattice of the material, the domain wall will move in order to enlarge the domain that is aligned closest to the direction of the external field. The value of H that is required to achieve this is called the coercive force. In the event that a new domain wall is required to be created, such as when the material is moving from a state of saturation, the wall is initially located such that its total volume is minimized. The energy that is used in moving the wall across the material is irrecoverable. It is used to push the wall across regions in the material with impurities, irregularities, or strains in the crystal lattice. Eventually the energy is dissipated as heat in the 13 Chapter 1. Introduction material. The loss that is the result of this process is called the hysteresis loss. The two preceding affects that occur as the result of the application of an external H field are dominant for different parts of the hysteresis loop. This is because the strength of the field that is required for domain rotation is considerably higher than that for domain wall motion. Furthermore, materials that already have their grains oriented in the direction of the field essentially do not require domain rotation. The losses in these grain-oriented materials are, therefore, less than materials that have no preferred direction of magnetization. The material that was utilized in the work that is presented in this thesis is of the latter type. The actual mechanism that causes the magnetic moments to rotate is a torque that is created in presence of the external H field. This torque, is given by: Tm = pm× µ0H (1.1) where pm is the value of the magnetic moment of the atom with units A-m2 and µ0 is a constant called the permeability of free space. Its value is 4pi × 10−7 Wb /(A-m). Since the value of the magnetic moments is essentially fixed, the magnitude of H dictates the variation of the torque that acts on the moments. Thus, the amount of the magnetization can be directed controlled by the variation of H. To illustrate the difference between domain wall movement and domain rotation consider the sequence of changes in the magnetization of a section of a ferromagnetic material that is depicted in Figure 1.7. These changes are the result of the monotonic increase in the magnitude of H. Note that the domain wall that is shown as a dashed line in Figure 1.7 is for illustration purposes only. In actuality, the wall is typically hundreds of atoms thick. The first three steps in the sequence show the movement of the domain wall whereas the last step shows the result of domain rotation. Initially, the net magnetization of the section of material that is shown in Figure 1.7(a) opposes the external H field. As the value of H increases, the domain wall that separates the magnetic moments with opposite directions moves downwards as is shown next in Figure 1.7(b). This results in a component of the net magnetization that is now in the same direction as H. Further increasing H rids this section of the material of any domain walls as is depicted in Figure 1.7(c). As Figure 1.7(d) shows, the magnetic moments are then finally aligned with the external H field. Once the magnetic moments are fully aligned with the H field further increasing H does not increase the magnetization. At this point the material is deemed to be fully saturated. The value of B at this point is typically called the saturation flux density. The concepts of hysteresis and the domain structure of ferromagnetic materials are used through- out this work. These basic concepts are expanded upon as is necessary. In particular, Chapter 2 shows the development of a class of practical hysteresis models and Chapter 4 shows a modification to existing models that is based on magnetic domains. 14 Chapter 1. Introduction H DOMAIN WALL C RY ST A L B O U N D A RY (a) H (b) H (c) H (d) Figure 1.7: Sequence of magnetization changes due to an external H 1.4.3 Eddy currents The existence of eddy currents is a direct consequence of Faraday’s Law. Faraday’s Law states that for any surface that is bounded by the closed line, the time rate of change of the flux perpendicular to the surface gives rise to a voltage along the line i.e. E = −dφ dt (1.2) where E is the voltage in volts (V) and φ is the flux. If the area of the surface is given by A and the magnetic field B is constant on the surface then φ = BA. The negative sign in Equation 1.2 indicates that the voltage is set up to oppose the 15 Chapter 1. Introduction change in flux. A current will then flow along the line as a result of the voltage. This current is called an eddy or Foucault current. The specific amount of current depends on the value of the voltage and the conductivity of the material that the current is passing though. This current loop gives rise to a B field that opposes the change in the original B field. The generation of eddy currents results in the phenomenon called the skin effect. The name is aptly chosen since, for current carrying conductors, the current tends to flow on the outside of the material. The depth at which the current falls to 1upslopee of its original value is given by: δ = √ 2 ωµ0σ (1.3) where σ is the conductivity of the material and ω is the frequency (in rad/s) of the current. δ is typically called the depth of penetration. Note that the conductivity of a material is the reciprocal of its resistivity. The SI unit for conductivity is S/m. For magnetic systems the concept of the skin effect also applies. However, the skin effect refers to the attenuation of the H field as it penetrates the core of the magnetic material. Since ferromagnetic materials are nonlinear, the depth of penetration varies as H varies. Once definition that was developed for sinusoidally excited saturated cores by MacLean and Agarwal [35, 36] is: δ = √ 2H0 ωσB0 (1.4) where H0 is the peak of the magnetic intensity at the surface of the core. B0 was proposed by Agarwal to be 75% of the saturation flux density. If x is the distance from the surface of the core then the relationship between H and B at x is approximated by Bx = B0sign(Hx). Note that the value of δ in Equation 1.4 gives the absolute penetration depth not the depth at which H falls to 1upslopee of its original value. Some authors use Equation 1.3 for magnetic materials by replacing µ0 by µ. This is only very approximate at best since µ is a function of time and the wave solution that generates Equation 1.3 assumes that the intrinsic parameters of the medium are time invariant. One of the main uses of the depth of penetration is to estimate the number of layers that are required for circuit based ferromagnetic models. 1.4.4 Relating the Magnetization of a Material to Other Field Quantities The magnetization M of a material is related to the H field and B field in the material by: M = 1 µ0 B −H (1.5) 16 Chapter 1. Introduction Typically M is replaced with H in Equation 1.5 by assuming that M and H are related by: M = χmH (1.6) where χm is the magnetic susceptibility of the material. It is dimensionless if H and M are expressed in the same units. Substituting M from Equation 1.6 into Equation 1.5 yields the more commonly found B = µH. The constant of proportionality µ is called the permeability of the material. Classically, Equation 1.6 is only valid for linear media since χm is assumed to be a constant. However, for nonlinear hysteretic media, the end result B = µH is useful if µ is defined by the slope of the curve relating H and B. 1.5 State of the Art There are numerous papers in the literature that address the various aspects of ferromagnetic materials. This section provides a glimpse into the papers and methodologies that are the most suitable for a start point of this work. Other techniques that are clearly not suitable for solving the aforementioned problem are also mentioned for completeness. The requirements that are stated above place restrictions on the modeling techniques that are currently available. For instance, the use of finite element element analysis is not considered since the computational times for this class of models is excessively long. The unbounded nature of the iterative nonlinear solution techniques that are mostly used today are also unsuitable for realtime applications. 1.5.1 Finite Element Analysis In finite element analysis (FEA) the physical device is represented by a 2-dimensional (2D) or 3-dimensional (3D) mesh of objects. The fields inside the objects are allowed to vary based on a polynomial of a fixed order. The algorithm then solves the fields inside the objects based on the values of the field on its surfaces. The solution is deemed to be correct when the boundary conditions on all adjoining surfaces of all of the objects are matched to within a specified error. With a large number of elements, this procedure takes a very long time — in the order of hours to stimulate a transient case for a simple rotating 3D device with a fine mesh. The excessively long simulation times of this approach makes it impractical for many situations. Clearly, for the intended use of the model examined in this work, this approach is too unwieldy. However, for the determination of reluctances in air or for static solutions of the fields inside materials, finite element analysis is a very useful tool. One approach that has gained popularity is the solution of circuit based models that are coupled 17 Chapter 1. Introduction with FEA models. In some of these cases, the airgap reluctances are represented with a FEA model and the material with a lumped parameter circuit model. This approach significantly improves the speed of the overall solution while retaining a good portion of the accuracy of the original FEA model. 1.5.2 Solution of the Diffusion Equation Many approaches derive analytical equations for the solution of the H field inside ferromagnetic materials staring from the 1-dimensional (1D) diffusion equation. The specific case of the diffusion equation for the laminations of a transformer is well known [37]. Assuming that the external H field is in the +z direction, the 1D diffusion equation in rectangular (x,y,z) coordinates can be written as: ∂2 ∂x2 Hz(x, t) = σ ∂ ∂t Bz(x, t) (1.7) Bz(x, t) = f ( Hz(x, t) ) (1.8) As is discussed in Section 1.4.3, the fields inside the material are attenuated by the presence of eddy currents. The electric field that drives these currents is related to H by: ∂ ∂t Hz(x, t) = −σEy(x, t) (1.9) where Ey(x, t) is the electric field. Typically, the units of the electric field are given in V/m. Equations 1.7–1.9 are solved subject to boundary conditions that are specified based on the assumptions that were made in the formulation of the model. For instance, the main assumption of this formulation is the height of the lamination is significantly larger than its width. Thus, the effects near the ends of the lamination are ignored. The 1-dimensional diffusion equation can also be solved using cylindrical coordinates. An example of this is presented in Chapter 4. The diffusion equation accounts for eddy currents that flow in the classical sense. It does not, however, model the currents that are generated in order to dampen the movement of the domain walls. This is a major limitation of the model. The errors that are produced by models that do not include eddy currents due to domain wall movement can be very significant if the core is not allowed to saturate to any extent. This is further explored in Chapters 3 and 4. One of the key difficulties in finding the solution to Equations 1.7–1.9 is the relationship between Hz(x, t) and Bz(x, t) is nonlinear and hysteretic. The choice of hysteresis models can dictate what is a feasible approach to finding the solution. Two very popular classes of hysteresis models are the Preisach and Jiles-Atherton approaches. The Preisach approach is dealt with extensively in Chapter 2 whereas the Jiles-Atherton approach is presented below. 18 Chapter 1. Introduction The solution for the 1D diffusion equation needs to be solved numerically since its parameters are very nonlinear. There are many ways to numerically represent the diffusion equation. Naidu proposed using a spline function to represent the distribution of H in subintervals of a single lamination [37]. His formulation uses a Preisach model to model hysteresis. The resulting model requires solving a set of seven non-linear equations. Stoll’s book The Analysis of Eddy Currents is the start point of many papers that utilize his approximations for magnetic diffusion problems [38]. One approximation that is frequently used is to model cylindrical geometries by “rolling” the angle out flat. The solution of the problem is then formulated for an infinite plane that has a width equal to the original radius of the cylinder. The time derivative in the resulting diffusion equation is then replaced by the Laplace variable s = jω. This approximation has also been applied to geometries with a square cross-section if the square cross-section is approximated with a circular cross-section [39]. The resulting solution of the 1D diffusion equation for these cases is given by: Hz(x, s) = H(rm, s) cosh ( x √ µωs ) cosh ( rm √ µωs ) (1.10) where rm is the radius of the cylinder or half the length of the side of the square cross-section. It is this approach that is utilized by Dallago et al. to model a high frequency transformer with a ferrite core [39]. Although, the model in this paper is developed for ferrimagnetic (ferrite) materials, the basic results of the paper provide useful information. Using Equation 1.10, they present a circuit-based model with core reluctances given by: R(s) = R0 √ s ω0 coth (√ s ω0 ) ∼= R0 ( 1 + s 3ω0 ) if ω & ω0 (1.11) where R0 is the DC reluctance of the section of the core to be modeled and ω0 = 1upslopeµσr2m. The DC reluctance of the core can be modeled with any hysteresis model. The authors use the Jiles-Atherton approach. One particularly interesting result of using this approach is the frequency dependent portion of the reluctance R0upslope3ω0 does not depend on µ so long as ω & ω0. While this is the case for a large range of ferrimagnetic materials, it certainly is not for the case of ferromagnetic materials. Furthermore, the solution of the diffusion equation given by Equation 1.10 assumes that the parameters σ and µ are time invariant. This is certainly not true to any extent for inputs that saturate the core — µ changes significantly in a cycle that saturates the core. Thus, this approach is only useful for modeling ferromagnetic materials in certain very restrictive cases. 19 Chapter 1. Introduction The problems that are associated with using a solution of the form of Equation 1.10 does not invalidate the use of the diffusion equation. Rather, they reinforce the fact that Equations 1.7–1.9 must be solved using nonlinear solution techniques for the majority of cases with ferromagnetic materials. 1.5.3 Incorporation of Empirically Determined Equations for Eddy Current Losses The use of empirically determined equations for determining the contribution of eddy currents to the instantaneous value of H in the core of a ferromagnetic material is widespread [40–43]. In particular, these equations are often used in the determination of the iron losses of the material. The contribution of the eddy currents to H that are produced in the classical sense is given by: Hcls = k1 dB̄ dt (1.12) where k1 is a constant that is determined by fitting experimental data and B̄ is the average value of the B field in the material. The contribution of the eddy currents that flow as the result of domain wall movement is found to be: Hexc = k2 ∣∣∣∣dB̄dt ∣∣∣∣ 12 (1.13) where k2 is a constant that is determined by fitting experimental data. Thus, the instantaneous value of H inside the material can be determined by: H(t) = Hext −Hcls −Hexe (1.14) where Hext is the externally applied H field. As with the other modeling approaches, the relationship between H and B is determined with the use of a hysteresis model. Papers that describe models that use the Preisach or Jiles-Atherton hysteresis formulations can both be found in the literature for this class of solution techniques. Note that the average value of B in the material is used in Equations 1.12 and 1.13 instead of the value of B at a particular depth. Additionally, these relationships are developed using sinusoidal excitations. Both of these conditions impose rather restrictive limitations on the validity of using this approach. This is discussed in further detail in Chapter 3. 1.5.4 Circuit-Based Ferromagnetic Models Since these circuits are the focus of this work, a whole chapter is devoted to exploring the perfor- mance of the preexisting circuits. However, for completeness some general commentary is included 20 Chapter 1. Introduction here. Circuit-based modeling techniques have been used for many decades. In fact, a single layer version of the basic circuit that is presented in Chapter 3 is incorporated in the ubiquitous T- circuit transformer model if the magnetizing branch is modeled as a nonlinear inductor in parallel with a resistor. Some of the earlier work such as Charap’s paper modeled both hysteresis and eddy current effects in ferromagnetic materials in a single circuit i.e. the effects due to hysteresis are not modeled separately from eddy current effects [44]. This is in stark contrast to the recent trends in magnetic material modeling. A major advantage of circuit-based models is they can be incorporated into larger models that describe complex devices seamlessly. Thus, the equations that describe the whole device can be solved together. This advantage along with others are explained in the remaining chapters to come. 1.5.5 The Jiles-Atherton Model of Hysteresis As is briefly mentioned above, there are two major classes of techniques that are used for mod- eling hysteresis: the Preisach and Jiles-Atherton methodologies. Both of these approaches are phenomenological in nature. The main features of the Jiles-Atherton approach are presented here while the next chapter covers in depth the theory behind the Preisach approach. The main results of the Jiles-Atherton model appear below. The detailed derivation of these results can be found in the original paper by Jiles and Atheron [45]. The Jiles-Atherton approach attempts to model the behaviour of the domain walls in ferromag- netic materials. Specifically, the translation and bowing (bending) of domain walls is modeled. The basic shape of the hysteresis loop is provided by an anhysteretic magnetization Man(H) curve. This curve does not exhibit hysteresis. It models the behaviour of the material that would occur if the motion of the domain walls was fully reversible. Thus, in the words of Jiles and Thoelke, “ · · · the anhysteretic magnetization represents a global minimum towards which the magnetization strives but is prevented from reaching because of impedances to domain wall motion” [46]. Typically, a modified Langevin function is used to model Man. This function is given by: Man(H) = Ms ( coth ( He γ ) − γ He ) (1.15) where Ms is the value of the magnetization at the saturation flux density, γ is a parameter that characterizes the shape of Man with units equal to He, and He is the effective magnetic intensity that is seen by every magnetic domain of the material due to the coupling between neighbouring domains. The effective magnetic intensity is defined as: He = H + αM (1.16) 21 Chapter 1. Introduction where α is the coupling factor between domains. The domain walls bow (bend) in the vicinity of the origin of the initial magnetization curve. Wall bowing is considered to be the primary mechanism for domain wall motion in this region. The bowing of the domain walls is a reversible process. However, the bulging of the wall is impeded by localized imperfections in the crystal lattice of the material [47]. The locations of these imperfections are called “pinning” sites in the literature. In the Jiles-Atherton formulation, the translation of the domain walls is assumed to be impeded by uniformly distributed pinning sites. As is described above in Section 1.4.2, the energy that is required to move the walls past imperfections in the crystal lattice is eventually dissipated as heat. Thus, the translation of the domain walls is a irreversible process. The energy that is lost due to moving the wall pass these pinning sites is expressed as a function of the irreversible change in the magnetization Mirr: Epin(Mirr) = n〈,pi〉 2m ∫ Mirr 0 dMirr = µ0k ∫ Mirr 0 dMirr (1.17) where n is the average density of pinning sites in the material, 〈,pi〉 is the average pinning energy of the sites for 180o domain walls, m is the magnetic moment of a typical domain, and k is a parameter that lumps material dependent variations together with units equal to Mirr. The constant k is sometimes known as the domain anisotropy parameter. Note that 180o domain walls rotate the magnetic moment from one side of the wall to the other by 180o. Usually these walls continue through many crystals in the material. Conversely, 90o walls are typically contained only within individual crystals [44]. Thus, the Jiles-Antherton formulation only models the movement of the 180o walls. The irreversible magnetization can be obtained from Equation 1.17. The results of this deriva- tion can be found in the oft cited paper by Jiles and Atherton [45] as: Mirr = Man − kδdMirrdHe (1.18) where δ is defined as a directional parameter that has a value of +1 if dH/dt > 0 and −1 if dH/dt < 0. Provided that k )= 0 and the denominator of Equation 1.18 is not zero, Equation 1.16 can be substituted into Equation 1.18 to yield: dMirr dH = Man −Mirr kδ − α(Man −Mirr) (1.19) where dMirr/dH is called the differential irreversible susceptibility. Equation 1.19 constitutes the first of two equations that define the Jiles-Atherton hysteresis model. 22 Chapter 1. Introduction As mentioned above, the bending of the domain walls is a reversible process. Therefore, a reversible component of the total magnetization of the material is present due to the domain walls bending. Since the bending is primarily influenced by difference between the anhysteretic magne- tization and the irreversible magnetization, the differential reversible susceptibility dMrev/dH can obtained by: dMrev dH = c ( dMan dH − dMirr dH ) (1.20) where c is a parameter that determines the amount of domain wall bending. Equation 1.20 constitutes the second equation that defines the Jiles-Atherton hysteresis model. Equations 1.19 and 1.20 can be combined to yield the total differential susceptibility dM/dH: dM dH = (1− c) Man −Mirr kδ − α(Man −Mirr) + c dMan dH (1.21) One of the main touted benefits of this model is it only requires five parameters to be deter- mined: namely, Ms, γ, α, k, and c. These parameters can be determined by a set of experimental magnetization measurements [46, 48]. There have been some reported issues with using the model as is written above. In particular, the direct solution of Equation 1.19 can lead to a negative differential susceptibility in certain circumstances. This results in a unphysical solution. One of these circumstances can occur just after the direction of H reverses at the extremity of the hysteresis loop. If in this region the irreversible magnetization is below the anhysteretic magnetization in the first quadrant of the H-B plane or above the anhysteretic magnetization in the third quadrant then a negative differential susceptibility occurs as the field is reduced. This is avoided if dMirr/dH is set to zero in these conditions. Physically, this is justified since the domain walls remain pinned on defect sites as the field is reduced. The bulging of the walls, however, is allowed to relax as the field decreases. Since the bulging of the walls is deemed to be reversible, dM/dH = dMrev/dH in these cases. Another circumstance when a negative differential susceptibility can occur is in the generation of minor hysteresis loops. The basic model can be modified without the need for additional parameters to better model the behaviour of minor loops [49]. This reformulation ensures that minor loops close since the vast majority of minor loops do actually close. The error that is produced by the model in cases in which the minor loop does not close is extremely small. Thus, the validity of this approach is quite good. The modification to the basic Jiles-Atherton model is based on the concept of a working volume. The concept of a working volume can be seen by considering the case of a small minor loop. If the H field reverses at H = H1 and then reverses again sometime later at H = H2, the change in the position of the domain walls (and the amount of rotation of the domains) is small if "H = H2−H1 23 Chapter 1. Introduction is small. Thus, the change that is necessary to return the magnetization to the original state at H = H1 does not require the entire volume of the material to be changed i.e. the change in H from H2 to H1 only acts on a small potion of the material. This potion of the material is called the working volume. It is clear that as the change in H given by "H increases, then the working volume increases as well. For the part of the magnetization that is irreversible, the fraction of the total volume that is acted on can be obtained by: vf = Mirr(H+)−Mirr(H−)∫ H+ H− Man(H)−Mirr(H) kδ − α(Man(H)−Mirr(H))dH (1.22) where H+ is the value of H of the positive extremum of the minor loop and H− is the value of H at the negative extremum of the minor loop. The new definition of dMirr/dH is now obtained by: dMirr dH = vf Man −Mirr kδ − α(Man −Mirr) (1.23) There are a few comments that can be made about Equations 1.22 and 1.23. Firstly, the value of vf is constant for a given minor loop. Secondly, the model requires the reversal points in the trajectory along with the values of vf for each set of reversal points to be stored. Finally, for the case of major loops the working volume is the entire material. As expected vf = 1 for major loops. A working volume for the reversible magnetization can be defined similar to the irreversible magnetization: v′f = Mrev(H+)−Mrev(H−)∫ H+ H− c ( dMan(H) dH − dMirr(H) dH ) dH (1.24) Likewise, the new definition of dMrev/dH is: dMrev dH = v′fc ( dMan dH − dMirr dH ) (1.25) The same comments that are given above for the use of dMirr/dH apply to the use of dMrev/dH. Equations 1.22 - 1.25 constitute the equations that define the modified Jiles-Atherton model of hysteresis. This formulation is able to successfully model the behaviour of both major and minor hysteresis loops. The modified Jiles-Atherton model could be used as the hysteresis model for this work. However, the modified Preisach model that is described in Section 2.2 is significantly easier to implement than the modified Jiles-Atherton model. This is particularly true when the relationship between H and B is represented by a constant µ and B-intercept for a predefined range of H. This 24 Chapter 1. Introduction piecewise linearization of the relationship between H and B has significant advantages in terms of computational speed and the convergence of the resulting solution. This will be become clear in light of the discussion in Chapter 5. 1.6 Outline of this Thesis This chapter gives an introduction to sensorless SRM drives. The perceived limitations in the preexisting models for SRMs provides the motivation for undertaking the work that is presented in this thesis. The basic concepts in magnetics theory that are relevant to ferromagnetic materials is then given to provide a basis for the discussions in the chapters to come. Finally, this chapter ends with an overview of the existing body of knowledge for the modeling of ferromagnetic materials. The hysteresis model that is utilized in this work is presented in Chapter 2. The hysteresis model forms the backbone of the model that is the result of this work. This chapter also includes the basic details that are necessary to implement a specific form of the class of hysteresis models that is used. This implementation uses piecewise linear elements to represent the relationship between H and B. The benefits for doing this are detailed in Chapter 5. Chapter 3 presents the basic details of circuit-based ferromagnetic models. Following this presentation is a summary of some trends in the performance of the most basic form of this type of model. These trends provide some insight into what modifications are necessary to achieve the stated objectives of this work. A new methodology for statically adjusting the parameters of the basic circuit model is included in this chapter. The dynamic model that is developed in Chapter 4 builds on this initial modification to the basic circuit model. Chapter 3 ends with a discussion on the performance of preexisting circuit-based models in order to highlight the need for this work. Chapter 4 provides the details for the two mechanisms that are the main contributions of this work. A method for obtaining the parameters of the resulting dynamic model is then given. Finally, Chapter 4 concludes with an analysis of the accuracy of the new model. This is performed with a specific metric that is based on least squares. Additionally, the results for a comparison between the new dynamic model and a static model is graphically given. Further waveforms that characterize the behaviour of the resulting model are given in Appendix B. The implementation details for the piecewise linearized version of the model that is developed in this work is given in Chapter 5. Specifically, the issues that are associated with the implementation of the two mechanisms are addressed in this chapter. The basic details of the implementation of the hysteresis model that is given in Chapter 2 is also expanded upon in this chapter. ANSI C is used to code the algorithms that are given in this chapter; the code can be found in Appendix C. Chapter 5 closes with the presentation of a feasibility study for using this model in the sensorless control of SRMs. Concluding remarks are given in Chapter 6. The specific contributions of this work are also 25 Chapter 1. Introduction listed. The modeling work that is presented in this work is only for one specific material with a set geometry. Thus, Chapter 6 also highlights the possible extensions to this work. Appendix A gives the experimental setup that generated all of the results that are shown in this work. Some of the issues that are present in the determination of the experimental waveforms are also discussed in this appendix. As mentioned above Appendix B provides additional waveforms that are generated with the model that is proposed in this work. It also presents the tabulation of the results of the numerical comparison that is given in Chapter 4. Finally, Appendix C lists the C code that was written to produce the results of the implemented model. 26 Chapter 2 Hysteresis Model Hysteresis is an integral part of any accurate model describing the behaviour of ferromagnetic materials. As was mentioned in Chapter 1, there are two major approaches to representing hys- teresis in magnetic materials: the Jiles-Atherton and Preisach models. An introduction to the Jiles-Atherton modeling approach is given in Chapter 1. The Preisach approach is detailed in this chapter. Ultimately, the Preisach approach was chosen for the hysteresis model because it is significantly easier to implement as part of a circuit-based ferromagnetic model compared to the Jiles-Atherton approach. This Chapter details the Preisach approach to hysteresis modeling and how it is incorporated into a circuit-based model. The basic details regarding the implementation of this type of approach using piecewise linear elements is also described. 2.1 The Classical Preisach Model In 1935, the German physicist F Preisach published his paper proposing a model of magnetic hysteresis [50]. The basic ideas in this seminal paper have been focus of numerous papers describing improvements or explanations in the years since its publication. Krasnoselskii further expanded the applicability Preisach’s model by representing the model in a pure mathematical form [51]. The model can, therefore, be applied to any physical phenomenon that exhibits hysteresis. Furthermore, Krasnoselskii’s mathematical representation can also be used to establish the limitations of the applicability of Preisach’s model. The classical Preisach model as represented by Krasnoselskii (called the Preisach–Krasnoselskii model in this work) is purely phenomenological in nature i.e. it does not attempt to describe the cause of hysteresis but rather it attempts to represent the effects of hysteresis. This is in contrast to the Jiles-Atherton model which, in part, tries to represent the physical nature of hysteresis. The Preisach–Krasnoselskii model is based on a weighted double integral of an infinite set of elementary hysteresis operators. Before the model can be formulated, however, the definition of the elementary hysteresis operator needs to be given. 27 Chapter 2. Hysteresis Model 2.1.1 The Hysteresis Operator γ̂αβ The Preisach-Krasnoselskii model utilizes an infinite set of elementary hysteresis operators γ̂αβ . This operators act on an input u(t). They are represented by a rectangular loop in the u − γ̂αβu plane as shown in Figure 2.1. As can be seen in Figure 2.1, the output γ̂αβu(t) can assume only two values: +1 and -1. The output changes from -1 to +1 at u(t) = α and from +1 to -1 at u(t) = β. Due to this switching action, the output depends not only on the input u(t) but also on the previous state of each operator. Therefore, the operators have their own localized memory. 1 -1 αβ u γ αβ u^ Figure 2.1: The elementary hysteresis operator γ̂αβ 2.1.2 The Preisach-Krasnoselskii Model The elementary hysteresis operators γ̂αβ are integrated using an arbitrary weight function ρ(α,β). The arbitrary weight function ρ(α,β) is a surface with unique values inside and on the triangular region that is defined in Figure 2.2 and is zero elsewhere. The weighting function is typically called the Preisach (density) function in the literature. The double integration that forms the basis of the Preisach-Kransnoselskii model is given by: y(t) = ∫∫ α!β ρ(α,β)γ̂αβu(t) dα dβ (2.1) 28 Chapter 2. Hysteresis Model The double integration is performed in the plane that is defined by the switching points β and α. The β − α plane can be split into two regions corresponding to hysteresis operators that have a value of +1 or -1. The two regions along with the interface that divides the regions is shown in Figure 2.2. α β α = S-(t) S+(t) I(t) β Figure 2.2: The β − α plane showing the geometric interpretation of Equation 2.1 S+(t) is the region of operators with a value of +1 whereas S−(t) is the region of operators with a value of -1. Notice that the shape of the interface I(t) is a staircase. Vertical lines in the staircase not including the line that connects to the α = β line are the result of u(t) following a negative going trajectory in the past. Conversely, horizontal lines not including the line that connects to the α = β line represent u(t) following positive going trajectory in the past. The line connecting the α = β line represents the current trajectory of u(t). This final link in the interface moves as the value of the input changes i.e. a horizontal final link moves upwards as the input becomes more positive and a vertical final link moves to the left as the input becomes more negative. If the final link joins the line that represents the most recent previous trajectory in the same direction as the current trajectory then the model returns to its original state before the two most recent trajectories were taken. As a result, the information pertaining to the last two reversals in the trajectory are wiped from the memory of the model. This wiping property is one of the two main features of the Preisach model of hysteresis. From Figure 2.2 and the discussion above, it follows that the output at any time depends on the shape of the interface I(t). The interface I(t) in turn depends on the reversal points of u(t) in 29 Chapter 2. Hysteresis Model the past. This illustrates the extraordinary fact that the superposition of the γ̂αβ operators with local memory results in a model that exhibits nonlocal memory. It can be seen from Figure 2.2 that Equation 2.1 can be rewritten as: y(t) = ∫∫ S+(t) ρ(α,β) dα dβ − ∫∫ S−(t) ρ(α,β) dα dβ (2.2) The two double integrations that are defined in Equation 2.2, therefore, describe the multiplica- tion of the volume under the surface that is defined by ρ(α,β) by either +1 in the S+(t) region or −1 in the S−(t) region. The addition of the two integrals becomes the output of the model y(t). The double integration probably makes Preisach’s model seem too unwieldy for practical applications. However, as will be seen, this can be avoided through the use of an explicit form of Equation 2.1. The explicit formulation greatly enhances the appeal of Preisach’s model for practical applications. Up to this point the discussion of Preisach’s model has been performed in very general terms. Equation 2.1 can potentially describe any physical phenomenon that exhibits hysteresis. In the case of magnetic systems the input u(t) is typically the magnetic intensity H, and the output y(t) is the magnetic field density B or the magnetization M . In terms of a magnetic system, Equation 2.1 can be rewritten as: B(t) = ∫∫ α!β ρ(α,β)γ̂αβH(t) dα dβ (2.3) The determination of an appropriate weighting function ρ(α,β) for magnetic materials has been the topic of vigorous research in recent years [52–54]. The final form of the weighting function depends on many things including what and how experimental data from the actual material is used. Furthermore, since the Classical Preisach model has some inherent limitations, the model has been modified in numerous ways to remove the limitations of the base model. This, in turn, requires ρ(α,β) to be redefined as is appropriate for the new model. Equation 2.3 describes a scalar system i.e. a magnetic system with no orientation. The literature also contains several papers that propose vector based Preisach models [55, 56]. The incorporation of this type of hysteresis model into the overall model presented in this work is the topic for further research. 2.1.3 Explicit Formulation of the Preisach-Krasnoselskii Model The double integration that is necessary for Equations 2.1 – 2.3 is troublesome for practical im- plementations of the Preisach model. This can be avoided if an explicit formulation such as the one that is proposed by Mayergoyz is used [57]. In his formulation, a function that is defined by experimentally determined first order reversal curves is used in the calculation of the output. This 30 Chapter 2. Hysteresis Model function is defined as: F (α,β) = (Bα −Bαβ)/2 (2.4) where Bα and Bαβ are the values of magnetic field density at H = α and H = β respectively on a first order reversal curve. A first order reversal curve is obtained by first starting from a state of either positive (+Hsat) or negative (−Hsat) saturation. The field is then either decreased or increased corresponding to starting from positive or negative saturation respectively to a value H = α. Finally, at H = α the trajectory of H is reversed to bring the material back into its original state of saturation. Since the direction of the trajectory of H is changed only once, the resulting reversal curve is deemed to be first order. Bαβ is the value of the magnetic field density at H = β along the path that returns the material to a state of either positive or negative saturation. An example of a typical first order reversal curve that starts from negative saturation is shown below in Figure 2.3. B H B β α Bα α β Figure 2.3: A typical first order reversal curve With the definition of F (α,β) in Equation 2.4, the output at any time is given by the explicit equation: B(t) = −F (α0,β1) + 2 n∑ k=1 (F (αk,βk)− F (αk,βk+1)) (2.5) where n is the number of horizontal links in the interface I(t) shown in Figure 2.2. The validity of Equation 2.5 can be seen by examining a typical sequence of reversals in the trajectory of H. The state of the model in the β − α plane along with the trajectory that the material takes in the H −B plane is shown below in Figure 2.4. 31 Chapter 2. Hysteresis Model α β S-(t) S+(t) α β S-(t) S+(t) B H B H B α 1 β α 0 β α 1 β Bα 1 Bα 0 β Bα 0 β Bα 1 β (α 1 ,β (α 1 ,β (α 0 ,β (α 1 ,β(α 1 ,β (α 0 ,β α 1 Bα 1 Bα 1 β Bα 0 β Bα 0 Bα 1 β 2 1 2 1 2 2 2 )1 ) 1 ) 2 ) 1 ) 1 ) 1 1 1 Figure 2.4: The β − α plane and the path of the material for sequence of reversals of H 32 Chapter 2. Hysteresis Model α β S-(t) S+(t) B H β α 1 β Bα 1 Bα 2 β Bα 2 β (α 0 ,β (α 1 ,β (α1,β (α 2 ,β (α 2 ,β α 2 Bα 2 Bα 1 β 3 2 3 2 1 ) 1 ) 2) 2 ) 3 ) 2 Figure 2.4 cont.: The β −α plane and the path of the material for sequence of reversals of H cont. The correspondence between the state of the model and the trajectory of its output is greatly facilitated when the value of F (α,β) is related to the β − α plane. The value of F (α,β) is equal to the double integral of ρ(α,β) in the area of the triangle T (α,β) that is defined by its vertex at (α,β) and the line β = α i.e.: F (α,β) = ∫∫ T (α,β) ρ(α,β) dα dβ (2.6) where the definition of T (α,β) is shown in Figure 2.5. Keeping the geometric interpretation of F (α,β) in mind, it follows that the explicit formula that is given in Equation 2.5 is equal to the addition and subtraction of triangular areas in the β−α plane with output values equal to F (α,β). This is demonstrated in the sequence of reversals of H that is shown in Figure 2.4. As the number of reversals increases, then so does the number of triangular areas that are required to make up the interface between the two regions S+(t) and S−(t). 33 Chapter 2. Hysteresis Model α β α = β T(α,β) (α,β) Figure 2.5: Definition of the triangular area T (α,β) 2.1.4 The Everett Function A function that appears regularly in papers that use some form of Preisach’s model is called the Everett function. The Everett function is the change of magnetization "M from a turning point H1 in the applied magnetic field intensity to some field H2. It is given by: E(H1, H2) = ∫ H2 H1 dα ∫ α H1 ρ(α,β) dβ (2.7) Note that the Everett function could also be defined for a change in magnetic field density "B. Comparing the definition of the Everett function to that of F (α,β) shows that the value of E(H1, H2) = 2F (α,β) when the Everett function is defined for changes in the magnetic field density. Additionally, if the output of the model is the magnetization M , then the definition of F (α,β) in Equation 2.4 would use magnetizations instead of magnetic field densities. In other words, the use of the magnetization as the output of the model only requires instances of B to be replaced with M and instances of "B with "M . The definition of the Everett function has lead to characterizing ρ(α,β) by arranging experimen- tal data into a two-dimensional map, the so-called Everett Map, and then double differentiating the map to obtain ρ(α,β). The numerical double differentiation, however, can lead to spurious results when it used as part of the calculation for the output B(t). Thus, this approach must be applied 34 Chapter 2. Hysteresis Model with caution. 2.1.5 Limitations of the Classical Preisach Model The classical Preisach-Krasnoselskii model exhibits the two following properties: • Wiping-out property • Congruency property The wiping out property is discussed above in reference to the movement of the final link of the interface I(t) in Figure 2.2. The congruency property states that all hysteresis loops between the same two extremum points in H are congruent. This is seen by observing that the movement of the links in I(t) between any two extremum points produces the same change in magnetization "M and magnetic field density "B. As discussed below this property poses serious limitations to the applicability of the model. It is a well known fact that the behaviour of magnetic materials depends not only on the past extremum values of the input as in the classical Preisach–Krasnoselskii Model but also on the present state of the material. Real materials, therefore, do not exhibit congruent behaviour. This poses a serious problem in the identification of model using first order reversal curves. Since the Preisach function ρ(α,β) is symmetrical [58], it follows that Everett’s function is also symmetrical i.e.: E(Hk, Hk+1) = E(−Hk+1,−Hk) (2.8) If the Preisach–Krasnoselskii model is identified using measured first order reversal curves then the observed changes in magnetization can be equated to Everett’s function as given by: E(Hk, Hk+1) = "M(Hk, Hk+1), Hk+1 > Hk (2.9) where "M is the change in magnetization along a given first order reversal curve. Due to the symmetry in Everett’s function as given in Equation 2.8, "M is required to be sym- metrical too. However, in general, this is not the case i.e. "M(Hk, Hk+1) )= "M(−Hk+1,−Hk). Not surprisingly, this is also true if the Everett function is defined for "B instead of "M . The end result is the same. This implies that if the first order reversal curves are used to identify the model then the output of the model will not predict closed minor loops. This is a serious shortcoming of the model because, to a good approximation, minor loops close in actual magnetic materials. This problem can be evaded by using other experimental data such as the limiting hysteresis curve [37, 43, 59, 60] or the initial magnetization curve [61] instead of the first order reversal loops. However, these methods cannot reproduce the first order curves. The accuracy of these methods 35 Chapter 2. Hysteresis Model is therefore limited. The next section details a modification to the classical Preisach–Krasnoeslskii model that can successfully identify Everett’s function using experimental first order reversal curves. 2.2 The Modified Preisach Model Kurt Wiesen and Stanley Charap proposed a simple modification to the Preisach–Krasnoselskii model that can successfully identify Everett’s function using experimental first order reversal curves [62]. This is not the only way to modify the classical Preisach model to successfully identify Everett’s function. Another major approach is to modify the definition of the Preisach function to include other components that cannot be modeled using the classical model such as other irreversible components or offsets. Other methods use Gaussian or Lorentzian type functions to define the Preisach function. The use of these functions or other non-linear mathematical functions are not appropriate for the type of model that was developed in this work so they were not investigated. Mayergoyz proposed several new schemes that require second order reversal curves [63–67]. Given that the variation in the properties of the material from one sample to another is likely to create a larger error in the response of the model compared to any gain in accuracy that results from using second order reversal curves, it was decided that the extra effort of using the additional data was not worthwhile. This is substantiated by the fact that the actual initial magnetization curves provided by manufacturers give only the statistical mean of the curve over a large sample of the material. The actual variance of the initial magnetization curve is quite large for low values of H. Furthermore, mechanical stress on the material will further change the microstructure of the material. This in turn modifies the magnetic behaviour of the material. For the above stated reasons it was decided to implement the model proposed by Wiesen and Charap over others. 2.2.1 The Model Formulation The model proposed by Wiesen and Charap ensures that minor hysteresis loops close. This is achieved by using a correction factor to modify "M from the experimental first order curves. If the magnetic field density is used instead of the magnetization then all instances of "M are replaced with "B. This has already been done where appropriate. The correction factor is given by: C(Hk+1, Hk) = − "M ′(Hk, Hk+1) "M(−Hk+1,−Hk) for Hk < Hk+1 − "M ′(Hk, Hk+1) "M(Hk+1, Hk) for Hk > Hk+1 (2.10) where "M ′(Hk, Hk+1) is the change in magnetization for the previous trajectory. 36 Chapter 2. Hysteresis Model Consequently, the change in magnetization for the current trajectory is given by: "M ′(Hk+1, Hk+2) = − "M ′(Hk, Hk+1) "M(−Hk+1,−Hk)"M(−Hk+1,−Hk+2) for Hk+2 < Hk+1 − "M ′(Hk, Hk+1) "M(Hk+1, Hk)"M(Hk+1, Hk+2) for Hk+2 > Hk+1 (2.11) Notice that as Hk+2 −→ Hk, "M ′(Hk+1, Hk+2) −→ −"M ′(Hk, Hk+1) and the minor loop closes. For this scheme the output B(t) now becomes: B(t) = B0 + m−1∑ k=−1 "B′(Hk+1, Hk+2) (2.12) where m is the number of reversals of the field H and B0 is the initial value of the magnetic field B at H0 = −Hsat. Note that for k = −1, "B′(H0, H1) = "B(H0, H1) since the experimental first order curves already close. Also note that Equations 2.10 - 2.12 assume that the first order reversal curves are referenced to H = +Hsat. The initial trajectory from H = +Hsat that the first order curves are attached to is itself a reversal curve for the case when H reverses at H = −Hsat. Therefore, Equation 2.12 is defined when B0 corresponds to H0 = −Hsat and the first reversal occurs when the trajectory changes from positive going to negative going. The modified Preisach model has the following symmetry properties: • "M ′(Hk, Hk+1) = −"M ′(−Hk,−Hk+1) • "M ′(Hk, Hk+1) = −"M ′(Hk+1, Hk) The first property states the experimentally observed phenomenon that the first order curves that are generated using positive saturation as the start point are the negated version of the curves that are generated from starting at negative saturation. As with the limiting hysteresis loop any loop that starts at H = ±Hp, reverses at H = ∓Hp, and finally returns to H = ±Hp, closes. Furthermore, the first order loop that is used for the returning trajectory is the negated version of the first order loop that is used for the initial trajectory. The correction factor for both trajectories is identical. Therefore, it follows that the first property must hold. The second property states that minor hysteresis loops close. As mentioned above the correction factor guarantees that this occurs. Unfortunately, the values of the magnetic field density along the initial magnetization curve are not as easily obtained for this scheme compared to some implementations of the classical Preisach model. For example, the values along the initial magnetization curve for models that just use a 37 Chapter 2. Hysteresis Model limiting hysteresis loop to identify Everett’s function are given by E(−H,H)/2. In this case, the model needs to be fed a sequence of trajectories that makes up an AC demagnetization. Once the current state of the model is H = 0 and B ≈ 0, H can be increased monotonically to obtain the initial magnetization curve. Note that it would require and infinite number of turning points obtain B = 0. 2.2.2 Model Implementation This section details the basic implementation of the modified Preisach model. Further details can be found in Chapter 5. As mentioned in Chapter 1, the model that was proposed for this work utilizes piecewise linear resistances and inductances. The rest of the model requires the hysteresis model to output a permeability µ and either a B or H intercept that are valid over a certain range of H. The first step in the implementation of the hysteresis model is to piecewise linearize the exper- imentally obtained first order reversal curves. The regions where the slope of the curves are high require more pieces to reasonably fit the data. Of course, adding more pieces will result in a more accurate model but at the expense of the computational time of the overall model. This tradeoff will become more apparent in Chapter 5 when the overall implementation issues of the proposed model are discussed. Figure 2.6 shows the first order curves that were obtained from the test material in this work. The experimental setup that was used to obtain these curves is described in Appendix A. Notice the significant deviations in the responses near the positive saturation point +Hsat. The reason behind these deviations is also described in Appendix A. The actual error in the piecewise linear curves due to these deviations is quite small since the enclosed area of the hysteresis loops in this region is small compared to the region near H = 0. The best fit piecewise linear curves for the first order reversal curves of the test material is shown in Figure 2.7. Looking at Equation 2.12 might suggest that the more reversals in the trajectory of H in the past of the material, the higher the computational time should be for the model. This is not the case. In fact, the summation in Equation 2.12 is not required if the value of the magnetic field density B at the reversal points of H is stored along with the value of H. Furthermore, if the correction factor is also stored then in the event that the current trajectory wipes out part of the history of the model, the new correction factor can be retrieved from memory instead of recalculated. With the above in mind, Equation 2.12 can be rewritten as: B(t) = B(Hn) + C(Hn, Hn−1)"B(±Hn,±H) (2.13) where Hn is the most recent reversal point in the trajectory of H. Hn−1 is the previous reversal point. The signs for the arguments of "B are chosen as in Equation 2.11. 38 Chapter 2. Hysteresis Model -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) Figure 2.6: Experimental first order reversal curves for test material The value of "B needs to be interpolated between the experimentally obtained piecewise lin- earized first order reversal curves. The pieces of each curve are defined for explicit ranges of H. The ranges are the same for every curve. Thus, only one index is required to determine the position of a given value of H with respect to the regions defined for the first order curves. The endpoints of the pieces of the descending limiting hysteresis curve are also the start points of the first order curves. However, there are fewer first order curves than endpoints. First order curves for the remaining endpoints are generated by weighting the slopes of the first order curve above and below the interpolated curve by: µm∗ = (µm∗−1 − µm+j)rm∗ + µm+j (2.14) where m∗ = m,m + 1, . . . ,m + j − 1. The slopes µm−1 and µm+j correspond to the bounding experimental first order curves. Note that the relationship between the various variables that are used to determine the interpolated curves are depicted in Figure 2.8 below. The value of rm∗ is 39 Chapter 2. Hysteresis Model -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) Figure 2.7: Piecewise linearized first order reversal curves for test material defined as: rm∗ = Bm∗(Hm∗−1)−Bm+j(Hm∗−1) Bm∗−1(Hm∗−1)−Bm+j(Hm∗−1) (2.15) Note that an upper bounding curve has an index lower than the lower bounding curve. The reason for this will become apparent later. The value of rm∗ is determined at the start point of the m∗ − 1 first order curve i.e. Hm∗−1 in Equation 2.15 is the value of the magnetic intensity at the start point of the m∗ − 1 first order curve. Bm∗ , Bm∗−1, and Bm+j are the magnetic field densities at Hm∗−1 of the interpolated, upper bounding, and lower bounding first order curves respectively. Note that for m∗ )= m the upper bounding curve is itself an interpolated curve. Thus, the interpolated curves need to be calculated in a specific order: from m∗ = m to m∗ = m+ j − 1. Since the bounding curves are linear, the value of rm∗ does not change along the interpolated curve. The value of Bm∗(Hm∗−1) requires the trajectory of the interpolated curve to be determined for 40 Chapter 2. Hysteresis Model values of H less than the start point of the m∗−1 order curve. The initial slopes of the interpolated curves between the experimental curves need to be determined first. The initial slope µ′m∗ of these interpolated curves is given by: µ′m∗ = (µ ′ m−1 − µ′m+j)r′m∗ + µ′m+j (2.16) where µ′m+j and µ′m−1 are the initial slopes of of the m + j and m − 1 experimental first order curves. The value of r′m∗ is defined as: r′m∗ = B′m∗ −B′m+j B′m−1 −B′m+j (2.17) where B′m∗ , B′m−1, and B′m+j are the values of the magnetic field density at the start points of the m∗, m− 1, and m + j first order curves respectively. Bm∗(Hm∗−1) is now obtained by: Bm∗(Hm∗−1) = B′m∗ + µ ′ m∗(Hm∗−1 −Hm∗) (2.18) where Hm∗ is the value of H at the start point of the m∗ interpolated curve. After the initial slopes of the interpolated curves are determined, Equations 2.14 and 2.15 can be used to complete the interpolated curves. m-1 m* m+j m*-1 (Hm+j , Bm+j)′ (Hm*-1, Bm+j) (Hm*-1, Bm*) (Hm*-1, Bm*-1) (Hm -1 , B )′ (Hm* , Bm*)′ µm+j′ µm*′ µm-1′ m -1 Figure 2.8: The relationship between the variables that are used to interpolate other first order reversal curves This interpolation scheme assumes that the trajectory follows the slope of the j + 1 first order curve for values of H between the start of the j + 1 and j first order reversal curves. 41 Chapter 2. Hysteresis Model With the addition of the interpolated first order curves, the path between the first order curves can be determined. As is mentioned above, only one index is required to determine the position of a given value of H with respect to the definition of the regions of the first order curves. The boundary values that define the regions can be stored in a constant array of the form Ĥ = [+Hsat, . . . ,−Hsat]. For a given value of H, the corresponding index i satisfies the constraints Ĥ(i) > η̂H ! Ĥ(i+1). η̂ is an operator that is +1 if the trajectory of H is positive going and −1 if it is negative going. Thus, as the current trajectory progresses the index i decreases. If the most recent reversal point Hn lies between the j and j + 1 first order curves then the value of r for the new trajectory is defined as: r = η̂Hn − Ĥ(i+1) Ĥ(i)− Ĥ(i+1) (2.19) where i satisfies Ĥ(i) > η̂Hn ! Ĥ(i+1). The direction of the trajectory is defined as the direction of the new trajectory. Note that the use of H in the determination of r is the equivalent of using B since µ is constant between Ĥ(i) and Ĥ(i+1). The correction factor C(Hn, Hn−1) as given in Equation 2.10 can be rewritten as: C(Hn, Hn−1) = |B(Hn)−B(Hn−1)| |"Bj,j+1(Hn, Hn−1)| (2.20) where the magnitude of the change in the magnetic field density "B using the weighted first order curves j and j + 1 from H = Hn to H = Hn−1 is: |"Bj,j+1(Hn, Hn−1)| = µj+1(i+1)(Ĥ(i)− η̂Hn) + {"Bj(Hn−1)−"Bj+1(Hn−1)}r +"Bj+1(Hn−1) (2.21) where "Bj(Hn−1) and "Bj+1(Hn−1) are defined as: "Bj(Hn−1) = i−1∑ l=im i$=im { µj(l+1)(Ĥ(l)− Ĥ(l+1)) }− µj(im+1)(Ĥ(im)− η̂Hn−1) (2.22) "Bj+1(Hn−1) = i−1∑ l=im i$=im { µj+1(l+1)(Ĥ(l)− Ĥ(l+1)) }− µj+1(im+1)(Ĥ(im)− η̂Hn−1) (2.23) 42 Chapter 2. Hysteresis Model where im satisfies the constraints Ĥ(im) > η̂Hn−1 ! Ĥ(im+1). The summations in Equations 2.22 and 2.23 can be done offline and stored in a lookup table. Using the definitions in Equations 2.19 - 2.23, the current slope of the model can be written as: µ(H,Hn, Hn−1) = C(Hn, Hn−1) { (µj(i+1)− µj+1(i+1))r + µj+1(i+1) } (2.24) where H is the current value of the magnetic intensity and i satisfies the constraints Ĥ(i) > η̂H ! Ĥ(i+1). Notice that the index of µj and µj+1 is equal to i + 1. This is because the value of µ for index i + 1 is defined for H = Ĥ(i+1) to H = Ĥ(i). As previously mentioned, C(Hn, Hn−1) and r only need to be calculated when the trajectory of H changes direction. A graphical representation of the variables in the above equations is shown in Figure 2.9 below. B(Hn) B(Hn-1) (Hn ,B(Hn)) (Hn-1, )B(Hn-1) Bj µj+1(i+1) µj+1(im+1) µj (im+1) H(im+1) H(i) H(i-1) Bj+1 Figure 2.9: The relationship between the variables that are defined in Equations 2.19 – 2.24 The intercept of the B-axis called the B pivot point Bpv here is given by: Bpv(H,Hn, Hn−1) = B∗(H∗)− µ(H,Hn, Hn−1)H∗ (2.25) where the value of H∗ depends on the state of the model. If the trajectory of H just reversed then the value of H∗ is equal to the reversal point Hn otherwise the value of H∗ is equal to Ĥ(i+1). The value of B∗(H∗) is calculated based on the current values of µ, Bpv and H∗ i.e. B∗(H∗) = µoH∗ + B′pv (2.26) 43 Chapter 2. Hysteresis Model Thus, Bpv can be obtained by: Bpv(H,Hn, Hn−1) = B′pv + { µo − µ(H,Hn, Hn−1) } H∗ (2.27) where B′pv and µo are the previous values of Bpv and µ respectively. Finally, the output of the model is given by: B(t) = µ(H,Hn, Hn−1)H(t) + Bpv(H,Hn, Hn−1) (2.28) The equations describing the model here are based on the assumption that the first order curves are arranged in a specific order. The order was chosen to facilitate the implementation of the model. Specifically, the order was chosen to minimize the number of required calculations when the trajectory of H reverses. The slopes of the first order curves are arranged in a two dimensional lookup table. The data structure for the slopes is given in Table 2.1. Table 2.1: Data structure for µ +750 +600 · · · i+1 · · · −750 −1000 +750 µ1(1) µ2(2) +600 µ2(1) µ2(2) µ3(3) ... ... ... ... . . . j+1 ... ... ... µj+1(i+1) . . . ... ... ... ... ... . . . . . . −750 µ29(1) µ29(2) · · · · · · · · · µ29(29) µ30(30) −1000 µ30(1) µ30(2) · · · · · · · · · µ30(29) µ30(30) Table 2.1 illustrates several features of the data structure of µ that benefit the implementation of the model. For example, notice that the last entry in every row except for the last row is the start point of the first order curve below. This allows the use of Equation 2.24 with no exceptions. Even more beneficial is the justification of the data. As the current trajectory progresses, i decreases while j remains the same. When the trajectory of H reverses, the required value of im in Equations 2.22 and 2.23 is equal to 30− j. Furthermore, the value of 30− i before the trajectory reverses is 44 Chapter 2. Hysteresis Model the new value of j. Note that the number 30 is equal to the length of the array Ĥ − 1 that is used in this work. Finally, as expected, the starting value of i is equal to the new value of j. As mentioned above, the summations in Equations 2.22 and 2.23 can be performed offline and stored in a look-up table. The data structure for the precalculated differences in B is given in Table 2.2. Table 2.2: Data structure for "Mj +1000 +750 · · · im · · · −750 −1000 +1000 0 +750 "B2(1) 0 ... ... ... . . . j ... ... ... ∑ µj"Ĥ ... ... ... ... ... . . . −750 "B30(1) "B30(2) · · · · · · · · · 0 −1000 "B31(1) "B31(2) · · · · · · · · · "B31(30) 0 To use Table 2.2 as shown a slight modification needs to be made to Equation 2.23. The summation is performed to i not i − 1 as given in Equation 2.23 i.e. the summation is performed from the start of the first order curves. While this is not a problem for Equation 2.22 since the summation starts from its start point anyway, this does pose a problem for Equation 2.23. The correct value of the summation for Equation 2.23 requires the rightmost nonzero value of the data of row j+1 to be subtracted from the column corresponding to im. When the trajectory of H changes direction five pieces of information are stored in memory. The variables that are stored in memory are: 1. Hn 2. j 3. C(Hn, Hn−1) 4. r 45 Chapter 2. Hysteresis Model 5. B(Hn) If at any time the current value of |H| becomes larger than |Hn−1| then the current trajectory has closed a minor loop. In this case the history of the minor loop has been wiped from the memory of the model. This is implemented by decrementing a pointer that points to the top of the stack of reversal data by two increments of Hn. This assumes that the reversal data is stored in blocks such that the pointer always points to the first variable, namely Hn. The new values of r, j, etc. on the top of the stack are now used in Equation 2.24. The old value of Hn−1 is used for H∗ in Equation 2.27. The value of Hn one increment of Hn below the top of the stack becomes the new value for Hn−1. Finally, it is important to remember that data structure of µ as shown in Table 2.1 insures that the value of i only needs to be modified when the relationship Ĥ(i) > η̂H ! Ĥ(i+1) does not hold or when the trajectory of H changes direction. 2.3 Chapter Summary This chapter presents the Preisach approach to modeling hysteresis. The Preisach model is defined by the double integral of an infinite set of elementary hysteresis operators that are weighted by an arbitrary weight function. The double integration, however, can be avoided with the use of an explicit formula that relies on the first order reversal curves of the material. Unfortunately, the Classical Preisach model has some features that limit its applicability. In particular, the model is based on the assumption that all of the trajectories between the same set of extremum values in the input are congruent. In actual magnetic materials this is rarely the case. As a result, the identification of the model with first order reversal curves is not consistent. There are many approaches that have been given in the literature that address this issue. A modified Preisach model that uses a correction factor to guarantee the closure of minor loops was chosen for this work. This technique, therefore, allows for the consistent identification of the model from experimental first order reversal data. One of the primary advantages of this approach over others is it still only requires the first order reversal curves of the material. This is in contrast to many other techniques that require second order reversal curves or other details. The chapter closes with the basic details of the implementation of the modified Preisach model. The implementation relates the H and B fields as a slope and intercept that is valid over a set range of values of H. This piecewise linearization has specific advantages that can be used in the implementation of the overall model that is presented in this work. These advantages along with the details that are specific to the implementation of the algorithm in the overall model of this work are given in Chapter 5. Unless otherwise stated the following chapters use this model to represent the effects of hysteresis for any results that are presented. 46 Chapter 3 Existing Circuit-Based Ferromagnetic Models The performance of existing circuit-based ferromagnetic models are shown within this chapter to highlight some of their deficiencies and to justify the need for some improvements. The deficiencies of these models are specifically their inability to perform well over large ranges in frequency and input excitation magnitude. This chapter also gives the basic structures and ideas that are used by the newly developed mechanisms that are presented in the following chapter. The discussion starts with a description of circuit-based modeling in general. Some trends in the performance of the basic circuit are then given along with some typical output responses. This is followed by a method for methodically modifying the values of the circuit resistances. Finally, the methodology and results from two existing mechanisms is presented to show some of the difficulties with the currently available models. 3.1 Circuit Based Modeling: A Preamble Circuit based models are based on the theory behind four of the most recognized equations of electromagnetism: namely, Maxwell’s equations. This basis will be shown here. Maxwell’s equations are: ∇ ·E = 1 ,0 ρ (3.1) ∇ ·B = 0 (3.2) ∇×E = −∂B ∂t (3.3) ∇×B = µ0J + µ0,0∂E ∂t (3.4) where ρ in Equation 3.1 is the total charge density not the Preisach density function used in Chapter 2. The SI unit for ρ is C/m3. The field E is called the electric field whereas J is the 47 Chapter 3. Existing Circuit-Based Ferromagnetic Models current density. The SI units for E and J are V/m and A/m2 respectively. The constants ,0 and µ0 are the permittivity of free space and permeability of free space respectively. The value of ,0 is equal to 1/c2µ0 ≈ 8.854× 10−12 F/m where c is the speed of light (≈ 3× 108 m/s). In matter, Maxwell’s equations are usually rewritten in terms of free charges and currents. This affects Equations 3.1 and 3.4 as given by: ∇ ·D = ρf (3.5) ∇×H = Jf + ∂D∂t (3.6) where Jf and ρf are the free current and charge densities respectively. The field D is called the electrical displacement. The SI unit for D is C/m2. The second term in Equation 3.6 can be neglected because the frequencies of interest in this work are comparatively very low i.e. the displacement current is so small in the operating frequencies that are considered here that it can be ignored. The free current and charge densities represent the external currents and charges that we can directly control. In contrast, bound currents with density Jb involve the spin and orbital motion of electrons in the material that we have no direct control over. The bound currents are, therefore, associated with the magnetization of the material. There is also a third component of the current density called the polarization current (Jp). It is the result of the linear motion of charge when the electrical polarization changes. Associated with the polarization current is the polarization charge density (ρ b). This is, in fact, the bound charge density in the material thus the subscript b. The total current density is J = Jf + Jb + Jp whereas the total charge density is ρ = ρf + ρ b. Of particular interest to circuit based models are Equations 3.3 and 3.6. The usefulness of these equations is more apparent when they are written in their integral form: ∮ L E · dl = − d dt ∫∫ S B · da (3.7) ∮ L H · dl = Ifenc (3.8) for any surface S bounded by the closed loop L where Ifenc is the enclosed free current. Equation 3.8 is the well known Ampère’s law. Circuit based models are lumped parameter models. As such, the models assume that for a specified volume of magnetic material, the magnetic fields are invariant in space. Therefore, for a given volume of material, Equation 3.8 can be rewritten 48 Chapter 3. Existing Circuit-Based Ferromagnetic Models as: Hl = Ni = F (3.9) where l is the magnetic path length, N is the number of turns of an externally connected coil carrying a current i that are enclosed by the path l, and F is called the magnetomotive force (mmf). The SI units for F is A. Sometimes the unit for mmf is written as A-t (ampere-turn). The well known magnetic circuits equivalent of Ohm’s law equates F to the flux and reluctance of a path in the material by: F = φR (3.10) where φ is the flux through an area A of the material and R is the non-linear reluctance of the path. The SI units for the flux and reluctance are Wb and A/Wb respectively. The direction of the flux is perpendicular to the area A. There is an inherent danger with the magnetic equivalent of Ohm’s law. The danger is it is easy to forget that flux does not exist. Thus, flux does not actually flow in the material. This is where the analogy to electric circuits breaks down because in an electric circuit current does actually flow. However, even with this physical inaccuracy, the magnetic equivalent circuit is still a very useful tool in analyzing magnetic systems. Physically, the flux is a measure of the number of magnetic field lines in a given area. If the magnetic field density B is assumed to be invariant in space over an area A then the flux is given by: φ = BA (3.11) where the field B is perpendicular to A. Equation 3.11 can be substituted into Equation 3.7 to obtain:∮ L E · dl = −dΦ dt (3.12) This is just Faraday’s law in its integral form. Note that φ has been replaced with Φ to indicate that the flux is formally a vector. The right-hand side of Equation 3.12 is equal to the electromotive force (emf) or the voltage as it is more commonly known in circuit theory. Using Ohm’s law to replace the emf yields: ∮ L E · dl = E = −dφ dt 49 Chapter 3. Existing Circuit-Based Ferromagnetic Models iR = −dφ dt (3.13) where R is the resistance of the closed path bounding the flux φ. The negative sign in front of the derivative of the flux indicates that the generated voltage is setup to oppose the change of flux. Thus, the current that flows in the material along a closed path tends to shield the material enclosed within the path from the externally applied mmf in order to limit the rate of change of the flux. The closer a piece of the material is to the center of the material, the more that piece is shielded from the external source. With the relationships given in Equations 3.10 - 3.13 the following circuit can be proposed. 3.1.1 Basic Circuit The circuit shown in Figure 3.1 represents the ubiquitous basic circuit that models, in part, the effect of the currents given in Equation 3.13. As is mentioned in Chapter 1, these currents are called eddy currents. However, the circuit is most often shown in its electrical equivalent form. Before the electric equivalent circuit is shown, a few comments on the magnetic equivalent circuit will be given. F R 2 R 1 R n φ n φ 1 φ 2 φ n-1 1 R 1 dφ1 dt 1 R 2 dφ2 dt 1 R n dφn dt Figure 3.1: Basic circuit that exhibits eddy current effects Notice that the basic circuit tries to mimic the shielding effect of the eddy currents given in Equation 3.13. The mmf drop across the inductors reduces the effect of the externally applied 50 Chapter 3. Existing Circuit-Based Ferromagnetic Models field on the elements below the inductor – “below” in this case refers to elements that are closer to the center of the material. Each pair of reluctance and inductance, e.g. R1 and the inductor involving R1, are on the same layer in the material. This layer represents a tube of flux in which the magnetic fields H and B are spatially invariant i.e. the fields are uniform in space within a given tube. An example of a magnetic material with a circular cross-section that has been split into three flux tubes is shown in Figure 3.2. H φ 1φ 2 φ 1φ 3 φ 2 1 R 3 dφ3 dt 1 R 2 dφ2 dt 1 R 1 dφ1 dt Figure 3.2: Three tube model with its magnetic equivalent circuit parameters defined The electrical equivalent circuit of the circuit shown in Figure 3.1 is found more often in the literature. This is likely because it is usually part of a larger electrical circuit describing devices such as power transformers. Using the duality between electrical and magnetic circuits [34], it can be shown that the magnetic circuit given in Figure 3.1 is equivalent to the electrical circuit given in Figure 3.3 below. Note that L1, L2, . . . , Ln in Figure 3.3 are equal to N2/Rn. The resistances are the same as those in Figure 3.1 since the turns ratio for the resistances is effectively one i.e. the currents generated in the material are modeled as coils with one turn. Magnetic equivalent circuits are used throughout this work because they give a more intuitive connection between the actual physical material and the circuits that try to model the response of the material to certain input conditions. The duality between the equivalent circuits allows any of the circuit-based models shown in this work to be implemented with either equivalent. The choice of which equivalent to use depends on the particular application e.g. as mentioned, power transformers are usually modeled using electrical circuits whereas a lumped parameter model for a sensorless switched reluctance application typically uses a magnetic equivalent circuit. The basic circuit actually represents a discretized version of the classical eddy current model. It is discretized in the sense that the values of the fields within the material do not vary continuously but have certain discrete values that change in steps between tubes. At a glance you would think that as more layers are added to the model, the model’s response should better approximate the 51 Chapter 3. Existing Circuit-Based Ferromagnetic Models V L n L 2 L 1 R 1 R2 Rn i n i 2 i 1 Figure 3.3: Electrical equivalent circuit of the basic eddy current model behaviour of the actual material. While this is in general true, the response of the basic circuit becomes worse as tubes are added if the parameters of the model are not adjusted properly i.e. the response of this type of model does improve as the number of tubes increases but the basic circuit with no modifications eventually performs worse as the number of tubes increases. The reasons for this will be given later in this chapter. The basic circuit as either a magnetic or electrical equivalent circuit mimics the behaviour of a magnetic material that exhibits eddy currents that flow in the classical sense. It was discovered in the 1940’s that the classical eddy current model could not account for all of the losses in fer- romagnetic materials. These excess losses as they are called are due to the fact that the actual material is composed of many magnetic domains. As the domain walls move, local fluctuations in B are created by the shifting of the walls. As a result, additional localized eddy currents are induced to inhibit the movement of the domain walls. A domain model was proposed to account for the discrepancy in the behaviour of the actual material and the classical eddy current models. A graphical representation of the difference between the classical and domain model is shown in 52 Chapter 3. Existing Circuit-Based Ferromagnetic Models H (a) classical model H M M M (b) domain model Figure 3.4: Classical and domain eddy current models Figure 3.4. Note that the domain model as shown in Figure 3.4(b) is rotated by 90o compared to the classical model that is shown in Figure 3.4(a). It also only represents a small portion of the material i.e. the width of the material is significantly smaller than its height as is shown in the depiction of the classical model. The illustration of the domain model in Figure 3.4(b) is an oversimplification of the actual domain structure since, in general, the orientation of the domains is in three dimensions. However, if the dominant external H field is along one axis of the material then the domains will tend to become 1–dimensional since the torque on the magnetic dipoles due to B align the dipoles parallel to the field. Given that the basic circuit model exhibits the general behaviour of the classical eddy current model as shown in Figure 3.4(a), it is not surprising that the basic circuit model has limitations to its accuracy. The classical model breaks down when the number of domains in the material is large. As will be seen later in this chapter, this error is significant when the material is not allowed to saturate. 53 Chapter 3. Existing Circuit-Based Ferromagnetic Models 3.1.2 Tube Structure Most circuit based models make the assumption that, for laminations with rectangular cross- sections, the height of the lamination h is significantly larger than its width w. In these cases, the lamination is typically split into plates with widths that have even symmetry about the major axis. Plates that are equal distance from the center of the material form the tube for that layer. While this assumption is valid for the majority of cases, it fails for devices that have square or circular cross-sections such as solenoids. The tube structure that is used in this work is shown in Figure 3.5. Notice that no assumption is made about the dimensions in this definition. Further- more, this structure models the path of classical eddy currents more closely since these currents tend to curve around the ends of the lamination instead of abruptly change direction. The half-widths w1 and w2 are chosen so that the area in each tube is identical. Note that the area of the outermost tube includes the corners of the lamination outside the curved dashed lines. However, the path of the eddy currents in this tube is restricted to the path between the outer wall of the next lower tube and the curved dashed lines. Therefore, the calculated reluctance of the outermost tube includes the corners whereas the calculated resistance does not. The resistance of the kth tube not including the innermost tube is: Rk = 2(h− w) σl(wk − wk−1) + 2pi σl { 1 / ln ( wk wk−1 )} , k > 1 (3.14) where l is the length of the magnetic path in the lamination and σ is the conductivity of the material. In Figure 3.5 this is perpendicular to the plane of the page. For the innermost tube, the resistance is given by: R1 = 2(h− w) σlw1 + 2pi σl (3.15) The reluctance of the tubes depends on the current permeability of the tubes. As shown in Chapter 2, the permeability is dependent on the previous history of the material. The reluctance of the tubes is: Rk(µk) = l µkA (3.16) where the area A of every tube is equal to wh/n and n is the total number of tubes. The restriction on the areas of the tubes does not reduce the applicability of this tube structure. Rather it allows the implementation of the model to be simplified. In cases where the equal area criterion is too restrictive then the areas can be allowed to vary without changing the main features of the structure. 54 Chapter 3. Existing Circuit-Based Ferromagnetic Models w h w 1 w 2 Figure 3.5: Tube Structure 3.2 Performance Trends in the Existing Circuits The trends in the performance of the basic circuit given above and other major existing circuit based models are given in this section. These trends are important because they give the range of validity of the different models. The performance trends of the basic circuit are the most useful since all of the circuit based models presented here including the proposed circuit of this work are derivatives of the base circuit. The sample material was tested using the same apparatus that was used to generate the first order reversal curves for the hysteresis model. The test setup is given in Appendix A. The test material was excited using sinusoidal current waveforms. As a result, H is sinusoidal not B. Most of the existing circuits are tested using sinusoidal B waveforms. Using sinusoidally impressed H waveforms over sinusoidal B waveforms was chosen more for experimental convenience than any other factor. As previously mentioned, the aim of this work is to develop a model that can approximate the behaviour of a given material of a given geometry over a large range of input frequencies and 55 Chapter 3. Existing Circuit-Based Ferromagnetic Models excitation magnitudes. Since the response of the material is extremely nonlinear, it is important that the enough data is collected in order to sufficiently characterize its behaviour. The test material and its geometry as given in Chapter 1 was used to produce all of the experimental results in this chapter. The modified hysteresis model as described in Chapter 2 is used for all of the circuit models described here except where noted otherwise. 3.2.1 Basic Circuit Performance with Fixed Rk The response of the basic circuit with three and five tubes is used as a baseline of comparison between the various circuits in this chapter. Initially, the values of Rk are the calculated DC resistances of the tubes as given by Equations 3.14 and 3.15. The effect of changing the values of Rk on the circuit performance is then explored as this type of modification is the simplest to perform. This initial change is not dynamic i.e. the values of Rk are changed but then remain fixed during the run-time of the model. Consider the response of the base circuit with the calculated DC values of Rk for various frequencies that is shown in Figures 3.6–3.8. -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data three tube model five tube model Figure 3.6: 60 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels 56 Chapter 3. Existing Circuit-Based Ferromagnetic Models -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data three tube model five tube model Figure 3.7: 250 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels Notice that the response of the basic model with five tubes is actually worse than the response with three tubes. As will be formalized next, increasing the number of tubes requires the values of Rk to be modified. The value of the magnetic field density B̄ represents the average value of B in the material. It is obtained by integrating the voltage on the sense winding and dividing the resulting flux by the cross-sectional area of the test sample. As can be seen in Figures 3.6 - 3.8 the effect of the eddy currents is significant. In fact, notice that the peak values of B̄ do not correspond to the peak values of H for many of the cases. This behaviour is the result of the effective H inside the material becoming phase shifted compared to the excitation H. Thus, the peak of H inside the material becomes delayed compared to the input H. At the same time, the peak magnitude of H in the material becomes smaller as the field passes through the material. The combined effects of the delay and damping cause H to become increasingly non-sinusoidal as the field penetrates deeper into the material. Although the shape of the response of the model is generally accurate, the damping provided by the basic circuit is insufficient. For example, the width of the resulting 60 Hz curves for Hpeak = 500 and 1000 is too small, whereas for Hpeak = 125 the peak values of B̄ are too large. In both cases, 57 Chapter 3. Existing Circuit-Based Ferromagnetic Models -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data three tube model five tube model Figure 3.8: 500 Hz curves comparing the basic circuit with 3 and 5 tubes for three excitation levels this is the result of insufficient damping. The logical first step to rectify this problem is to decrease the values of Rk in the circuit. The reduction in Rk that is required for a given k is not necessarily the same as the reduction for different values of k. The modification to the values of Rk does improve the performance of the circuit to a point. As the values of Rk are decreased the 60 Hz curves for Hpeak = 500 and 1000 become wider and the peak values of B̄ decrease for Hpeak = 125 but eventually the damping for the higher frequency curves becomes too much while the damping for the 60 Hz curves is still insufficient. Furthermore, the reduction in Rk that is required for Hpeak = 125 is 2-3 times more than that of Hpeak = 500 and 1000. Clearly, the values of Rk need to be modified as the states of the model change. 3.2.2 Static Modification to Rk Looking at Figures 3.6 - 3.8 shows the performance of the basic circuit for five tubes being distinctly worse than the performance with three tubes. This seems to be counter-intuitive. In fact, the response of the basic circuit with the initially calculated values of Rk is misleading. Actually, as 58 Chapter 3. Existing Circuit-Based Ferromagnetic Models the number of tubes increases, the values of Rk need to be reduced. This is not surprising since the time constants, τ , of the model decrease significantly as n increases. The time constants are given by: τ = L R = 1 RR (3.17) As n increases the cross-sections of the eddy current paths decrease causing R to increase. Additionally, the reluctances of the tubes also increase. The increase of both R and R really reduces the time constants of the model. This description lacks detail because R varies significantly in time; thus, the use of linear circuit theory is limited in characterizing the behavior of the model. Unfortunately, there is a limit to the effectiveness of reducing the values of Rk as was described above. The model can be tuned by modifying the values of Rk for narrow ranges of frequency to yield very accurate results for cases with saturation. However, large deviations from the tuned range in frequency significantly degrade the performance of the model. Using this scheme alone is not enough for a model that is expected to operate over a large frequency. It is still, however, a vital part of the overall model proposed here. Note that the following analysis and commentary has not explicitly appeared in the literature before this work was undertaken. The first step in the procedure for systematically changing the values of Rk is to rewrite Equa- tions 3.14 - 3.15 in terms of the number of tubes: Rk(n) = 2pi σl h− w√(h− w)2 + pikwhupslopen−√(h− w)2 + pi(k − 1)whupslopen + 1 / ln −(h− w) + √ (h− w)2 + pikwupslopen −(h− w) + √ (h− w)2 + pi(k − 1)whupslopen (3.18) The equation for Rk(n) is valid for 2 " k " n− 1. For the innermost and outermost tubes the resistance is: R1(n) = 2pi σl 1 + h− w−(h− w) +√(h− w)2 + piwhupslopen (3.19) Rn(n) = 2pi σl h− wpiwupslope2 + (h− w)−√(h− w)2 + pi(n− 1)whupslopen + 1 / ln piwupslope2 −(h− w) + √ (h− w)2 + pi(n− 1)whupslopen (3.20) 59 Chapter 3. Existing Circuit-Based Ferromagnetic Models where the equation for Rn(n) is valid for n > 1. The variation of the resistance with n is a strong function of the geometry of the material to be modeled. However, the variation of the reluctance with n is linear due to the restriction on the area of the tubes i.e. if the number of tubes is increased by one, then the reluctance increases by l/wh. Furthermore, keeping the area of the tubes the same has the advantage that the change in the reluctance due to a change in µk affects every tube equally. In general, this reduces the effort required to modify the values of Rk. Looking at Equation 3.20 reveals a potential limitation to the number of tubes. If n is greater than 4hw(4−pi) then the resistance becomes negative. In particular, as h→ w the maximum number of tubes becomes increasingly limited. In these cases the areas of the tubes can no longer remain equal. For the geometry utilized in this work, the number of tubes is limited to 35. This limitation is not an issue for this case. The DC resistance of the tubes for n = 3, 4, 5, 8, and 10 is shown in Figure 3.9 for reference below. There are some features of Figure 3.9 that are important to highlight. Firstly, observe that the resistance of the outermost tube increases dramatically as n increases. This is not surprising since the outer edge of the outermost tube is fixed. As n increases the inner edge of the outermost tube approaches the outer edge of the tube until the limit described above is reached. After this point, the inner edge is actually outside the outer edge. Secondly, and more importantly, notice that the resistance increases as k increases. This is primarily the result of the width of the tubes decreasing as k → n. As is repeatedly pointed out in the literature, the effective H field in the material falls off rapidly in the presence of significant eddy currents. To capture the rapid change in the effective H and, therefore in B, the tube widths need to become narrower as k → n. This is the reported motivation for decreasing the widths of the tubes as k increases in the tube structure that assumes h. w. Recall in that tube structure the tubes are plates with even symmetry about the major axis. In the tube structure for this work, keeping the area of the tubes the same automatically ensures that this is the case. However, as h becomes large compared to w then the tube structure presented in this work approaches the tube structure that assumes h. w. Inevitably, this requires the areas to be modified in the same way as described above. A similar modification is also required in cases in which keeping the areas of the tubes the same overly restricts the maximum number of tubes. The procedure for tuning the values of Rk assumes that the widths of the tubes are chosen appropriately. Thus, the initial selection of the tube structure and tube widths can be considered as the first step in this procedure. Since the above mentioned variation in the widths of the tubes is the most desirable, this procedure was not tested for cases in which the tubes are arranged in a different way. The values of Rk are initially modified by tuning the response of the circuit at one frequency for a single peak value of H. In this case, the 60 Hz curve for Hpeak = 500 was chosen. Consider the 60 Chapter 3. Existing Circuit-Based Ferromagnetic Models 1 2 3 4 5 6 7 8 9 10 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Tube number (k) Re sis ta nc e (o hm s) Figure 3.9: Variation of tube DC resistances with n trajectory from H = −500 to H = +500. The initial part of the trajectory is matched by weighting the resistances of the outermost tubes. The middle part of the trajectory is matched by weighting the resistances of the middle tubes. Finally, the last part of the trajectory is matched by weighting the resistances of the innermost tubes. Formally the weights ζ1, ζ2, . . . , ζn can be determined by minimizing the vertical distance between the experimental curve and the curve generated by the model in the least squares sense i.e. minimize the objective function R2 given by: R2 = min (∑ i [ B̄i − B̄∗i (Hi, ζ1, ζ2, . . . , ζn) ]2) (3.21) where B̄i are the sample points in the trajectory of the response of the actual material and B̄∗i are points in the trajectory generated by the model. The minimization has to be performed iteratively since the model is highly nonlinear. This procedure can be repeated for higher frequencies. However, the response of the model is dominated by the values of the resistance in the outermost tubes. In general, only the resistances 61 Chapter 3. Existing Circuit-Based Ferromagnetic Models 1 2 3 4 5 6 7 8 9 10 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Tube number (k) Re sis ta nc e (o hm s) original modified Figure 3.10: Modification to Rk for n = 4 and 10 of the outermost tubes need to be varied as the frequency varies. Furthermore, the outermost resistances need to be varied as the peak magnitude of the input excitation varies. Typical results of this procedure for n = 4 and 10 are shown in Figure 3.10. This method essentially shapes the response of the model for the H field inside the material. As expected, as the number of tubes increases, the accuracy of the circuit improves since the H field inside the material is better approximated. This is particularly true for higher frequencies i.e. the accuracy of the n = 4 circuit is the about the same as the n = 10 circuit for 60 Hz inputs, but at 1 kHz the accuracy of the n = 4 circuit is starting to deteriorate whereas the accuracy of n = 10 circuit remains unchanged. The main advantage of this approach is it is systematic. It also emphasizes the need for varying the resistances of the circuit as the input changes. If the use of the basic circuit was to model the behaviour of a device for a narrow range of frequencies and variation in the magnitude of H then this modification by itself would be sufficient. This approach provides a static change to the values of Rk. Two of the more promising currently available modifications that provide dynamic changes to the values of the circuit resistances of the 62 Chapter 3. Existing Circuit-Based Ferromagnetic Models basic circuit are presented next. 3.2.3 Variation of Rk Based on the Variation of J Zhu et al. noted that even though B is assumed to be uniform in every tube, the electric field E is not [43]. Equation 3.11 is a bit misleading because it gives the total flux perpendicular to a given surface S. In the case of the tubes of the basic circuit, the surface is the area of each tube. Actually, in a tube of flux, the total enclosed flux varies as: φ(w) = l ∫ w w0 B(w) dw = lB(w − w0) if B(w) = B (3.22) As w − w0 approaches the width of the tube, φ(w) approaches φ in Equation 3.11. Since the derivative of φ in Equation 3.12 is defined for the flux enclosed within the bounding path L it follows that E and, therefore, E varies within the tube. As a result, the current density J varies along the width of the tube. The basic circuit uses the total enclosed flux to calculate a value of E . It is assumed that this E is constant across the width of the tube. Thus, the resistances calculated in Equations 3.14 and 3.15 can be used directly. A correction factor was proposed by Zhu et al. to account for the variation of J across the width of the tube [43]. The derivation of the correction factor will be partially repeated below. First, note that: J = σE (3.23) Assume that B = −Bk̂ where k̂ is a unit vector along the z-axis. The direction of J is normal to k̂ and parallel to the sides of the tubes. Call this unit vector p̂. Therefore, the current density J can be written as J p̂. Note that in the end pieces of the tubes, p̂ will follow a circular path. Hence, from Equation 3.3: dJ dw = σ ( dBz dt ) k (3.24) where the direction of w is perpendicular to p̂ and goes from the inside to the outside wall of the tube. Call this unit vector n̂. Bz is the value of B in the kth tube as denoted by the subscript k. The preceding definitions of the unit vectors are shown in Figure 3.11. Integrating 3.24 along the width of the tube yields: Jk = σ ( dBz dt ) k (wk − wk−1) + Jk−1 (3.25) where Jk and Jk−1 are the current densities at w = wk and w = wk−1 respectively. 63 Chapter 3. Existing Circuit-Based Ferromagnetic Models k n̂ ˆ p̂ k n̂ ˆ p̂ Figure 3.11: Definition of unit vectors for Equations 3.23 - 3.25 The variation of J along the width of the tube as given in Equation 3.25 is identical to what is reported in [43] except that the direction of J is simply along the y-axis in that case because the tubes are defined as plates. The power per unit volume for classical eddy current losses is given by: Peddy = 1 σ J2 (3.26) Equation 3.26 is integrated over the straight sections of the tube with the use of Equations 3.24 and 3.25 to obtain the relationship: Peddy = ( 2(h− w)l(wk − wk−1) σ ) J2k rJk (3.27) where: rJk = 1 3 [ 1 + ( 1 + Jk−1 Jk ) Jk−1 Jk ] (3.28) A similar derivation can be made with the curved sections of the tube except that in this case the path length is not constant but instead depends on the radius of the path. For the curved 64 Chapter 3. Existing Circuit-Based Ferromagnetic Models sections Peddy is: Peddy = pil(wk − wk−1)2 2σ J2kRJkθ (3.29) where: RJkθ = 1− J4k−1 J4k( 1− Jk−1Jk )2 (3.30) Noting that the voltage induced along the straight sections of the tubes at w = wk is given by 2(h−w) σ Jk and R = E 2 kupslopePeddy, the effective resistance of the straight sections is: R′k = 2(h− w) σl(wk − wk−1)rJk (3.31) where 2(h−w)σl(wk−wk−1) is just the DC resistance of the straight sections of the kth tube. Similarly, the effective resistance of the curved sections of the tube is given by: R′k = 8pi σl ( 1− wk−1wk )2 RJkθ = 2pi σl { 1 / ln ( wk wk−1 )} 4 ln ( wk wk−1 ) ( 1− wk−1wk )2 RJkθ = RDCθk RθkRJkθ (3.32) where: Rθk = 1 4 ( 1− wk−1 wk )2/ ln ( wk wk−1 ) , k > 1 (3.33) Rθk is just a constant factor similar to the 1/3 factor in Equation 3.28 except that it different for every tube. RDCθk is the DC resistance of the curved section of the kth tube. For k = 1, Rθk is equal to 1/4. Notice that if Jk is larger than Jk−1 then the effective resistance increases. This is also true for the curved sections of the tube but the rate of variation of the effective resistance is different. Since for this particular case h is still over 10 times larger than the width of the tubes, it was decided to ignore the end effects in the study of the effectiveness of this modification. In the curves presented here the entire resistance was modified based on the following: r′Jk = γ [ 1 + ( 1 + Jk−1 Jk ) Jk−1 Jk ] (3.34) where γ is a constant gain. 65 Chapter 3. Existing Circuit-Based Ferromagnetic Models It was noticed that if rJk was implemented strictly as given in Equation 3.28 then the damping is even worse than the basic circuit case. The modified Rk for the generation of the curves below is now given by: R′k = Rk r′Jk (3.35) Note that J0 = 0 A/m2 since the enclosed flux is zero. Also notice that there are numerical problems with this method if Jk is close to or equal to zero since r′Jk →∞ as Jk → 0. The behaviour that results from using this dynamic modification to the basic circuit model for a three tube model at 60 Hz and 500 Hz is shown in Figures 3.12 and 3.13 along with the experimental data. -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data model Figure 3.12: 60 Hz curves for γ = 2/3 at three excitation levels Comparing Figure 3.12 to Figure 3.6 shows the effectiveness of using the modification based on the variation of J and a constant gain. Notice the distortion in the response of the model. This distortion becomes even more pronounced for the response of the model to a 500 Hz excitation as shown in Figure 3.13. 66 Chapter 3. Existing Circuit-Based Ferromagnetic Models -1000 -800 -600 -400 -200 0 200 400 600 800 1000 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data model Figure 3.13: 500 Hz curves for γ = 2/3 at three excitation levels The sharp corners in the response of the model as shown in Figure 3.13 is mostly due to the problem when Jk approaches zero. They can be reduced by setting a maximum for the change in R′k from its initial value. This effectively turns off the algorithm when the value of the current density Jk is near zero. As the maximum change in R′k is increasingly clamped, the region near Jk = 0 where the algorithm is turned off becomes larger. The inward bulging of the response of the model for both sets of frequencies is due to the sharp decrease of the value of R′k as the excitation changes sign and the lagged field inside the material creating a current density that is larger inside the material than on the outer surface of the lamination The response of the model with the inclusion of the correct modifications to Rk based on the curved sections of the tubes does not make a noticeable difference. In this case, the same pronounced effects will still be present. Although this type of dynamic modification to the tube resistances has strong theoretical merit, it produces results that have undesirable distortions. These distortions prompted the continuation of the search for better modifications to the basic circuit. 67 Chapter 3. Existing Circuit-Based Ferromagnetic Models 3.2.4 Variation of Rk Based on a Correction Factor for the Excess Currents This technique dynamically corrects the values of the circuit resistances based on the empirical equations for the classical and excess eddy current losses in thinly laminated materials. Through empirical studies, for sinusoidal excitation the power loss due to classical eddy currents has been found to be: Peddy = Cc ( dB̄ dt )2 (3.36) where Cc is a empirically determined constant of the material. Similarly, the power loss associated with the excess eddy currents is found to be: Pexcess = Ce ∣∣∣∣ dB̄dt ∣∣∣∣3/2 (3.37) where Ce is a empirically determined constant of the material. It is important to realize that these relationships assume that the field is mostly uniform inside the material. Since the field is assumed to be uniform within every tube these equations are usually applied on a per tube basis. The total loss due to the eddy currents is the sum of these two components i.e. PT = Peddy + Pexcess. As shown in [43] the total eddy current loss can be rearranged to yield: PT = Cc ( dBz dt )2 k rexk (3.38) where: rexk = 1 + Ce Cc √∣∣dBz dt ∣∣ k (3.39) The resulting modification of the DC resistance can be shown to be: R′′k = Rk rexk (3.40) Notice that rexk → ∞ as ∣∣dBz dt ∣∣ k → 0. As with Equation 3.28 care must be taken to avoid a division by zero. This mechanism was not tried for the following reasons: 1. This modification is only approximate at best because, as mentioned above, the field becomes increasingly non-sinusoidal as it penetrates the material. Furthermore, the excitation itself is not necessarily sinusoidal either such as in the case for high speed operation of SRMs. 68 Chapter 3. Existing Circuit-Based Ferromagnetic Models 2. Notice that R′′k → 0 as ∣∣dBz dt ∣∣ k → 0. As will be seen later this trend is actually opposite to what is desired As is discussed in Section 1.5.3, the use of Equations 3.36 and 3.37 is quite widespread in the modeling of ferromagnetic materials. In particular, many strictly mathematical implementations of magnetic models use some form of Equations 3.36 and 3.37. 3.3 Chapter Summary This chapter gives a theoretical basis for the basic circuit-based model for ferromagnetic materials. It was shown that the basic circuit attempts to emulate the behaviour of electromagnetic fields inside matter. The emulation, however, is not perfect because ferromagnetic materials have magnetic domains. The movement of these domains generates additional currents that are not predicted by the basic circuit. To understand how the basic circuit needs to be modified the trends in the performance of the basic circuit are investigated. From the behaviour of the basic circuit for different frequencies and excitation levels it is found that the values of the circuit resistances need to be dynamically changed. It is also found that the initial values of the circuit resistances need to be statically modified from their initially calculated DC values. A technique for systematically doing this is also provided in this chapter. The chapter closes with two existing techniques that dynamically vary the values of the circuit resistances. It is found that, although there is some theoretical merit in these techniques, the modified models produce distortions in their output responses that are undesirable. The main results of this chapter were used in the development of the two mechanisms that are the main contributions of this work. This development is given in the next chapter. 69 Chapter 4 New Mechanisms for Circuit-Based Ferromagnetic Models This chapter discusses the main focus of this thesis. Namely, the modification of existing circuit- based models for better performance over a larger range of operating conditions. The preexisting models are modified by two newly developed mechanisms. The details of these mechanisms along with a procedure for identifying their parameters is contained within this chapter. This chapter also provides an analysis of the accuracy of the newly proposed model in comparison to the base model shown in Figure 3.1 that is tuned at specific operating conditions. This discussion also includes other methods that ultimately failed. The reasons for their failures are highlighted to emphasize the difficulty in achieving the seemingly easy task of adding frequency dependence to the parameters of the model. 4.1 Mechanisms that Failed Several other approaches were explored before the final mechanism was developed. Given the trends presented in Chapter 3, the first logical step would be to add a direct rate dependance to the values of Rk. One potential problem with using derivatives is they are generally very noisy. The noise from the derivatives can cause unwanted oscillations in the output of the model if used improperly. In a magnetic circuit there are two potential rates that can be used: rate of change of flux and rate of change of mmf. Since the presence of current produces the B field it seems reasonable that the rate of change of mmf should be used. However, the rate of change of the flux is more convenient to use since the basic circuit already incorporates the derivatives of the fluxes in the circuit whereas the derivatives of the mmfs in the circuit need to be separately obtained. In the end, two approaches were tried. The first approach uses just the estimated derivatives of the mmfs in the circuit. The second approach uses a combination of both derivatives. 4.1.1 Direct Use of the Derivatives of the Circuit Mmfs The rate of change of the mmfs of the basic circuit need to be estimated. This estimation will be covered in detail in Chapter 5. Assume for now that the derivatives of any of the mmfs in the basic circuit are available to be used. 70 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models The first step is to determine which mmfs to use. It was decided that, for the kth layer, the derivative of the k + 1 layer mmf is used to modify Rk as given by: R′k = f −1(Ḟk+1)ζkRk (4.1) where f is a function to be determined that depends on the derivative of the mmf of the k+1 layer, Ḟk+1. The derivative of the input mmf is used for the nth layer. For a given layer k, the value of ζk is the static adjustment to the value of the calculated DC resistance Rk that is described in Section 3.2.2. The function f is obtained by fitting the response of the modified model to the experimental data. The general shape of the curve can be anticipated by the observations that were made with the unmodified basic circuit i.e. f should be large for low values of Ḟ and small for high values of Ḟ . Note that the inverse of f is used in Equation 4.1 since the inductances in the basic circuit are proportional to 1upslopeRk. The same function is used for every layer. The use of a different function for every layer is unlikely to improve the accuracy by very much. Furthermore, the time that would be required to obtain separate functions is prohibitively high for models with many layers. Unfortunately, the performance of this mechanism is unsatisfactory. The results that were obtained using this approach were less than ideal for the following reasons: 1. The shape of f that is required for a given input frequency is different than the shape for another input frequency in some narrow bands of Ḟ . Thus, it is impossible to determine a single function that can cover a large range of input frequencies. 2. The use of Ḟ directly allows the inherently noisy derivatives to directly affect the output of the model. This mechanism was abandoned after the preliminary results showed it to be inadequate. Even if different functions for different layers lessens or removes the issue of point 1, the noise issue is insurmountable. No reasonable amount of filtering of the derivatives is able to reduce the effects of the noise to an acceptable level. Thus, a method that uses the derivatives of the mmfs to modify the values of Rk in a more indirect way is required. 4.1.2 The Use of the Flux and Mmf Derivatives Together The second approach that was tried was the use of both the derivatives of the circuit fluxes and mmfs. Consider the following modification to the circuit resistances: R′k = ζkRk 1 + g(Ḟk+1)φ̇k (4.2) 71 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models where g is a function that is similar in shape to the function f above and φ̇k is the derivative of the φk flux as defined in Figure 3.1. The derivative of the fluxes can not be used directly because as the frequency increases so would the value of the circuit inductance. This trend is opposite to what is required. Thus, the derivatives of the mmfs are used to roll off the gain introduced by φ̇k. As the frequency decreases the gain needs to be substantially increased to account for the decrease in the derivative of the flux. This is also provided for by g. The required shape for g is determined by matching the experimental curves to the output of the model for various frequencies. For similar reasons as the above described method, only one definition of g is used for every tube. The result of this procedure for a ten tube model is shown below. Notice in Figure 4.1 that the high frequency gain of g is actually negative. This is required to further decrease the circuit inductances for high frequency, high peak magnitude, input excitations. Care must be taken that the resulting resistance does not “blow-up” for excessively high derivatives of the mmfs. Therefore, a minimum value of the denominator of Equation 4.2 is set to avoid this situation. Note that Equation 4.2 could have been written as follows: R′k = ζkRk ( g′0 + g ′(Ḟk+1)φ̇k ) (4.3) where g′0 is a predetermined constant and g′ )= g. The resulting surface that is mapped by R′k(Ḟk+1, φ̇k) is the same for either definition so only the results for Equation 4.2 are necessary to validate this type of mechanism. Although the derivatives of the mmfs are used in this approach, the impact of the noise on the circuit’s output is substantially smaller than the previously described mechanism. Furthermore, the problems that occur while trying to define a single function for f are significantly reduced in the definition for g. Looking at Figure 4.1, however, reveals a potential drawback to this scheme. The extreme change in the slope of g requires a relatively small value of the time step in the digital implementation of this modified circuit compared to the original circuit. For online applications such as the sensorless control of SRMs this could prove to be a severe limitation. The mechanism described by Equation 4.1 was implemented in a magnetic equivalent circuit with three, four and ten tubes. This allowed the behaviour of the modification to be examined as the number of tubes is changed. The response of the ten tube model for 60 Hz and 500 Hz input excitations is shown in Figure 4.2. Notice that even for a model with ten tubes the performance of this mechanism for the 60 Hz case is undesirable. The damping in the 60 Hz case is still insufficient as highlighted by the error in the circuit’s response near middle and ends of the curves. In particular, the error near the middle of the curves generally becomes worse as the number of tubes is deceased. The performance of this mechanism for the 500 Hz case is acceptable. However, the model’s response at 500 Hz is bought with a cost; namely, the degradation of the performance of the model at 60 Hz. The independence 72 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 0 1000 2000 3000 4000 5000 6000 7000 8000 0 50 100 150 200 250 300 g | dF /dt | (A/s) Figure 4.1: Gain function g(Ḟ ) of g on the input excitation frequency is still not completely achieved. Finally, this mechanism was eventually abandoned because, for the ten tube case, a 10µs timestep was still not able to completely eliminate the oscillations in the response of the circuit due to the extreme change in the slope of g. The above two mechanisms are an improvement over the original basic circuit but they still have too many problems. Although it is not detailed here, a mechanism that used just φ̇ was also tried i.e. a correction factor 1 + g∗(φ̇k) was employed to modify the values of Rk. The determination of a suitable shape for the function g∗ is similar to the other mechanisms in this section. The performance of this scheme is generally even worse than the two mechanisms described here so it was quickly discarded. The remainder of this Chapter details the mechanisms that are the final result of this work. 73 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -500 -400 -300 -200 -100 0 100 200 300 400 500 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data model 500 Hz 60 Hz Figure 4.2: Performance of a 10 tube model with the 1 + g(Ḟk+1)φ̇k correction factors 4.2 Proposed New Circuit Model The development of the model that is the final result of this work was carried out in three phases. The first phase involved the testing of an idea for a model that only used the initial magnetization curve to characterize the relationship between H and B and eddy currents that flow in the classical sense. At that time the results from the actual material were not available. When the results from the actual material were made available the initial attempt was shown to have problems. The second phase in the development of the final model included the testing of the ideas that are presented in the previous section and the modification of the initial attempt in the first phase. The end result of the second phase is a mechanism that can match the behaviour of the actual material when it is allowed to partially or fully saturate over a wide range of frequencies with good accuracy. However, the model still can not match the behaviour of the material very well when it does not saturate to any extent. The result of the third phase handles this discrepancy by adding a second 74 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models mechanism that corrects for the observed error. It is thought that the error can be attributed to the effect of the additional eddy currents that flow due to the shifting of the domain walls. The combination of the two mechanisms gives a model that can match the behaviour of the actual material for a large range in both input frequency and magnitude to a high level of accuracy. 4.2.1 A Partially Successful Attempt The resulting mechanism from the first attempt to solve the modeling problem of this work matched the behaviour of models that just exhibit classical eddy currents quite well but was not as successful at modeling the real material. Initially, the response of a similar circuit to the basic circuit was tested without the effect of hysteresis. The initial magnetization curve was used to characterize the static relationship between H and B. An analytical non-linear representation of a core with a circular cross-section was solved in Matlab to compare the response of the circuit with the analytical model. The response of the model was also compared to the results that were produced with 3D finite element software for a rectangular cross-section. In the case of the analytical solution, the following diffusion equation in cylindrical coordinates (r, θ, z) was solved: µσ ∂Hz ∂t = 1 r ∂ ∂r ( r ∂Hz ∂r ) (4.4) subject to the boundary conditions: ∂Hz ∂r (0, t) = 0 (4.5) Hz(rm, t) = Hf (t) (4.6) where rm is the radius of the core, and Hf (t) is the value of the excitation field on the outer surface of the core. Note that H = Hzk̂. Since Hz only varies along r, Equation 4.4 does not contain θ. Equation 4.4 can be derived directly from Maxwell’s equations and B = µH. Since µ is nonlinear this has to be solved numerically. Equation 4.4 is a 1-dimensional parabolic partial differential equation. Matlab has a built in solver for this type of equation. The finite element solution was implemented with a very fine mesh. The cross-section of one lamination was modeled with 20 layers of quadratic elements. The 3D dynamic solver from Infolyt- ica was used to produce the results. The circuit that was used is a variation of the basic circuit. Instead of using inductors, flux 75 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models dependent mmf sources were used. The value of the mmf sources are given by: L ∗k (φk−1 or φk) = 1 Rk dφk−1 dt k > 1 1 Rk dφk dt k = 1 (4.7) For k > 1 the value of L ∗k depends on the derivative of the sum of the fluxes of the tubes below the kth tube. The mmf source for the innermost tube is the same as the inductor in the basic circuit. Comparing the results from thus circuit with the two above described magnetic models yielded two very general trends: 1. The damping for values of H less than the knee point of the initial magnetization curve was about the required amount. However, the damping for values of H above the knee point is insufficient. 2. Adding more tubes to the model improves the accuracy of the model. This is particularly noticeable when the circuit is modified in order to mitigate the error described in point 1. In particular, point 2 is very interesting because this trend seems to be boundless i.e. adding more layers always extends the frequency range of the model without degrading the low frequency performance of the model. This might explain the multitude of papers in the literature that implement models without hysteresis with 10 or more tubes. On the other hand, increasing the number of tubes is also a way of artificially increasing the damping to compensate for the loss in width of the generated B − H loops of the model due to not utilizing a hysteresis model. Nevertheless, the behaviour of this circuit is indicative of the behaviour of circuits that include a full hysteresis model instead of an initial magnetization curve. The error described in point 1 was significantly reduced by modifying the values of Rk based on a function of µ. In this way, the time constants τ = L ∗upslopeR of the L ∗R circuits are adjusted to compensate for the large increase in R as the material saturates. With this new modification the mmf sources given in Equation 4.7 now become: L ∗′k (φk−1 or φk, µ ′ k) = 1 RµkRk dφk−1 dt k > 1 1 RµkRk dφk dt k = 1 (4.8) 76 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models where: Rµk(µ′k) = 1− pk + pk µ′k µ(0) , pk ∈ [0, 1] (4.9) Note that µ(0) is the value of µ for H = 0. The value of µ′k is equal to the value of µ that would be obtained if the flux φk−1 was in one tube with an area equal to the sum of the areas of the 1, 2, . . . , k − 1 tubes. Thus, the value of B that corresponds to φk−1 needs to be calculated. From this the value of µ′k is obtained from the initial magnetization curve. The response from the analytical model or the finite element model for a case with and without saturation for a single frequency was compared to the response of the circuit in order to tune the value of pk. In general pk can be different for every tube but it is was found that having the same value of pk for every tube was sufficient. Thus, really only one parameter needs to be tuned for this approach. It was hoped that the success of this technique with the simplified magnetic model would carry over to a model with hysteresis with little or no modification. Unfortunately, the resulting performance is not as good as was hoped. It was understood that the performance of this technique was likely to worsen compared to the simple case because the generation of eddy currents due to the domain structure is not captured in this approach. However, the required frequency dependance of pk was not anticipated. The implementation of this modification for the basic circuit with hysteresis requires minor modifications. The values of Rk are now multiplied by Rµk(µ′k) in Figure 3.1. The value of µ ′ k is now obtained from φk instead of φk−1. Similarly to above, µ′k is determined by assuming that φk is in a single tube of total area equal to the 1, 2, . . . , k tubes. In this case, however, the resulting B is related to H via the hysteresis model instead of the initial magnetization curve. The value of µ(0) becomes the largest value of µ in the set of the first order reversal curves that are used by the modified hysteresis model. The same value of pk was used for all of the tubes. The only other modification to the basic circuit is the static adjustment of the values of Rk that is described in Section 3.2.2. Note that some of the gains that are obtained from that procedure need to be reduced otherwise the model produces results that are overly damped. This reduction can be preformed by iteratively changing the resistances of the tubes that use this mechanism for one case until the model’s results match the behaviour of the actual material. The response of this model to 60Hz and 500Hz excitation inputs for Hpeak = 500 A/m is shown in Figure 4.3. Notice that the response of the model for the 500 Hz case is overly damped. The overdamping becomes increasingly severe as the frequency increases. This can also be seen in the 60 Hz case. The damping is too much near the knee points of the response but is then underdamped after the knee points. The frequency response of this mechanism prompted the search for ways to modify the parameters of the model as the frequency changes. 77 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -500 -400 -300 -200 -100 0 100 200 300 400 500 -1.5 -1 -0.5 0 0.5 1 1.5 H (A/m) B (T ) experimental data model 500 Hz 60 Hz Figure 4.3: Performance of a 4 tube model with the modification Rµk(µk) 4.2.2 Variation of Rk Based on Λk(Ḟk+1) As is clearly seen in Figure 4.3, pk needs to vary as the frequency varies. This is achieved by using the derivatives of the mmfs of the circuit. The issues that are associated with using derivatives are the same for this modification as the cases that are detailed in Section 4.1 so they are not repeated here. If the values of the gain pk are allowed to vary in response to the variation of the derivatives of the circuit mmfs then Equation 4.9 can be redefined as: R′µk(µ ′ k,Λk) = 1− Λk(Ḟk+1) + Λk(Ḟk+1) µ′k µ(0) , Λk ∈ [0, 1] (4.10) However, if Equation 4.10 is implemented as is then the response of the model for cases when the material is subjected to high frequency, high peak magnitude input excitations is overdamped near the endpoints of the response compared to the actual material. Thus, the lower limit of the allowed range of Λk needs to be relaxed. The third term on the right had side of Equation 4.10 78 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 0 1000 2000 3000 4000 5000 6000 7000 8000 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 | dF /dt | (A/s) Λ Figure 4.4: Variation of Λ with |Ḟ | still needs to be restricted to the original range otherwise the increase in R′µk due to a negative Λk will be reduced by the negative third term. With the above considerations in mind, the modified circuit resistances are finally given by: R′k = ζ ′ kRkR ′ µk(µ ′ k,Λk) (4.11) where: R′µk(µ ′ k,Λk) = 1− Λk(Ḟk+1) + Λ′k(Ḟk+1) µ′k µ(0) , Λk ∈ [−∞, 1] (4.12) Λ′k(Ḟk+1) = { Λk Λk ! 0 0 Λk < 0 (4.13) The value of ζ ′k is the adjusted static modification to Rk that is described near the end of Section 4.2.1. The static adjustment to the value of the resistance remains unchanged for tubes that do 79 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models not use this mechanism i.e., ζ ′k = ζk for these tubes. Note that although Λk could theoretically approach negative infinity, for practical reasons it is capped at a sufficiently large number. The variation of Λk as a function of Ḟ is obtained by iteratively modifying the shape of the curve for different input frequencies and peak magnitudes of H. The resulting piecewise linearized variation of Λk for a ten tube model is shown in Figure 4.4. Although a smooth variation could be used, a piecewise linear variation is more convenient to implement. Notice that the variation of Λk with Ḟ is less abrupt than the variation of g with Ḟ . Consequently, the maximum allowable timestep for this scheme is higher than that for the mechanism that modifies the resistances based on the factors 1 + g(Ḟk+1)φ̇k. Equations 4.11–4.13 along with Figure 4.4 define the first of two mechanisms that are the main contributions of this work. The typical results for this mechanism are presented near the end of this chapter along with the results for the mechanism that is presented next. Notice the significant errors produced by this mechanism for cases when the material does not saturate to any extent. Clearly, this mechanism by itself can not account for all of the eddy currents that are flowing in the material. 4.2.3 Accounting for Eddy Currents due to Domain Wall Motion The modeling work so far has been primarily based on the classical model for eddy currents. No explicit correction has been made for the eddy currents that flow due to the motion of the domain walls. The error that can occur when the effect of these currents is ignored can be very significant as is shown by the response of all of the models presented so far for Hpeak = 125 A/m. The second mechanism that is proposed in this work is designed specifically to correct for the error that occurs due to these additional currents. The development of this mechanism is based on the following assumptions: 1. Any localized eddy currents that may flow due to domain rotation are small enough that they can be neglected. 2. As a ferromagnetic material becomes more demagnetized the number of domains in the mate- rial increase. Therefore, the eddy currents that flow due to the domain walls shifting increase as the material becomes more demagnetized 3. Along any given trajectory as the path taken by the material approaches the origin the number of domains increase whereas as the path moves away from the point that is the closest to the origin the number of domains decrease. The state of a piece of the material can be broadly defined as either being saturated or unsat- urated. Based on the assumptions that are given above, the mechanism described here deals with 80 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models the material when it is in an unsaturated state. The first assumption pertains to the rotation of entire domains as the material saturates. As a material approaches saturation the number of domains in the material decrease until the material is dominated by a few domains. After this point an increase in H only further aligns the magnetic moments within these domains with the field. This assumption appears to be justified because the excess currents are commonly attributed to the localized disturbance of B in the vicinity of moving domain walls whereas domain rotation strictly describes the rotation of the magnetic moments within the remaining domains within the material. An illustration of the difference between the two is provided in Section 1.4.2. The second and third assumptions give a basis to define a function that provides additional gain to dampen the response of the model when it is unsaturated. The function is generated from symmetrical hysteresis loops. These loops are provided by the modified Preisach model that is detailed in Chapter 2. Specifically, the hysteresis model is first brought into a demagnetized state. The model is then perturbed by a symmetrical input with peaks corresponding to the desired curve. According to point 2, curves that are closer to the origin are given a larger gain. Furthermore, as the trajectory goes from either extreme points in H the gain increases until the path is the closest to the origin. Thereafter, the gain decreases until the trajectory returns to the initial magnetization curve at the other extremum point. The gains are chosen such that the peak gain on a hysteresis loop that is further away from the origin than another is smaller than the gain at the extremum on the closer loop. The gain along the curve that connects the closest points of the hysteresis loops to the origin is defined as: gz(di) = 1 /( a1x4 + a2x3 + a3x2 + a4x + a5 ) x = ( di dc ) (4.14) where 1upslopea5 is the value of the gain at the origin, a1 + a2 + · · ·+ a5 = 1, and di is given by: di = √( Hi Hm )2 + ( Bi Bm )2 (4.15) Hm and Bm correspond to the values of H and B on the initial magnetization curve at the outermost curve. The gain at this point and along the outermost hysteresis curve is equal to one. The distance as defined by Equation 4.15 for the endpoint of the curve that connects the closest points of the hysteresis curves to the origin is equal to dc. This point also lies on the outermost hysteresis curve. 81 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models A similar curve can be defined for the gains along the initial magnetization curve. This curve is defined as: gz(di) = 1 /( b1y4 + b2y3 + b3y2 + b4y + b5 ) y = ( di√ 2 ) (4.16) where b5 = a5 and b1 + b2 + · · ·+ b5 = 1. The definitions of Equations 4.14 and 4.16 may seem to be too unwieldy given the number of constants that need to be determined. For this particular case a fourth order equation was the minimum order equation that was able to fit the required shape for the gain function. The number of constants can be significantly reduced by forcing the ratio of the maximum gain at the closest point to the origin and the minimum gain at the extremum points on the initial magnetization to be the same for every hysteresis loop. The ratio was initially chosen to be 0.8. Varying the ratio about this value did not seem to overly affect the results produced by this mechanism so it was retained for the final model. Once the constants a1, a2, a3, a4, and the ratio are fixed then the constants b1,b2,b3, and b4 can be obtained by any reasonable curve fitting algorithm. The constants a1, a2, a3, and a4 are obtained by fitting the response of the model to the response of the actual material for various frequencies. The gain along the path from the points on the initial magnetization curve to the point closest to the origin for a given hysteresis curve is obtained by: gz(di) = gz(H ′, B′) ( 1 + ( 1− rp rp ) di − √ 2 dp − √ 2 ) (4.17) where dp is the distance from the closest point on the hysteresis curve to the origin, rp is the ratio that is described above, and gz(H ′, B′) is the value of the gain on the initial magnetization curve that corresponds to the hysteresis curve. With the use of Equations 4.14 - 4.17, the definition of the gain gz that was developed for the test material is shown in Figure 4.5. Note that this definition is for only one specific model – a 10 tube model that uses a 25 µs timestep. If the timestep or number of tubes is changed then the definition of gz needs to be identified again. More on this is discussed in the section on the accuracy of the new model that is given later in this chapter. If the definition of gz is used as is then this mechanism can produce results that excessively attenuate the H and, therefore, B magnetic fields inside the model of the material. This is partic- ularly true of models that use this mechanism for every tube. A function called Γ is defined to roll off the gain for higher frequencies. An example of a suitable shape for Γ is shown in Figure 4.6. This is for the same case as the definition of gz i.e. a 10 tube model with a 25 µs timestep. 82 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models Figure 4.5: Definition of gz for a ten tube model Notice in Figure 4.6 that the gain actually becomes larger than one for rates less than 1000 A/s. This allows more gain for lower frequencies without overly affecting higher frequencies. Also note that the derivatives of the circuit mmfs are used in this mechanism for the same reasons that are discussed in Section 4.1. The definition of gz and the frequency dependent roll-off gain Γ are combined to become a mechanism that can correct for the errors that occur due to ignoring the eddy currents that are produced by the motion of the domain walls. 83 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 0 500 1000 1500 2000 2500 3000 3500 4000 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 | dF /dt | (A/s) Γ Figure 4.6: Variation of Γ with |Ḟ | Thus, with the definitions of gz and Γ in mind, the modifications to the circuit resistances for this mechanisms are: R′′k = R′k Rgzk (4.18) where: Rgzk = 1 + (gz(Hk, Bk)− 1)Γk(Ḟk+1) (4.19) The values of R′k are the modified circuit resistances from the R ′ µk mechanism that is given by Equation 4.11. The benefit of using this mechanism is clearly seen in the figures in the next section. As with the mechanism that is described in Section 4.2.2, increasing the number of tubes increases the accuracy of the model. The number of tubes that are required for this mechanism compared to the mechanism in Section 4.2.2 is higher because the falloff of H in the material is more severe for 84 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models cases without saturation compared to cases with partial or full saturation. A final note needs to be made about the tuning of the values of the constants a1, a2, a3, and a4 and the determination of Γ. Initially, the lower frequency gains of Γ are set to one. The required roll-off of the gain and the constants are determined by ensuring that the amount of damping at the ends of the waveforms is correct for the entire frequency range of inputs. This process is iterative, however, suitable values of the constants and the roll-off can be determined with only a few iterations. Finally, the lower frequency gain of Γ is increased until the damping at the ends starts to be affected. The increase of the lower frequency gain tends to tighten the response of the mechanism while leaving the damping at the ends mostly intact. 4.2.4 Procedure for Identifying the Parameters of the Model This section gives the procedure for generating the necessary parameters for the proposed model that is described in this chapter. The parameters should be derived in such a way that they can be directly used in the implementation of the model that is described in Chapter 5. The identification of the model requires the following pieces of information: 1. a set of first order reversal curves that are referred to either +Hsat or −Hsat; 2. a set of H and B (or M) data at three or more frequencies for peak input excitation values that correspond to a DC magnetization that is unsaturated, near the middle of the saturation region and almost completely saturated; 3. dimensions of the magnetic structure to be modeled; The data for items 1 and 2 can be obtained with the use of the experimental setup that is described in Appendix A or by any other suitable means. The magnetic material should be excited such that either a sinusoidal H or sinusoidal B waveform is generated for the sets of frequency dependent data. Furthermore, the frequencies that are used to produce the data should span the entire operation range of the model. The value of the nominal value of the resistivity of the material can be obtained from the manufacturer of the magnetic material. If the type of material is unknown then either σ can be experimentally found or it can be found as part of the identification process of the model in Step 4 below. The procedure that was used to identify all of the parameters of the models that were developed for this work is as follows. Step 1. Generate the two data structures given in Tables 2.1 and 2.2 for the hysteresis algo- rithm from piecewise linearized first order reversal curves. Step 2. Decide on the number of tubes for the model. 85 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models Step 3. Calculate R(µk) and Rk(σ) from the geometry of the material as given in Section 3.1.2. Step 4. Determine the static change ζk to the values of Rk as outlined in Section 3.2.2 and optionally a value for σ if it is unknown. Step 5. Generate Λ(|Ḟ |) by fitting data for cases when the material is allowed to saturate to some extent. This is done by: i. readjusting ζk for tubes that use the R′µk mechanism that is described in Section 4.2.2 to obtain ζ ′k; ii. adjusting the gain of Λ for values of |Ḟ | corresponding to low, mid, and high excitation frequencies starting with low frequencies and then progressing to in- creasingly higher frequencies. Step 6. Obtain gz(H,B) and Γ(|Ḟ |) by: i. obtaining an estimate of the gain that is required for gz at different frequencies by statically changing the modified resistances ζkRk and ζ ′kRk while the R ′ µk mechanism is still active; ii. based on Step 6(i), determine the initial values of a1, a2, . . . that are defined in Section 4.2.3 to fit the estimate of the required gain as a function of |Ḟ | for gz; iii. fix the ratio rp that is described in Section 4.2.3 to 0.8; iv. readjust gz by fitting the response of the model for low to mid range frequencies while initially fixing the value of Γ = 1; v. reduce Γ for higher frequencies while keeping gz fixed; vi. increase Γ while keeping gz fixed for low frequencies to tighten the response of the model until the damping at the ends of the response starts to be affected. Step 7. If the accuracy of the final model is insufficient then increase the number of tubes of the model and return to Step 3. The procedure for the identification of the model assumes that the timestep of the solution is fixed based on the time constraints that are imposed on the implementation of the model. In general, reducing the time step of the model increases the accuracy of the solution but at the expense of increased computational effort. This will become clearer in light of the discussion in the next section and in Chapter 5. The procedure also assumes that the geometry of the material is simple i.e. the cross-section of the material as seen by the magnetic path is constant and is either rectangular or circular. 86 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models Thus, complex structures such as the stator and rotor of machines need to be divided into several more elementary shapes that are fitted with individual models separately. Generally each section of a more complex device can be approximated with an equivalent geometry that allows for the calculation of the reluctance of the magnetic path and the resistance of the eddy current paths. A good approach for doing this can be found in the book Dynamics of Saturated Electric Machines by Ostović [68]. This approach is beyond the scope of this work so it is not included in this discussion. Fortunately, the vast majority of structures that are composed of ferromagnetic materials can be approximated with sections that have either rectangular or circular cross-sections. Thus, the tube structure that is defined in Section 3.1.2 can be used without major adjustments for most of the cases that are present. When this procedure is applied to complex structures the models of each section of the device need to be determined with the use of separate pieces of the same material with an equivalent simple geometry. It is hoped that general trends in the parameters of the model exist for cross sections of different dimensions of the same material. Thus, the parameters for models with dimensions that are bounded by existing fitted models can be obtained by interpolating the parameters of the existing bounding models. Finally, a quick comment about the first-order reversal curves of the material should be given. The first-order reversal curves are principally dependent on the composition of the material. Chang- ing the geometry of the material has generally little or no impact on the shape of these curves. However, mechanical stress that causes the permanent deformation of the material can cause the shape of the curves to change. The shape is also dependent on the ambient temperature surround- ing the material. These effects among others are important but are left for future consideration. Since hysteresis by itself is deemed to be time and geometry independent, only one set of first order reversal curves is necessary to construct the hysteresis model for a given material. 4.3 Accuracy of the Proposed Model The accuracy of the proposed model is explored in comparison to the basic model that is depicted in Figure 3.1. The initially calculated DC values of the tube resistances of the basic model are statically modified based on the procedure in Section 3.2.2. This tuning of the circuit is performed for two operating conditions: 250 Hz and 500 Hz for a peak value of H of 500 A/m. The parameters of the proposed models are determined based on the procedure that is given in the previous section. The accuracy is shown here in two ways. The first way is to compare the results of the various models with a metric. As a result, trends in the behaviour of the models can be determined. The second way is to present the response of two specific models graphically. A dynamic ten tube model is compared to a static ten tube model to highlight the advantages of the proposed model in this work. 87 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 4.3.1 Analytical Determination of the Accuracy A specific metric is used as the basis for the comparison. The metric is the normalized least squares error of the output of a model. The output of the various models are compared to the experimental data that was measured using the apparatus described in Appendix A. Since the models operate at specific fixed timesteps, the number of output points for a single cycle of the input decrease as the input frequency increases. In order to compensate for this trend, a scaling factor for the error is introduced to allow the response of the models to be compared for different frequencies. The metric that is used to generate the error in response of a given model is given by: E2 = n60 n n∑ i=1 ( B̄i − B̄∗i B̄p )2 (4.20) where: n is the number of data points, n60 is the number of data points for the 60 Hz waveforms, B̄i is an array containing the output response of the actual material, B̄∗i is an array of the output values that are generated by the model, and B̄p is the maximum value of the output of the experimental curve. Note that since the difference between the model’s response with the experimentally determined curve is divided by the peak of the output response of the actual material, the resulting error E is dimensionless. Thus, the division with the peak value provides the normalization that is mentioned above. Besides comparing the improvement of the proposed model with the basic circuit, the effec- tiveness of increasing the number of tubes and reducing the timestep of the new model was also investigated. All of the comparisons are performed by computing the metric that is given in Equa- tion 4.20 for twelve different operating conditions. These operating conditions are tabulated below in Table 4.1. In Table 4.1, for all cases, the input waveform H is sinusoidal with a peak amplitude of Hp and frequency f . The cases when Hp is equal to 125 A/m correspond to a DC magnetization that does not saturate the material to any degree. The cases when Hp is equal to 500 A/m and 1000 A/m correspond to DC magnetizations that are near the middle of the saturation region and almost fully saturated respectively. Thus, at the very least, part of the material will saturate to some degree in these cases. Three separate studies of the accuracy are presented here. The first study compares the output of three models with four tubes that are solved with the same timestep of 50 µs. Of the three models one uses both of the mechanisms and the other two are tuned for two different operating conditions. These operating conditions correspond to cases 5 and 8 in Table 4.1. The dynamic model only uses the R′µk mechanism in the outermost tube whereas the Rgzk mechanism is used for every tube. The reason for this choice is explained below. 88 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models Table 4.1: Operating conditions for comparing the models Case Hp (A/m) f (Hz) Case Hp (A/m) f (Hz) 1 1000 1000 7 1000 250 2 500 1000 8 500 250 3 125 1000 9 125 250 4 1000 500 10 1000 60 5 500 500 11 500 60 6 125 500 12 125 60 The second study compares the effect of changing the timestep. The accuracy of two models that have four tubes are compared for timesteps of 25 µs and 50 µs. Both of the models use the R′µk mechanism in the outermost tube and the Rgzk mechanism for every tube. The third and final study compares the accuracy of a ten tube model to a four tube model. Both of the models are solved with a timestep of 25 µs. The four tube model that was used is the same one as in the second study. The ten tube model uses both the R′µk and Rgzk mechanisms on the four outermost tubes. In these studies, one fact that became very apparent is the two mechanisms are not necessary for every tube. Initially the mechanisms were only added to the outermost tubes of the model. It is found that as the mechanisms are added to more tubes, starting with tubes nearer to the outside surface of the material, the improvement in the response of the model becomes increasingly smaller. This is not surprising since the response of the outermost tubes dominates the response of the entire model. They dominate in the sense that a change in a parameter of an outermost tube has a larger impact on the response of the model compared to a similar change in the parameter of an inner tube. The extent of this behaviour was confirmed when the values of the resistances were statically changed while performing the procedure in Section 3.2.2. In general, the drop off in the improvement of the model’s response is more severe for the R′µk mechanism compared to the Rgzk mechanism. The results of the first study are shown in Figure 4.7. Notice the large error in the output of the models that are tuned for specific operating conditions when the material is not allowed to saturate to any degree. Also notice that the model that was tuned at f = 500 Hz is more accurate than the model that is tuned at f = 250 Hz for higher frequencies. Conversely, the model that is 89 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 1 2 3 4 5 6 7 8 9 10 11 120 1 2 3 4 5 6 7 8 9 10 Case E static adjustment at 250 Hz static adjustment at 500 Hz with both mechanisms Figure 4.7: Comparison between a dynamic and two static four tube models with 50 µs timesteps tuned at f = 250 Hz is more accurate for lower frequencies and values of the peak H compared to the model that was tuned at f = 500 Hz. These trends are consistent when the gains of the circuit inductors are considered. What probably seems surprising is the error for the tuned models actually decreases for cases above 250 Hz when the material does not saturate whereas the error for the dynamic model increases. This trend will be explained in the discussion that follows the presentation of all of the results of the three studies. The error that is produced by the dynamic model is either lower or at worst only slightly higher than the best of the two models that are tuned. For the cases when the material is not allowed to saturate, the error produced by the dynamic model is significantly lower than the tuned models. This is mostly due to the action of the Rgzk mechanism. Although not shown here, the advantage of the dynamic model over the tuned models becomes more significant as the timestep of the solution is reduced and/or the number of tubes for the model increases. Appendix B gives data for these cases that clearly demonstrates this fact. 90 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 1 2 3 4 5 6 7 8 9 10 11 120 1 2 3 4 5 6 Case E 25 us timestep 50 us timestep Figure 4.8: Comparison between dynamic four tube models for two timesteps The results of the second study are given in Figure 4.8. Notice that the accuracy of the model that uses a 25 µs timestep is generally better than the model that uses a 50 µs timestep for cases when the material is allowed to saturate to some extent. This is as one might expect. However, the accuracy of the 25 µs model is actually worse than the 50 µs model when the material is not allowed to saturate. This might come as a surprise but there is a good reason for this to happen. The rationale for this behaviour is similar to the reason why the accuracy appears to decrease for the tuned models in the first study. The explanation follows the results of the last study. The results of the final study are shown in Figure 4.9. With the exception of Case 7, the accuracy of the ten tube model is significantly better or approximately the same as the four tube model. This result shows that adding more tubes generally improves the accuracy of the resulting model. Conversely, adding more tubes to a statically adjusted model actually decreases the accuracy of the model as shown in Appendix B. This can be explained by remembering that the static adjustment of the values of the tube resistances is based on shaping the H field as it penetrates deeper into 91 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 1 2 3 4 5 6 7 8 9 10 11 120 1 2 3 4 5 6 Case E four tube model ten tube model Figure 4.9: Comparison between dynamic four and ten tube models with 25 µs timesteps the model of the material. The variation in the values of the resistances of the outermost tubes that is required to properly shape the H field as the frequency changes increases as the number of tubes increases. Thus, static models with more tubes are more sensitive to changes in frequency than models with fewer tubes. The three studies that are presented above show some results that are surprising based on the trends that are presented in Chapter 3. With the exception of the 10 tube dynamic model, the error in the response of the models tends to increase as the frequency increases for inputs that saturate the core to some extent. However, as previously mentioned, the error in the response of the four tube static models for the unsaturated cases actually deceases. This phenomenon is attributed to how the circuit is discretized. Specifically, the circuit inductances need to be discretized. All of the models that are presented in this work are discretized using the backward Euler (BE) rule of integration. While Chapter 5 covers this discretization in detail, its effect on the response of models is given here to facilitate the explanation of the errors that are seen in the figures above. 92 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models The discretization of the circuit inductances with the use of the backward Euler rule of inte- gration distorts the value of the inductance based on the frequency of the change in the input [69]. Additionally, the BE rule also introduces additional damping that depends on the original value of the inductance and the timestep that is used for the solution of the model. This additional damping reduces the effect of the circuit inductors. Thus, the magnetic H field and, therefore, the B field is attenuated less due to this additional damping. The equivalent circuit model of an inductor that has been discretized with the BE rule is illustrated in Figure 4.10. L (a) original inductor R e Le (b) discretized inductor Figure 4.10: Effect of discretizing an inductor with the backward Euler integration rule The values of the circuit parameters that are shown in Figure 4.10 are given by: Le = L tan ( ωT 2 ) ωT 2 (4.21) Re = 2L T (4.22) The frequency distortion of the value of L is relatively small as long as ω & 1/2T where 1/2T is called the Nyquist frequency. Since the Nyquist frequency of the discrete time solution is chosen to be significantly higher than the maximum frequency that exists in the response of the circuit this effect is negligible. Conversely, the effect of Re can not, in general, be ignored unless the timestep of the solution is very small. Certainly, in the cases that are presented in this work, the effect of Re is very significant. The existence of Re also raises an important issue with using the BE integration rule. Namely, the response of the magnetic equivalent circuit is different from the electric equivalent circuit for the same identified parameters because the reluctances in the magnetic equivalent circuit become inductors in the electric equivalent circuit whereas the “inductors” in the magnetic equivalent circuit become resistances in the electric equivalent circuit. Since the circuit elements that are discretized are different for the equivalent circuits, the extra damping that is added due to Re is 93 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models in different places in the circuits and has different values. Thus, the parameters would need to be identified again if the equivalent circuit is changed. This is not really a problem because typically the application dictates which equivalent circuit to use. Thus, the parameters would only need to be identified for one of the two equivalent circuits. As a side note, the trapezoidal rule of integration does not have this issue because Re is infinite in this case i.e. the trapezoidal rule does not introduce any additional damping. This might suggest that the trapezoidal rule should be used in place of the BE rule. However, the additional damping that is provided by BE rule tends to make the output more stable compared to the trapezoidal rule. Also, the response of the magnetic equivalent circuit that is discretized using the trapezoidal rule tends to be overly attenuated compared to the BE rule. For these reasons the BE rule was chosen over the trapezoidal rule for the discretization method of the circuit. With the above discussion in mind, the response of the static four tube models for unsaturated cases can be explained. Clearly, the frequency response of all of the models is modified by the presence of the additional reluctances in parallel with the inductors. In the case of the static four tube models, the increase in the damping of the H field inside the actual material becomes better matched with the damping that is given by the model as the frequency increases. Note that this is not necessarily true for every case. For example, a static four tube model that is solved with a 25 µs timestep instead of a 50 µs timestep shows a slight increase in the error at 500 Hz before it drops off at 1 kHz for the cases that do not saturate the material. Thus, a clear trend can not be given for the results of the static cases when the material does not saturate to any extent. The results that are produced by the static four tube model that is solved with a 25 µs timestep are given in Appendix B. In the dynamic models the value of the additional reluctances becomes frequency dependent since the value of L depends on frequency. Since the values of the reluctances are directly pro- portional to the inductance values and the inductances decreases with frequency, the reluctances become smaller as the frequency increases. The combination of the decrease of both the inductance and the reluctance actually allows a more accurate model to be identified compared to an equivalent model that has been discretized using the trapezoidal rule of integration. As is mentioned above, the accuracy of a four tube dynamic model that is solved with a 25 µs timestep performs worse when the material is not allowed to saturate to any extent than a dynamic four tube model that is solved with a 50 µs timestep. The reason behind this is a little subtle. As explained above a larger timestep provides a greater cancellation of the effect of the inductances. Thus, for the same amount of damping at the extremums of the input, the response of a model with a larger timestep to a symmetrical input tends to be thinner i.e. encompasses less area in the B–H plane. Additionally, the gain of gz is allowed to be uniformly greater for the 50 µs model compared to the 25 µs model. The combination of these two factors provides a greater apparent attenuation of the fields inside the model of the material for the dynamic four tube model with a 94 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 50 µs timestep compared to the dynamic four tube model with a 25 µs timestep. Note that for these same reasons the response of the 50 µs model is generally worse than the 25 µs model for inputs that saturate the material to some extent. In these cases the attenuation that is provided by the 50 µs model tends to be insufficient. 4.3.2 Graphical Comparison Between a Dynamic and a Static Ten Tube Models The results of a ten tube model that was identified using the procedure in Section 4.2.4 are graph- ically compared to a ten tube model that has its tube resistances statically modified based on the procedure in Section 3.2.2. The dynamic model uses both the R′µk and Rgzk mechanisms for the four outermost tubes of the model. The static model is tuned at 250 Hz for a peak input excitation of 500 A/m. Both of the models are solved with a 25 µs timestep. The following pages show the results for three different levels of input excitation at 60 Hz, 250 Hz, 500 Hz, and 1 kHz. These conditions correspond to the cases that are given in Table 4.1 above. Some of the apparent errors in the response of the models are actually due to the experimental curves being not completely symmetrical. Furthermore, the extremum values of the input excitation are not identical either. This is particularly true of the curves for Hp ≈ 125 A/m. For example, the apparent error in the 60 Hz case is misleading because the experimental curve is heavily skewed and has extremum values that are not identical. In the worst cases, such as the 60 Hz case, the model is excited with a non-symmetrical input that corresponds to the input in the experimental case. Notice that the response of the static model is overly attenuated for the cases with saturation at 500 Hz and 1 kHz. This illustrates the overriding problem with the static circuits. Namely, a single set of parameters for the static model can not, in general, produce a response that matches the frequency response of the actual material over a large range of frequencies and input excitation levels. The gain in accuracy by using the Rgzk mechanism is clearly demonstrated in the shown curves. The errors that are produced by the dynamic model are clearly significantly smaller than the errors that are produced by the static model. Figures B.1 – B.4 in Appendix B show the same sets of curves as below for a dynamic and a static four tube models that are solved with a 50 µs timestep. Some typical variations in time of the circuit inductance values due to the two new mechanisms and the resulting profile of the H field as it penetrates into the material are also shown in Figures B.5 and B.6 in Appendix B. 95 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 .5-1 -0 .500. 51 1. 5 H (A /m ) B (T) ex pe rim en ta l d at a 10 tu be m od el wi th b ot h m ec ha nis m s 10 tu be m od el wi th st at ic ad jus tm en t o nly Figure 4.11: Response of ten tube models for 60 Hz input excitations 96 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 .5-1 -0 .500. 51 1. 5 H (A /m ) B (T) ex pe rim en ta l d at a 10 tu be m od el wi th b ot h m ec ha nis m s 10 tu be m od el wi th st at ic ad jus tm en t o nly Figure 4.12: Response of ten tube models for 250 Hz input excitations 97 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 -0 .500. 51 H (A /m ) B (T) ex pe rim en ta l d at a 10 tu be m od el wi th b ot h m ec ha nis m s 10 tu be m od el wi th st at ic ad jus tm en t o nly Figure 4.13: Response of ten tube models for 500 Hz input excitations 98 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -0 .8 -0 .6 -0 .4 -0 .200. 2 0. 4 0. 6 0. 8 H (A /m ) B (T) ex pe rim en ta l d at a 10 tu be m od el wi th b ot h m ec ha nis m s 10 tu be m od el wi th st at ic ad jus tm en t o nly Figure 4.14: Response of ten tube models for 1 kHz input excitations 99 Chapter 4. New Mechanisms for Circuit-Based Ferromagnetic Models 4.4 Chapter Summary This chapter is primarily concerned with the development of two new mechanisms that form the main contribution of this work. Two other failed approaches are also given to highlight the difficulty in achieving a dynamic variation of the values of the tube resistances that suits the required variation in the resistances that is observed by statically tuning the model. Both of the mechanisms require the derivatives of the circuit mmfs to be determined. The discussion that is presented in this chapter assumes that these derivatives are available. Chapter 5 details how the derivatives are obtained along with providing solutions to the other implementation issues of the proposed model. This chapter gives a procedure for identifying all of the parameters that are required to obtain a new model from the geometry of the material and some experimental sets of data. The procedure assumes that the geometry of the material is simple. A basic guideline for cases when the geometry is not simple is also given. The chapter closes with an analytical study of the effectiveness of the new proposed model followed by a graphical comparison of a model that uses the mechanisms with a static model. The study clearly shows the benefits of using the two newly developed mechanisms over the traditionally used static model. The output curves of the two models further emphasizes the improvement of the newly developed dynamic model over the preexisting static model. 100 Chapter 5 Implementation Issues The discussion up to this point has mostly avoided the issues that pertain to the practical im- plementation of the proposed new modifications to the preexisting ubiquitous basic circuit. The details of the realization of the hysteresis model other than its data structure and the basic circuit itself are also absent. This chapter addresses these concerns along with providing a measure of the computational complexity of the new model. This chapter begins with the implementation of the final circuit starting with the basic circuit. In order to assess the feasibility of using this implementation for the purpose of predicting the posi- tion of the rotor of a SRM, this chapter then concludes with the determination of the computational complexity of the proposed algorithm based on the analysis of the timing of the algorithm. 5.1 An Implementation of the Modified Basic Circuit There are numerous ways that the modified basic circuit can be implemented. The choice of the solution that was ultimately realized is heavily influenced by the goals of this work. One of the stated goals of this work is to produce a model that can be potentially run in real time. The major difficulty with achieving this goal is the model is extremely nonlinear. The seemingly best approach to achieve this goal is to piecewise linearize the relationship between B and H. This allows the circuit to be discretized using an implicit integration technique. The resulting discretized circuit needs to be iterated to find the solution at any given timestep. However, the number of iterations is bounded by the rate of change of the input. Thus, an estimate of the upper bound on the number of iterations can be determined. This is a major advantage over other nonlinear solution techniques since there is no guaranteed way of knowing the required number of iterations for an arbitrary input for these approaches. The justification for these comments is given later in this chapter. The stability of the solution is also of utmost importance especially for applications in which this model is part of an overall control scheme. Again, it is believed that the discretized circuit that utilizes piecewise linearized elements has specific advantages over other available solution techniques. 101 Chapter 5. Implementation Issues 5.1.1 Discretization of the Basic and Modified Basic Circuits The basic circuit that is shown in Figure 3.1 and its modified version are discretized using the backward Euler integration rule. Specifically, the Laplace variable s is approximated by: 1 s ≈ T 1− z−1 (5.1) where T is the timestep of the discretized model and z is the z-domain variable. The backward Euler integration rule is used because it provides additional damping. This tends to dampen out any numerical oscillations that might occur in the response due to changes in the typology of the circuit or the values of its elements. In this case the topology remains fixed, however, the values of the circuit elements can change from one timestep to another. The damping that is provided by the backward Euler rule also has the benefit that it does not distort the resulting waveform. This is seen by examining the phase response of the rule. The phase response of the backward Euler rule is linear. This is similar to digital finite impulse response (FIR) filters. It is an established fact in signal processing that filters with linear phase response do not distort the input waveform [70]. Of the two elements in the (modified) basic circuit only the inductors need to be discretized since the resistors do not vary based on the a time derivative. However, the resistors do vary based on the current values of H and B. The modified hysteresis model that is discussed in Chapter 2 outputs a value of µ and the B-axis intercept Bpv. These values are valid for a certain range of H. Alternately, the H-axis intercept Hpv can be calculated by: Hpv = −Bpv µ (5.2) The use of Bpv or Hpv depends on how the circuit elements are represented in the overall model. The nonlinear resistances in the (modified) basic circuit can be replaced by the circuit representation that is shown in Figure 5.1. F pv Rφ F Figure 5.1: Circuit representation of the circuit elements 102 Chapter 5. Implementation Issues The value of R in Figure 5.1 is equal to lµA . The mmf source Fpv is given by Hpvl = − lBpvµ . As the values of µ and Bpv change the circuit values of R and Fpv need to be updated. The inductances are discretized by first examining their definition: F = d dt ( L φ ) (5.3) The value of L is in general nonlinear. Like the resistances the value of L can be represented by a slope and an intercept. Thus, Equation 5.3 can be rewritten as: F = d dt ( Lmφ+Lpv ) (5.4) where Lm is the slope of the inductance and Lpv is the intercept. Now consider the case in which L (t) )= L (t − T ). Although this condition does not exist in the basic circuit, it does in the modified basic circuit so the following will include this condition. Using the approximation for s in Equation 5.1 for the time derivative in Equation 5.4 yields: F (t) = Lm(t) T φ(t)− Lm(t− T ) T φ(t− T ) + "Lpv T (5.5) where "Lpv = Lpv(t)−Lpv(t− T ). The value of "Lpv can be determined by letting the previous value of the flux be the point where the two lines that represent Lmφ+Lpv at time t and t−T cross. This is shown graphically in Figure 5.2. φ (t T ) Lm(t) Lm(t T ) Lpv (t) Lpv(t T ) φ Lφ Figure 5.2: Determination of "Lpv 103 Chapter 5. Implementation Issues With the aid of Figure 5.2 the value of "Lpv is given by: "Lpv = ( Lm(t− T )−Lm(t) ) φ(t− T ) (5.6) The definition of "Lpv in Equation 5.6 can be substituted into Equation 5.5 to yield: F (t) = Lm(t) T ( φ(t)− φ(t− T )) (5.7) The basic and modified basic circuits can now be completely represented by resistances and mmf sources. Before the techniques for solving this network are given, the practical implementation of the modified hysteresis model and the two new mechanisms is discussed. 5.1.2 Practical Implementation of the Modified Preisach Model Chapter 2 contains the basic information for implementing the Modified Preisach Model. This includes all of the relevant equations that are necessary to calculate the current relationship between B and H. Two data structures are given there that reduce the number of necessary calculations. The details in Chapter 2 are sufficient if the value of H remains fixed during every timestep in the solution of the model. However, the iterative nature of finding the solution for the (modified) basic circuit requires that the algorithm be expanded to include the potential variation of H during the timestep. The required additions to the algorithm can be seen by examining the effect of varying H about the solution of the model (H0, B0) in the previous timestep. Consider three possible branches in the trajectory of the solution that are depicted in Figure 5.3. All other possible branches near (H0, B0) can be handled in a similar way as these three branches. The branch that is shown in Figure 5.3(a) illustrates a change of direction in the trajectory. The branch in Figure 5.3(b) shows the closure of a minor loop within the same segment as (H0, B0) whereas Figure 5.3(c) shows the closure of a minor loop outside of the current segment. Besides being able to determine the necessary changes in the state of the model as the result of taking a new branch, the hysteresis algorithm must also be able to reverse the changes if it is deemed in a later iteration that the new branch should not be taken. In order for the solution of the model to remain stable, the algorithm must guarantee that the final solution of the current timestep lies on either the original branch or one of the many possible new branches. The following discussion is made in reference to the flowchart of the hysteresis algorithm that is shown in Figure 5.4. Note that the notation that is used in the flowchart is for ANSI C e.g. STATE ptr−= 2 is equivalent to STATE ptr = STATE ptr−2. For the case of closing a minor loop, |H| needs to be larger than the end point of the current minor loop and the end point must also lie in the same segment as the current definitions of µ and Bpv. If this is the case then the new branch is automatically taken. Figure 5.3(b) illustrates this 104 Chapter 5. Implementation Issues ( H0,B0 ) (a) branch A ( H0,B0 ) (b) branch B ( H0,B0 ) (c) branch C Figure 5.3: Three possible new branches of the solution near (H0, B0) condition if the current definitions of µ and Bpv are in the same segment as (H0, B0). Notice that if the minor loop closes in a segment that is not the same as the current definitions of µ and Bpv, as is shown in Figure 5.3(c), then the validity of the solution is checked against the endpoint of the current segment not the closure of the minor loop. To ensure that errors due to rounding or quantization do not cause the solution to drift over time, the values of H and B that were stored in the reversal data stack are used to update the new values of µ and Bpv when a minor loop closes. For the case of a potential reversal of the trajectory, the previous solution point (H0, B0) must lie on the same segment that is defined by the current definitions of µ and Bpv. If this is not the case then the change of direction is ignored. As mentioned above, if a temporary solution of H later dictates that the solution does not take a new branch even though previous temporary values of H indicated so then the effects of taking 105 Chapter 5. Implementation Issues Upwards Going Trajectory Already Closed A Minor Loop Change In Direction Reversal Data Stack Not Empty Minor Loop Closure In This Segment Minor Loop Closed H >= Upper Bound H < Lower Bound Reverse Change In Direction Reversal Previously Calculated Start Valid = FALSE Yes No Yes No Toggle value of direction variable Yes j = 29 - i No No i = j Calculate r and C for new branch STATE ptr++ Store H , j, C, r, B on top of reversal data stack n n Reversal calculated = TRUE Calculate µ and B Return Retrieve r and C STATE ptr++ STATE ptr j = 29 - i i = j pv Retrieve r and C Yes Yes No Yes Yes Calculate H* and B* i++ Retrieve r and C Calculate µ and B Return pv No No No Calculate H* and B* i Retrieve r and C Calculate µ and B Return pv Yes Retrieve H* and B* STATE ptr = 2 Retrieve r and C Calculate µ and B Return pv Yes No No Valid = TRUE Return Yes Minor loop closed As the upwards going trajectory except that the formula for the conditional branches are different Figure 5.4: Flowchart for the hysteresis algorithm 106 Chapter 5. Implementation Issues Reversal Data Stack Not Empty Minor Loop Closure In This Segment Minor Loop Closed H >= Upper Bound Yes Yes No No No Calculate H* and B* i Retrieve r and C Calculate µ and B Return pv Yes No Minor loop closed Reverse Minor Loop Closure Minor Loop Already Closed In This Segment Retrieve H* and B* STATE ptr = 2 Retrieve r and C Calculate µ and B Return pv Yes H < Lower Bound Calculate H* and B* i++ Retrieve r and C Calculate µ and B Return pv No No Valid = TRUE Return Yes Calculate H* and B* STATE ptr = 2 Retrieve r and C Calculate µ and B Return pv Yes Valid = TRUE Return No Yes Figure 5.4 cont.: Flowchart for the hysteresis algorithm cont. 107 Chapter 5. Implementation Issues the new branch need to be reversed. The reversal of the effects of taking new branches is performed in the reverse order that the branches were taken i.e. the most recently processed branch is reversed first followed by the next most recent branch, etc. If along any given path a temporary value of H indicates that the solution may exist on the next segment in the current trajectory then the solution is resolved with the values of µ and Bpv for the next segment. Similarly, if a temporary value of H latter falls on a segment before the current segment and (H0, B0) is not located on the current segment then the model is resolved for the values of µ and Bpv for the previous segment. However, if the temporary value of H also indicates that the effects of closing a minor loop needs to be reversed then resolving the model for the previous segment of the new path takes priority over reversing the effects of the path so long as the boundary between the segments falls after the start point of the new branch in the direction of the current trajectory. The handling of the model is slightly different when there are no previous reversals in the trajectory of the model. In this case, the trajectory updated based on the values of µ and Bpv for the limiting first order reversal curve. The closure of minor loops is not checked in this case since the data that the algorithm looks for does not exist i.e the reversal stack is empty. The number of iterations per time step is limited in order to ensure that the solution does not infinitely “bounce” between values at the boundaries of the model such as at the start point of a new branch and the current branch. This may occur due to the effects of rounding or quantization. The maximum number of iterations that is allowed is set high enough that it does not interfere with a legitimate number of iterations for a high frequency high peak value input. If the values of µ and Bpv are not required to be changed then the solution for this instance of the hysteresis model is deemed to be valid. The above rules constitute all of the additional actions that may need to be performed as the solution of the model is iterated. The ANSI C code that realizes the Modified Preisach Model is given in Appendix C. There are two significant variations of this methodology that are required for the practical implementation of this algorithm as part of the overall model that is presented in this thesis. The first variation is particularly relevant to the estimation of the position of the rotor in a SRM. These are given next. 5.1.3 Elimination of Stack Overflow Errors There still remains a disastrous situation that will most likely occur when the practical implemen- tation of the modified Preisach model is implemented as is presented above. Presently, there is no bounds on the amount of memory that is required to store the reversal data. Actual devices have a very finite amount of memory. Thus, if the number of reversals becomes excessive then the reversal stack overflows and the model crashes. This section presents a way of rectifying this 108 Chapter 5. Implementation Issues problem without overly effecting the accuracy of the model. Consider the modification of the trajectory of the material in the H–B plane that is shown in Figure 5.5. 1 2 3 4 Figure 5.5: Modified trajectory of the material Instead of going from the reversal point 4 to the reversal point 3, the trajectory returns to the reversal point 1; thus, ignoring the reversal at point 3. Any further reversals from positive going H to negative going H overwrite the reversal at point 3 because it is no longer needed. The decision on whether a reversal point should be ignored or not is based on how close the two relevant reversal points are in terms of H. If the absolute difference in H is smaller than some value δ then the actual reversal point is ignored in favor of the next reversal point in the same direction. It is important to note that the reversal at 3 is still put on the reversal stack. The closeness of each pair of reversal points is only checked when the trajectory is to return the model to the reversal point that is to be potentially ignored. For instance, if the trajectory from 3 actually returns to 2 then the reversals at 2 and 3 are removed from the stack as before. This approach requires the reversal stack to be split into two separate stacks since the order of a single stack becomes disrupted when reversal points are overwritten in the above fashion. One stack contains the reversals from positive going H to negative going H and the other contains reversals from negative going H to positive going H. Each stack has its own stack pointer to the most recent reversal data. The additional overhead compared to the implementation in the previous section is minor since the algorithm already splits up the handling of positive going and negative going trajectories. The value of δ fixes the maximum number of entries on each stack. For example if δ = 1 A/m then each stack will contain at most 1000 entries if the trajectory of the path starts 109 Chapter 5. Implementation Issues from H = +1000 A/m. Naturally, there is a tradeoff between the accuracy of the model and the amount of memory that is required to store the reversal data. As δ increases the amount of memory that is required decreases but at the expense of the accuracy of the model. 5.1.4 Update of the Modified Preisach Model Based on the Value of B The following discussion is made in reference to the flowchart in Figure 5.6. Upwards Going Trajectory Change In Direction Reversal Data Stack Not Empty Minor Loop Closure In This Segment Minor Loop Closed B >= Upper Bound Start Valid = FALSE Yes No Toggle value of direction variable Yes j = 29 - i i = j Calculate r and C for new branch STATE ptr++ Store H , j, C, r, B on top of reversal data stack n n Calculate µ and B Return pv No Yes Yes No No No Calculate H* and B* i Retrieve r and C Calculate µ and B Return pv Yes Retrieve H* and B* STATE ptr = 2 Retrieve r and C Calculate µ and B Return pv Yes No Valid = TRUE Return As the upwards going trajectory except that the formula for the conditional branches are different Figure 5.6: Flowchart for the hysteresis algorithm based on B As will be explained later, the number of divisions that are required to calculate the output and 110 Chapter 5. Implementation Issues update the state of the model need to be minimized. The newly proposed R′µk mechanism requires an instance of the hysteresis model for every tube that uses it except for the innermost tube. The input to these models is based on an average value of the magnetic field density as opposed to the magnetic field intensity. In order to use the algorithm as presented in the previous section, the estimate of the value of µ would need to be inverted for every iteration of the solution. This is computationally very expensive. Furthermore, the value of B̄ that is used is calculated after the updated state of the overall model is obtained. Thus, the algorithm that is presented above can be greatly simplified since the value of B̄ does not vary as the state of the hysteresis model is iterated. The validity of the solution of the hysteresis model is checked based on values of B instead of the values of H. For example, a closure of a minor loop is detected if the magnitude of B̄ is larger than the magnitude of B at the end of the current minor loop and the minor loop closes in the current segment. This approach is possible since B either increases or decreases monotonically as H increases or decreases. As mentioned above, the value of B̄ remains fixed as the state of the hysteresis model is obtained. As Figure 5.6 shows, this greatly simplifies the algorithm from its original form in Figure 5.4. The ANSI C code that implements this algorithm is given in Appendix C. 5.1.5 Modification of the Basic Circuit The previous sections provide the necessary tools for the implementation of the basic circuit. This section provides the additional details that are required to implement the mechanisms that are presented in Sections 4.2.2 and 4.2.3. Specifically, the derivatives of the mmfs of the circuit and the lookup tables for Λ, Γ, and gz need to be obtained. As was mentioned in Section 4.1, the derivatives of most quantities tend to be quite noisy. The derivatives of the circuit mmfs are no exception. The derivatives are determined in a two step process. First the derivative is calculated by using the backward Euler integration rule that is defined in Equation 5.1. The derivative is then filtered with a lowpass digital filter. An infinite impulse response (IIR) filter was chosen because compared to a FIR filter, the order of an IIR filter is lower for the same amount of attenuation. Thus, the number of calculations that are necessary to compute the current output and the data storage that is required for an IIR filter are lower than an equivalent FIR filter. However, IIR filters can suffer stability problems and their phase response is in general nonlinear. The phase response of the designed filter in the frequency range of interest is almost linear so the phase response was not deemed to be an issue. The poles of the resulting filter need to be checked to ensure that they are not too close to the unit circle in the z-domain. Rounding and quantization errors can cause IIR filters to become unstable if the coefficients of the filter are inappropriately selected. A second order maximally flat filter was designed to filter the generated derivatives. A cutoff frequency is set to be 5 kHz. This ensures that the filter does not overly affect the frequencies of 111 Chapter 5. Implementation Issues interest. The transfer function of this filter is given by: fLP (z) = Kz−1(1− z−1) 1 + a1z−1 + a2z−2 (5.8) The block diagram of the minimal realization of the filter is shown in Figure 5.7 below. The parameters of the filter are tabulated in Table 5.1 for two timesteps. The filter is primarily used to filter the noise that occurs for high frequency excitations. As a result, the noise that is generated at lower frequencies is mostly unaffected by the filter. This does not pose a significant problem because the effect of the noise at lower frequencies is far less than at higher frequencies. 2K 0.5 a z-1 1 a2 0.5 z-1 yx Figure 5.7: Minimal realization of the IIR filter Table 5.1: Parameters of the IIR filter Parameter Value T = 25µs T = 50µs K +0.3636759 +0.9151538 a1 −0.9653129 −0.1895345 a2 +0.3289887 +0.1046883 The lookup tables for Λ and Γ are relatively easy to implement. The values between the data points are linearly interpolated. In order to speed up the execution of the lookup table, the previous 112 Chapter 5. Implementation Issues region for the past value of Ḟ can be stored as a start point in the search for the region of the present value of Ḟ . The lookup table for gz is more challenging to implement. The values of the function of gz could be resampled in a grid with fixed cell sizes in order to simplify the implementation of the lookup table. However, the extreme variation of the slope requires a very fine mesh. This can greatly increase the time that is required to search for the correct region of the current values of H and B. Furthermore, anomalies can be potentially present in the resampled curve. This issues are avoided if the data that defines gz is not changed. Consider a typical cell that is present in the definition of gz that is depicted in Figure 5.8 below. H B (H2 ,B2H,h (H ,B, BH BL 2H) (H2 ,B2L ,h2L ) (H1 ,B1H,h1H) (H1 ,B1L ,h1L ) gz) Figure 5.8: A typical cell in the definition of gz The value of gz at (H,B) can be determined by first defining the following ratios based on the values at the corners of the cell: rH = √ (BL −B1L)2 + (H −H1)2√ (B2L −B1L)2 + (H2 −H1)2 = H −H1 H2 −H1 (5.9) and rB = B −BL BH −BL (5.10) where BL and BH are obtained by storing the slopes and B-intercepts of the data e.g. BL = 113 Chapter 5. Implementation Issues µH + Bpv. How the data is stored and looked up is discussed next. Given the definitions of rH and rB, the height of the function gz can be obtained by: gz(H,B) = (hH − hL)rB + hL (5.11) where hH = (h2H − h1H)rH + h1H (5.12) hL = (h2L − h1L)rH + h1L (5.13) The values of h2h, h1H , etc. need to be stored in a very specific order. The required order is the result of how the current cell is found. For a given (H,B) the correct cell is determined with the use of two lookup tables: one for the values of µ and the other for the B-intercepts Bpv. The data is stored with the format that is given in Table 5.2. Note that fm(n) is either µ(m,n) or Bpv(m,n). Table 5.2: Data structure for µ and Bpv 1 2 3 Bindex · · · 13 14 15 −125 f1(1) f1(2) f1(3) ... ... ... ... . . . Hindex ... ... ... fm(n) . . . −25 f7(1) f7(2) f7(3) · · · · · · f7(13) f7(14) f7(15) 0 f8(1) f8(2) f8(3) · · · · · · f8(13) f8(14) f8(15) ... ... ... ... . . . . . . ... ... ... ... . . . +100 f14(1) f14(2) f14(3) The correct cell is found but first finding the index for H. The index for B is determined by comparing B to the values of the magnetic field on the boundaries of the potential cell as shown in Figure 5.8 as BL and BH . The index is incremented by one if B ! BH and decremented by one if B < BL. For cases in which either the index for B or the index for H falls outside of the bounds of the tables for µ and Bpv then gz(H,B) = 1. With the indices determined the ratios rH and rB can be calculated. 114 Chapter 5. Implementation Issues Similar to the lookup tables for Λ and Γ for the region of Ḟ , the indices for H and B can be stored from the previous timestep as a start point. While this does not pose a problem for determining the index for H, care must be taken for determining the index for B. If the index for H changes from the previous timestep then it is possible that using the index for B from the previous timestep will not result in finding the correct region. This is the case if the starting index for B is too large for the new index of H. Thus, the previous index for B is checked first for the new index of H and if the index for B is too large then it is set to a predetermined maximum value for that given index of H. The values of gz at the corners of the cells are stored similarly to µ and Bpv except that the data for the top and bottom boundaries are stored together. This is required because the shapes of all of the cells do not have four sides. In particular, the cells that are adjacent to the initial magnetization curve only have three sides. Although the search mechanism that utilizes tables for µ and Bpv can find the correct cell, it can not distinguish between a cell that has four sides or three sides. To mitigate this problem the data for the corners that lie on the initial magnetization curve is repeated three times. For example, consider the two cases that are shown in Figure 5.9. H1 H2 n n n 1 1 n 1 n n 1} (a) H1 < 0 H2H1 n n n 1 1 n 1 n n 1 } (b) H2 > 0 Figure 5.9: Three sided cells near the initial magnetization curve For the case shown in Figure 5.9(a) the values of gz for H1 are the same for n− 1, n, and n+1 since they all describe the same point. Similarly, for the case in Figure 5.9(b), the values of gz for H2 are the same for n − 1, n, and n + 1. The remaining values of gz in both cases are in general different. The table that stores the corner values of gz is constructed with double the number of rows as the tables for µ and Bpv. The row index for the table of stored h-values (values of gz at the corners of the cells) is given by 2m− 1. This row corresponds to the values of h for H1. The value of the column index that corresponds to the lower boundary of the cell that contains (H,B) in Figure 5.8 is equal to n. Given its similarity to the tables for µ and Bpv, the table of h-values is not shown herein. With the values stored at h(2m− 1, n), h(2m− 1, n+1), etc. the value of gz(H,B) can be determined. 115 Chapter 5. Implementation Issues In order to minimize the number of divisions that are required, the denominator for Equation 5.9 is inverted beforehand and stored as a array. Likewise, Equations 5.9 – 5.13 are lumped together so that only one devision is made after the resulting numerator and denominator is computed. The benefit for doing this is described later. The resulting ANSI C code that was written for the implementation of the lookup tables can be found in Appendix C as part of the determination of the scaling factor for the tube resistances. 5.1.6 Putting it All Together The preceding sections give the basic building blocks that are necessary to represent the modified basic circuit in its digital form. However, the discussion as yet has not made any reference to how the overall model is solved. An approach that can be used to iteratively solve the model is detailed here. Ideally, solving the circuit should not require several iterations to find the solution. It was found that it is most likely impossible to solve the circuit without resorting to resolving the equations until all of the constraints on the circuit values are met. Even with a timestep of 1 µs, the model still did not remain stable when no iterations were performed. Unfortunately, iteratively solving the model makes it difficult to guarantee that the algorithm can perform in realtime. The best that can be done for an iterative approach is to calculate a theoretical upper bound on the number of iterations. A hybrid approach that allows the solution to iterate but then limits the total number of iterations per timestep to a predetermined number could be used. In this approach, if the limit is reached then the most recent solution is used as the output of the current timestep. In fact, as described above, it is this approach that is implemented since the maximum number of iterations is limited to avoid the solution infinitely “bouncing” between two values. In the implementation that is presented in this work, the Rµk and Rgz mechanisms are only allowed to modify the values of the circuit resistances at the beginning of the current timestep. Both of the mechanisms could be allowed to vary the values of resistances during the iterations of the solution. However, the improvement in the output of the model is negligible compared to the computational effort that is required to produce the output. Thus, the limitation of only allowing the values to change at the beginning of the timestep is imposed on the implementation that is given here. The first step in the formulation of the solution is to write the circuit equations in matrix form i.e. the circuit values can be expressed in the following form: [ F ] = [ Z ][ φ ] (5.14) The values for F , Z, and φ in Equation 5.14 are obtained by systematically deriving the equations of the discretized basic circuit using Kirchhoff’s voltage law i.e. the mmf drops around 116 Chapter 5. Implementation Issues the paths that are taken by φ1, φ2, . . . , φn are equated to zero. A set of n equations can, therefore, be written. Consider the specific case of a three tube model that has been discretized as shown in Figure 5.10 below. R 2 R 1 R 3 φ 3 φ 1 φ 2 T F Lm1 T Lm2 T Lm3FR3 FR1 FR2 FL 2 FL 1 FL 3 Figure 5.10: Discretized three tube model Using the variables that are given in Figure 5.10, the resulting system of equations can be written as: FR2 −FR1 −FL 1 FR3 −FR2 −FL 2 F −FR3 −FL 3 = R1 +R2 + Lm1 T −R2 0 −R2 R2 +R3 + Lm2 T −R3 0 −R3 R3 + Lm3 T φ1 φ2 φ3 (5.15) The system of equations in Equation 5.15 assumes that F is known. If φ3 is known, such as in the case of the determination of the position of the rotor of a SRM, or the magnetic equivalent circuit is part of a larger electric equivalent circuit then the systems of equations needs to be reformulated. For instance, in the latter case, F is replaced by: F = Nl Rw ( v(t)−N φ3(t)− φ3(t− T ) T ) (5.16) where v(t) is the externally applied voltage, N is the number of turns of the coil that couples the 117 Chapter 5. Implementation Issues electric circuit to the magnetic circuit, and Rw is the winding resistance of the coil. In all of these cases the procedure for solving the Equation 5.14 or its equivalent remains the same. One thing that became very clear with the formulation of the circuit in this way is the values of µ for the tubes need to be inverted every time that they change value. This is because the reluctances of the circuits are inversely proportional to µ as given in Equation 3.16. Divisions take significantly more time to compute than multiplications. This holds true from both general purpose CPUs or DSPs. The solution of the circuit in this manner requires potentially many divisions per iteration of the solution. The number of divisions that are required per iteration is greatly reduced if the circuit that is shown in Figure 5.10 is represented using Norton equivalents instead of Thévenin equivalents i.e the series mmf sources and reluctances can be transformed into equivalent flux sources and reluctances in parallel. The result of doing this for a three tube model is shown in Figure 5.11. The values of φR1, φR2, etc. are given by −BpvA where Bpv corresponds to the B pivot point of the appropriate hysteresis model. Similarly, the values of φL 1, φL 2 , etc. are given by −φ1(t− T ), −φ2(t− T ), etc. respectively. The circuit shown in Figure 5.11 is solved using Kirchhoff’s current law i.e. the fluxes entering each node of the circuit must add up to zero. The resulting system of equations that correspond to the three tube circuit that is shown in Figure 5.11 can be written as: φR1 − φL 1 φR2 − φL 2 + φL 1 − φR1 − φR2 − φR3 − φ3 = − 1 R1 − T Lm1 T Lm2 1 R1 T Lm2 − 1 R2 − T Lm1 − T Lm2 1 R2 1 R1 1 R2 − 1 R1 − 1 R2 − 1 R3 F1 F2 F3 (5.17) where: φ3 = T Lm3 ( F −F3 ) (5.18) Note that it is written in this way because for the determination of the position of the rotor of a SRM, the flux is known instead of the total mmf. Equation 5.17 can be solved first to determine F3. F can then be computed from Equation 5.18 once F3 is known. Like the circuit in Figure 5.10 that uses Thévenin equivalents, Equation 5.17 can be reformulated based on what inputs are known. Examining Equation 5.17 reveals that it is written in the form:[ φ ] = [ G ][ F ] (5.19) 118 Chapter 5. Implementation Issues R 2 R 1 R 3 φ T F Lm1 T Lm2 T Lm3 R3 F L 3 3 F 1 F 2 φ φR1 φR2 L 2φ L 1φ TLm3φ3 Figure 5.11: Norton equivalent discretized three tube model For the discussion that follows, the matrix G refers to a matrix of the form given in Equation 5.17. Notice that the reluctances in the G matrix are inverted. Thus, the values of µ that are obtained from the hysteresis model do not need to be inverted. The values of the circuit “inductances” can be calculated such that they are already inverted. However, the matrix G itself still needs to be inverted. For matrices of low order it is generally more efficient to determine the form of the inverse and calculate the coefficients of the inverse directly. The inverse of the matrix G can be obtained by: G−1 = 1 det(G) adj(G) (5.20) 119 Chapter 5. Implementation Issues where: det(G) and adj(G) are the determinant and adjoint of the matrix G respectively. For the example of the three tube model, the adjoint of G is given by: adj(G) = a11 a12 a13a21 a22 a23 a31 a32 a33 (5.21) where: a11 = ( 1 R2 + T Lm1 + T Lm2 )( 1 R1 + 1 R2 + 1 R3 ) − 1 R22 a12 = 1 R1 1 R2 + T Lm2 ( 1 R1 + 1 R2 + 1 R3 ) a13 = 1 R2 T Lm2 + 1 R1 ( 1 R2 + T Lm1 + T Lm2 ) a21 = a12 a22 = ( 1 R1 + 1 R2 + 1 R3 )( 1 R1 + T Lm1 ) − 1 R21 a23 = 1 R1 T Lm2 + 1 R2 ( 1 R1 + T Lm1 ) a31 = a13 a32 = a23 a33 = ( 1 R1 + T Lm1 )( 1 R2 + T Lm1 + T Lm2 ) − T 2 L 2m2 while the determinant of G is: det(G) = − ( 1 R1 + T Lm1 ) a11 + T Lm2 a21 − 1R1a31 (5.22) Notice that the G matrix is symmetrical. As a result, its inverse is also symmetrical. The impli- cation of this is some of the entries of the inverse are repeated and do not need to be recomputed. If any of the parameters of the tubes change then the adjoint and determinant of G need to be recalculated. Additionally, the column vector of fluxes also needs to be updated as the parameters of the tubes change. As mentioned above the solution is iterated until the solution is bounded for the current defi- nitions of the reluctances of the tubes or the number of iterations hits a predefined limit. The flow of the overall algorithm that was implemented is shown in Figure 5.12. 120 Chapter 5. Implementation Issues Initialize turning point history of hysteresis models Initialize all other variables Get new value of input flux Calculate the new values of the model inductances iterations = 0 changed = TRUE Model Output Is Valid iterations++ changed = FALSE Calculate the terms of the adjoint of the G matrix Calculate 1 Calculate the flux column vector Hysteresis Model Is Valid Update tube reluctance changed = TRUE iterations = 15 changed = FALSE Value Of µ Is Valid k′ Update hysteresis model of µ k′ Calculate output F of the model det[ ] Yes No Repeat the items in the dashed box for the other tubes Yes No No Yes No Yes Store state of model Calculate derivatives of circuit mmfs Filter derivatives of circuit mmfs G Calculate H of the outermost flux tube Update the state of the hysteresis model of the outermost flux tube Figure 5.12: Main flowchart for the implemented model 121 Chapter 5. Implementation Issues The flowchart for the main function is given for the case that is used for determining the position of the rotor of a SRM i.e. for each instance of model, the total flux is known and the mmf drop across the element of material needs to be determined. The ANSI C code for the main function of the algorithm is given in Appendix C. 5.2 Solution Convergence, Stability, and Computation Time This section details some of the issues that are associated with the realtime implementation of the model that is presented in this work. With the exception of the computation time, these issues are only tersely addressed due to their complexity. 5.2.1 Solution Convergence The convergence of the solution in every timestep is required. If at any timestep the solution fails to converge then the model fails. As a result, it is important that the convergence of the solution is guaranteed. For this reason the methodology for solving the model was chosen. Unfortunately, it is difficult to rigorously prove the convergence of the model that is proposed in this work. After the software code was fully debugged, the solution always converged at every timestep. The author of this work believes that the convergence of the solution at every timestep is ensured by the shape of the relationship between H and B in the hysteresis model. An increase in H always produces an increase in B. Likewise, a decrease in H always produces a decrease in B. The implication of these trends is the slope of the relationship between H and B is always positive; thus, the reluctance of the tubes is always positive. Note that this is distinct from the relationship between the value of H on the surface of the material and the average value of B in the material. As is seen in Chapter 4, the slope can be negative for this case. Similar to the circuit reluctances the circuit “inductances” are always positive. Consequently, there are no local minima or maxima in the relationship between F and φ for any of the circuit elements. A local minima or maxima can cause the solution to not converge as is shown in the fictitious example below. Consider the iterative solution at one timestep for a two tube model below. In the figures that are presented below the bold lines in the definitions of the tube reluctances indicate the current segment that is being used to solve the circuit. Also the “inductance” of the innermost tube that is given by the 0.5 A-t/Wb resistor and 5 A-t mmf source remains fixed throughout the iterative process – as it is in the actual implementation of the model. The input to the circuit is the total flux of 15 Wb. In the first iteration of the solution of the model, the values of φ1 and φ2 can determined by solving the circuit in Figure 5.13(c). This results in φ1 = 5 Wb and φ2 = 10 Wb. 122 Chapter 5. Implementation Issues F φ 12 0.5 0.25 0.25 (a) Tube 1 reluctance definition F φ 29.75 19.5 1 1 0 (b) Tube 2 reluctance definition φ 2 φ 1 0.50.5 5 115 (c) Circuit diagram Figure 5.13: Iteration 1 F φ 12 0.5 0.25 0.25 (a) Tube 1 reluctance definition F φ 29.75 19.5 1 1 0 (b) Tube 2 reluctance definition φ 2 φ 1 0.50.25 0.25 5 115 (c) Circuit diagram Figure 5.14: Iteration 2 123 Chapter 5. Implementation Issues F φ 12 0.5 0.25 0.25 (a) Tube 1 reluctance definition F φ 29.75 19.5 1 1 0 (b) Tube 2 reluctance definition φ 2 φ 1 0.50.25 0.25 5 115 19.5 (c) Circuit diagram Figure 5.15: Iteration 3 As can be seen by the definitions of the tube reluctances in Figures 5.13(a) and 5.13(b), the current segment that is being used for the innermost tube is incorrect whereas the current segment for the outermost tube is correct. The correct definition for the innermost tube reluctance is then used in the second iteration. The circuit in Figure 5.14(c) is then solved to obtain new values of circuit fluxes φ1 = 5.43 Wb and φ2 = 9.57 Wb. Notice that the value of φ1 increases whereas φ2 decreases. The values of the circuit fluxes follow a “waterbed” effect – the increase of one value comes at the expense of the decrease in other values. The solution of the second iteration results in the definition of the outermost tube being violated. Thus, the circuit needs to be resolved for the correct definition of the reluctance of the outermost tube. Solving the circuit in Figure 5.15(c) yields φ1 = 4 Wb and φ2 = 11 Wb. This indicates that the definition of the reluctance of the outermost tube should be the one that is used in the second iteration. However, the solution of the previous iteration indicates that the current definition should be used. Since there is no way of rectifying this problem, the solution of the model fails to converge. The solution of this simple two tube circuit illustrates the problem with local extremum. In this case, a local minima exists at φ1 = 9.75 Wb. This condition can never occur in the solution of the real model because local minima and maxima do not exist in the space that defines the solution of the model. However, as is discussed above, care needs to be taken in the practical implementation of the model to ensure that quantization and rounding errors do not cause the solution to “bounce” 124 Chapter 5. Implementation Issues between two solution points as is shown in the example above. 5.2.2 Solution Stability Besides converging at every timestep, the solution of the model must remain stable. Most of control theory deals with linear time invariant (LTI) systems. Clearly the model that is presented in this work is not a LTI system. Therefore, it is more difficult to analytically prove the stability of the model. The stability analysis is further complicated by the fact that the pivot points (Hpv or Bpv) of the tube reluctances need to be modeled as inputs since their values do not solely depend on the previous states of the model. Unfortunately, this necessitates the use of multivariable control theory. In this case, the resulting model for stability analysis is a multiple input, single output (MISO) system. A MISO system is a specific instance of a multiple input, multiple output (MIMO) system. Generally, the stability analysis of MIMO systems is more involved compared to single input, single output (SISO) systems. As was mentioned above, the actual analysis of the stability was not performed in this work. However, the framework for the analysis is given below. Using of a set of nodal or loop equations as given in Equations 5.14 or 5.19 is an efficient way of solving the model; however, they are not convenient for determining the stability of the model. The stability is better determined with a state space model of the system. In this case, a discrete state space representation of the modified basic circuit can be obtained. A linear time varying discrete state space system is characterized by the following equations: x(k + 1) = Ψ(k)x(k) +∆(k)u(k) (5.23) y(k) = C(k)x(k) + D(k)u(k) (5.24) where x(k) is a n row state column vector y(k) is a m row output column vector u(k) is a r row input column vector Ψ(k) is a n× n state matrix ∆(k) is a n× r input matrix C(k) is a m× n output matrix D(k) is a m× r direct transmission matrix There are an infinite number of possible state space representations for any system since the choice of states for the state vector x(k) do not necessarily need to correspond to the physical states of the system. However, there are disadvantages to choosing states with no physical meaning. In 125 Chapter 5. Implementation Issues this case, the natural choice of the states are the values of φ1, φ2, . . . , φn from the previous timestep. The chosen states physically represent the past history of the circuit “inductors”. As with the circuit representation above, the values of Ψ(k), ∆(k), C(k), and D(k) depend on the validity of the states in the next timestep. Thus, if this state space representation is used to solve the circuit then the solution needs to be iterated until the calculated next states are valid. With the above comments in mind, the equivalent state space representation of a n tube circuit is given by: φ1(t) ... ... φn(t) = Ψ11 · · · · · · Ψ1n ... . . . ... ... . . . ... Ψn1 · · · · · · Ψnn φ1(t− T ) ... ... φn(t− T ) + ∆11 · · · · · · ∆1n+1 ... . . . ... ... . . . ... ∆n1 · · · · · · ∆nn+1 F (t) FR1 ... FRn (5.25) φn(t) = [ Ψn1 · · · · · · Ψnn ] φ1(t− T ) ... ... φn(t− T ) + [ ∆n1 · · · · · · ∆nn+1 ] F (t) FR1 ... FRn (5.26) Equations 5.25 and 5.26 assume that the input mmf F is known. If φn or the voltage of the coil that is driving the magnetic system is known instead then F becomes one the states of the x(k) vector. The output of the model then would likely become F as well. The state space system that is described in Equations 5.25 and 5.26 can be used to determine the stability of the model. However, the values of the Ψ and ∆ matrices depend on the trajectory of the input F and the pivot points of the tube reluctances. For a given periodic input it is possible to track the movement of the gains of the system. However, it is important to note that the since the proposed model is not a SISO system, the values of the gains have an associated input direction vector as well. If the time dependent gains of a set of periodic inputs are determined then any input that is bounded by this set of periodic inputs has bounded gains. In this way the stability of the model can be predicted for a range of periodic inputs. Fortunately, most real world electromagnetic systems are excited by periodic inputs; thus, a good measure of the stability can be determined. This determination is left for future work One point that has been overlooked thus far is the effect of the coupling between the total flux and total mmf. Equation 5.18 shows the relationship for a three tube system. It was found that if the total mmf is used as input then the total flux is smooth. However, if the total flux is used as the input then the output periodically rings. This is due to the coupling of the input and output by the Lmn inductance. The ringing can be significantly reduced if the rate of change of the mmf that is 126 Chapter 5. Implementation Issues used for the Lmn inductance value is the nth layer mmf and not the output mmf. The output can ring because the input is infinitely stiff; thus, any numerical ringing is directly seen on the output if the circuit can not absorb it. If the input is significantly decoupled from the output then the output will not ring. This can be the case in circuits that are driven by a voltage source. In this case the input flux is the integral of the coil voltage minus the product of the coil resistance and current. As long as there is enough resistance between the stiff voltage source and the coil current then the output mmf (coil current) will not ring. In any case, this “issue” does not diminish the applicability of the model that is developed in this work – only that care must be taken on how the model is implemented as part of a larger model. 5.2.3 Solution Complexity The whole direction for the choice of the implementation that is presented in this chapter is based on the need for the proposed model to be solved in realtime. This section provides the analysis that was performed to determine whether or not it is likely that the model can be used as part of the position estimation algorithm for a SRM that is presented in Chapter 1. Consider the multiphase lumped parameter model of a 6/4 SRM that is given in Figure 1.2. Due to the symmetry of the model only half of the circuit actually needs to be solved. Therefore, twelve position independent instances of the proposed model need to be solved every timestep. The timing for position dependent instances of the proposed model are more difficult to determine since the models would potentially need to be resolved several times before the position is determined. Furthermore, errors in the position from previous timesteps may cause the position estimate to oscillate. These issues can be avoided if the stator and rotor pole tips are modeled with time independent lumped reluctances. The loss in accuracy is likely to be far outweighed by the gain in solution speed and the avoidance of oscillations in the predicted rotor position. This analysis assumes that this choice is taken. As is mentioned throughout this chapter, the implementation that is given in this chapter was coded in ANSI C. It is this code that was used to time one instance of the model. The input flux to the model is a triangular waveform that generates a peak value of H that roughly corresponds to the cases in the previous chapter with Hp = 1000 A/m. The flux varies from zero to its peak value with a frequency of 1kHz. A triangular waveform was chosen because the flux varies in this manner in the poles of the machine if the leakage flux paths are ignored. The flux in the backplane of the stator and the body of the rotor follows a more complicated waveform. However, the rate of change of the flux in these parts of the machine is no more than in the poles. Thus, the triangular waveform gives a good indicator of the numerical complexity of the proposed model for a sensorless SRM application. The flux waveform would generate a rotation speed of 10,000 rpm in a 6/4 SRM. It is important to note that the timing is ultimately dependent on the rate of change of the mmfs in the model. A higher rate of change requires more iterations of the hysteresis models; therefore, 127 Chapter 5. Implementation Issues the time required to find the solution of the model increases as the rate of change increases. The timing analysis was done on a 1.8 GHz Pentium 4 desktop computer. The model was solved for 10,000 timesteps in order to improve the accuracy of the timing. The ANSI C code that was used to measure the time to solve the model is given in Appendix B. The average time to solve the model was found to be 1.3 µs per instance of the proposed model when the above described input flux waveform was used. Therefore, the average total time to calculate the twelve position independent instances of the proposed model is 15.6 µs. If the algorithm was solved with a 50 µs timestep then only 31% of the available time is being used. If a 25 µs timestep is used then 62% of the available time is used. For both timesteps there is a large margin available to make the necessary calculations and table lookups to determine an estimate of the position. The margins are likely to improve if the algorithm is optimized on a DSP processor. The maximum speed of the machine dictates the timestep that is required to solve the model. In order to minimize the error that is introduced by discretizing the flux waveform, at minimum of 10 samples per period are required [69]. In the case of a 1kHz waveform this corresponds to a minimum timestep of 100 µs. Thus, the model that is solved with a 50 µs timestep is suitable for 6/4 SRMs with rotation speeds up to 20,000 rpm. Similarly, a 25 µs solution timestep is likely to be able to sufficiently model a 6/4 SRM with rotation speeds up to 40,000 rpm. The above timing analysis strongly indicates that it is feasible to use the model that is proposed in this work as part of the multi-phase lumped parameter model for the purpose of determining the position of the rotor of a SRM. 5.3 Chapter Summary This chapter details a specific implementation of the model that is proposed in this work. The implementation of the model has definite advantages over other similar approaches. The piece- wise linearization of the relationship between H and B in the modified Preisach hysteresis model coupled with discretization of the circuit elements of the model with the Backward Euler integra- tion rule provides an upper bound on the number of the iterations that are required per timestep. Consequently, a solid measure of the numerical complexity of the model can be determined. The practical considerations of implementing the Modified Preisach model is given in this chap- ter. This includes a new method for ensuring that the stack that contains the reversal data does not overflow. Flowcharts are also given to illustrate how the integrity of hysteresis model is maintained as the input H is varied within a given timestep as the overall model is iterated. The details of the implementation of the lookup tables is given in this chapter. In particular, the details for the structure and lookup of the 2D table for the Rgzk mechanism are given since its implementation is not trivial. The determination of the rate of change of the circuit mmfs is also given. A simple numerical differentiator is used in conjunction with a low order IIR filter to 128 Chapter 5. Implementation Issues produce the derivatives of the mmfs. As is described in this chapter, a Norton equivalent circuit is used to represent the overall model. The circuit equations that result contain the minimum number of divisions that are required to solve for the circuit mmfs. This is advantageous because divisions are very expensive to compute. This chapter closes with a discussion on the proposed model’s convergency, stability, and com- putation complexity. The convergence and stability of the model were only tersely examined; therefore, further work needs to be done in these areas. The numerical complexity of the model was explored with a specific case. The results of this case strongly indicate that the proposed model is suitable for use as part of the multi-phase lumped parameter model that is used to determine the position of the rotor of a SRM. 129 Chapter 6 Conclusions and Future Work As is stated in the beginning of Chapter 1 the purpose of this work was to develop a ferromagnetic model that has certain specific features. These features are determined by the need to model the behaviour of the stator and rotor of a switched reluctance machine for either the offline simulation of the machine or for the online determination of the position of the rotor. Given the requirements of the intended application of this model, the desirable features for the model are: • accurate over a wide range of input frequencies and saturation levels of the material; • only requires to be initially tuned — thereafter the parameters of the model remain fixed; • can be potentially used in realtime. As the results at the end of Chapter 4 show, the first point is achieved. The model’s performance is shown to be sufficiently accurate over both a wide range of frequencies and saturation levels of the material. Furthermore, the performance of the model is achieved without resorting to retuning the model as is required by the second point. The newly proposed model was compared to a model that was tuned for a specific input waveform with the use of a normalized vertical least-squares metric. The results clearly show that the proposed model outperforms a model that has static tube resistances. The last point is addressed in Chapter 5. The solution any model that is to be used in realtime is required to converge at every timestep, remain stable, and be computed predictably within a fixed time frame. These constraints motivated the choice of the implementation that is given in Chapter 5. Unfortunately, the highly non-linear nature of the relationship between H and B in the hysteresis model requires the solution to be iterated at every timestep. The backward Euler integration rule coupled with the piecewise linearization of the relationship between H and B does theoretically allow the solution to be solved in one iteration. However, testing of the hysteresis algorithm showed that no reasonable value of the timestep produced a solution that is stable. Requiring iteration does not overly diminish the appeal of the presented implementation since the author of this work believes that the solution is guaranteed to converge at every timestep and remain stable. Furthermore, an upper bound on the number of iterations can be predicted to ensure that the realtime operation of the model can be maintained. Chapter 5 contains the starting point for assessing the convergence and stability of the model with the presented implementation. Further work is required to formally prove the author’s belief. The time complexity of the algorithm was 130 Chapter 6. Conclusions and Future Work explored by coding the model in ANSI C. One instance of the model for a 1 kHz triangular input flux took on average 1.3 µs per timestep to compute on a 1.8 GHz PC computer. This result shows that the proposed model will most likely be feasible for use as part of the multi-phase lumped parameter model for the prediction of the position of the rotor of a SRM. 6.1 Contributions The academic contributions that are produced as the result of this work are spread throughout this thesis. This section summarizes these contributions. Specifically, the contributions that the author of this work considers to be significant are: 1. the piecewise linearized implementation of the modified Preisach model including: i. basic implementation details (Chapter 2) ii. modification of the basic implementation that can account for the variation of H as the solution iterates during a single timestep (Chapter 5) iii. modification to the basic model that prevents stack overflows (Chapter 5) iv. modification to the basic model that uses B instead of H to check whether the solution of the model is valid or not (Chapter 5) 2. the proposed structure for the flux tubes of the model (Chapter 3); 3. the method for systematically adjusting the values of the calculated DC resistances of the flux tubes in order to fit the response of the model to the response of the actual material (Chapter 3); 4. the first (R′µk) mechanism that dynamically adjusts the values of the tube resistances in order to allow for a large range of frequencies and for a large range of input magnitudes that cause the material to saturate to some extent (Chapter 4); 5. the second (Rgzk) mechanism that dynamically adjusts the values of the tube resistances for cases in which the material is not allowed to saturate to any extent (Chapter 4); 6. the systematic procedure for obtaining the lookup tables for the two mechanisms that are proposed in this work from experimentally obtained data (Chapter 4); 7. the implementation details of the model besides the hysteresis model including: i. discretization of the tube “inductances” that allows the value of the inductance to vary at any time during the solution of the model (Chapter 5) ii. the implementation of the lookup table for the Rgzk mechanism (Chapter 5) 131 Chapter 6. Conclusions and Future Work iii. the determination of the derivatives of the circuit mmfs with the use of a basic differen- tiator followed by a IIR filter (Chapter 5) iv. use of a Norton equivalent circuit for the minimization of the number of divisions in the computation of the solution (Chapter 5) 8. the analysis of the accuracy of the proposed model with the use of a normalized vertical least-squares metric (Chapter 4); 9. the timing analysis of the overall implementation with the use of ANSI C code running on a standard PC computer (Chapter 5). The resulting model that is the product of this work is the first, albeit major, step in the development of a class of models that can be used as part of the multi-phase lumped parameter model that describes a switched reluctance machine. 6.2 Future Work The continuation of the work that is presented in this work has many potential avenues for future work. Some of the more promising future endeavours that can be pursued are given below. One of the more critical areas that needs to be addressed is how do the parameters of the model change as the geometry of the material changes. If the parameters can be shown to change in a predictable way then the model could be used as part of an optimization program for the design of devices such as SRMs or fast acting solenoids. Furthermore, it would lessen the burden of experimentally testing different shapes of the material after the trends are determined. The implementation of the model in the context of sensorless control of a SRM can be further explored. As was mentioned in Chapter 5, the mmf drop of each section of the core can be calculated separately in the multi-phase lumped parameter model for a SRM. Once the mmf drop of a given section is known then it does not need to be recalculated. The only potential exception to this is the position dependent pole tips in the stator and rotor. The solution of the pole tips along with the linear airgaps could be iterated until the incremental position that minimizes the error between the calculated mmf drop due to the position independent reluctances and the mmf generated by the pole tips and airgap at is found. However, this approach has two drawbacks; namely, it would add significant time to the overall computational time of the model and it would also potentially introduce oscillations in the predicted position of the rotor. As an alternative, it was proposed in Chapter 5 that the tip reluctances be modeled with the time independent flux tubes. A tradeoff study between the two approaches needs to be undertaken to determine the best approach. The model needs to be checked for grain orientated materials. One of the major differences between non-oriented and oriented materials is oriented materials lack of domain rotation in the preferred direction of magnetization. The other is the permeability of the material depends on the 132 Chapter 6. Conclusions and Future Work orientation of the magnetic field. The incorporation of a vector based Preisach hysteresis model could be used to model the orientation of the material. However, it is unclear how this would affect the definitions of the lookup tables for the two mechanisms that are proposed in this work. Finally, as is mentioned above and in Chapter 5, the proof of the stability of the model that is proposed in this work along with the proof that the solution is guaranteed to converge need to be generated. It is likely that the framework that is given in Chapter 5 can be the start point in this investigation. 133 Bibliography [1] Longya Xu and Chuanyang Wang. Accurate rotor position detection and sensorless control of SRM for super-high speed operation. In IEEE Transactions on Power Electronics, volume 17, pages 757–763, 2002. [2] Chris S. Edrington and Ray B. Sepe Jr. Sensorless super-high-speed switched reluctance generators. In IECON 02, volume 2, pages 1026–1031, 2002. [3] Babak Fahimi, Ali Emadi, and Raymond B. Sepe Jr. Four-quadrant position sensorless control in SRM drives over the entire speed range. In IEEE Transactions on Power Electronics, volume 20, pages 154–163, 2005. [4] Debiprasad Panda and V. Ramanarayanan. Accurate position estimation in switched re- luctance motor with smooth starting. In Proceedings of IEEE International Conference on Industrial Technology, volume 1, pages 388 –393, 2000. [5] Debiprasad Panda and V. Ramanarayanan. An accurate position estimation method for switched reluctance motor drive. In Proceedings of I998 International Conference on Power Electronic Drives and Energy Systems for Industrial Growth, volume 2, pages 523–528, 1998. [6] J. P. Lyons, S. R. MacMinn, and M. A. Preston. Flux/current methods for SRM rotor position estimation. In Conference Record of the 1991 IEEE Industry Applications Society Annual Meeting, pages 482–487, 1991. [7] M. A. Preston and J. P. Lyons. A switched reluctace motor model with mutual coupling and multi-phase excitation. In IEEE Transactions on Magnetics, volume 27, pages 5423–5425, 1991. [8] Mehrdad Ehsani and Babak Fahimi. Elimination of position sensors in switched reluctance mo- tor drives: State of the art and future trends. In IEEE Transactions on Industrial Applications, volume 49, pages 40–47, 2002. [9] Gabriel Gallegos-López, Philip C. Kjaer, and T. J. E. Miller. High-grade position estimation for SRM drives using flux linkage/current correction model. In IEEE Transactions on Industrial Applications, volume 35, pages 859–869, 1999. [10] M. Ehsani, I. Husain, S. Mahajan, and K. R. Ramani. New modulation encoding technique for indirect rotor position sensing in switched reluctance motors. In IEEE Transactions on Industrial Applications, volume 30, pages 584–588, 1994. [11] G. Suresh, B. Fahimi, and M. Ehsani. Improvement of the accuracy and speed range in sensorless control of switched reluctance motors. In Proceedings of IEEE APEC’98, pages 770–777, 1998. 134 Bibliography [12] W. D. Harris and J. H. Lang. A simple motion estimator for variable reluctance motors. In IEEE Transactions on Industrial Applications, volume 26, pages 237–243, 1990. [13] A. Brosse and G. Henneberger. Different models of the SRM in state space format for the sen- sorless control using a kalman filter. In Seventh International Conference on Power Electronics and Variable Speed Drives, pages 269–274, 1998. [14] G. Suresh, B. Fahimi, K. M. Rahman, and M. Ehsani. Inductance based position encoding for sensorless SRM drives. In Proceedings of IEEE PESC’99, volume 2, pages 832–837, 1999. [15] J. Bu and L. Xu. Eliminating starting hesitation for reliable sensorless control of switched reluctance motors. In Conference Record of the 1998 IEEE IAS Annual Meeting, volume 1, pages 693–700, 1998. [16] S. Saha, K. Ochiai, T. Kosaka, N. Matsui, and Y. Takeda. Developing a sensorless approach for switched reluctance motors from a new analytical model. In Conference Record of the 1999 IEEE IAS Annual Meeting, volume 1, pages 525–532, 1999. [17] Tingna Shi, Changliang Xia, Mingchao Wang, and Qian Zhang. Single neural PID control for sensorless switched reluctance motor based on RBF neural network. In Proceedings of the 6th World Congress on Intelligent Control and Automation, volume 2, pages 8069–8073, 2006. [18] A. Khalil, S. Underwood, I. Husain, H. Klode, B. Lequesne, S. Gopalakrishnan, and A. Omekanda. Four-quadrant pulse injection and sliding mode observer based sensorless op- eration of a switched reluctance machine over entire speed range including zero speed. In Conference Record of the 2005 IEEE IAS Annual Meeting, volume 3, pages 2147–2154, 2005. [19] Nisai H. Fuengwarodsakul, Stefan E. Bauer, Johannes Krane, Christian P. Dick, and Rik W. De Doncker. Sensorless direct instantaneous torque control for switched reluctance machines. In 2005 European Conference on Power Electronics and Applications, page 10 pp, 2005. [20] Won-Sik Baik, Min-Huei Kim, Nam-Hun Kim, Dong-Hee Kim, Kyeong-Ho Choi, Don-Ha Hwang, and Jung-Soo Jang. Improved rotor position estimation for the sensorless control system of SRM. In Proceedings of IEEE ISIE 2005, volume 3, pages 877–880, 2005. [21] Mahesh Krishnamurthy, Chris S. Edrington, and Babak Fahimi. Prediction of rotor position at standstill and rotating shaft conditions in switched reluctance machines. In IEEE Transactions on Power Electronics, volume 21, pages 225–233, 2006. [22] Akitomo Komatsuzaki, Kazumasa Yoshida, and Ichiro Miki. A position sensorless drive tech- nique for switched reluctance motor with consideration of magnetic saturation at low and medium speeds. In Conference Record of the 2006 IEEE IAS Annual Meeting, volume 4, pages 1995–2000, 2006. [23] Hongwei Gao, Farzad Rajaei Salmasi, and Mehrdad Ehsani. Inductance model-based sensorless control of the switched reluctance motor drive at low speed. In IEEE Transactions on Power Electronics, volume 19, pages 1568–1573, 2004. 135 Bibliography [24] Mohammad S. Islam, Iqbal Husain, Robert J. Veillette, and Celal Batur. Design and per- formance analysis of sliding-mode observers for sensorless operation of switched reluctance motors. In IEEE Transactions on Control Systems Technology, volume 11, pages 383–389, 2003. [25] X. D. Xue, K. W. E. Cheng, S. L. Ho, and D. K. W. Cheng. New estimation scheme of the arbitrary rotor position at standstill for the sensorless switched reluctance motor drive. In Proceedings of IEEE PESC’04, pages 1232–1238, 2004. [26] Syed A. Hossain, Iqbal Husain, Harald Klode, Bruno Lequesne, Avoki M. Omekanda, and Suresh Gopalakrishnan. Four-quadrant and zero-speed sensorless control of a switched reluc- tance motor. In IEEE Transactions on Industry Applications, volume 39, pages 1343–1349, 2003. [27] Virginie Raulin, Art Radun, and Iqbal Husain. Modeling of losses in switched reluctance machines. In IEEE Transactions on Industrial Applications, volume 40, pages 1560–1569, 2004. [28] Keunsoo Ha, Seok-Gyu Oh, Brian MacCleery, and R. Krishnan. An automated reconfigurable FPGA-based magnetic characterization of switched reluctance machines. In IEEE ISIE 2005, pages 839–844, 2005. [29] M. Krishnamurthy, D. Kaluvagunta, and B. Fahimi. Effects of high frequency excitation on the behaviour of a switched reluctance machine. In 2005 IEEE International Conference on Electric Machines and Drives, pages 186–192, 2005. [30] F. Sixdenier, L. Morel, and J. P. Masson. Introducing dynamic behavior of magnetic materials into a model of a switched reluctance motor drive. In IEEE Transactions on Magnetics, volume 42, pages 398–404, 2006. [31] J. T. Charton, J. Corda, J. M. Stephenson, and S. P. Randall. Dynamic modelling of switched reluctance machines with iron losses and phase interactions. In IEE Proc.-Electr. Power Appl., volume 153, pages 327–336, 2006. [32] T. J. E. Miller. Switched Reluctance Motors and their Control. Magna Physics Publishing and Clarendon Press, 1993. [33] T. J. E. Miller, editor. Electronic Control of Switched Reluctance Machines. Newnes, 2004. [34] Gordon Slemon. Magnetoelectric Devices Transducers, Transformers, and Machines. John Wiley and Sons, 1966. [35] W. MacLean. Theory of strong electromagnetic waves in massive iron. In Journal of Applied Physics, volume 25, 1954. [36] P. D. Agarwal. Eddy-current losses in solid and laminated iron. In Transactions AIEE, volume 78, pages 169–171, 1959. [37] S. R. Naidu. Time domain model for the ferromagnetic core, including the effects of hysteresis and eddy currents. In IEE Proceedings-A, volume 138, pages 44–50, 1991. 136 Bibliography [38] R. L. Stoll. The Analysis of Eddy Currents. Oxford University Press, 1974. [39] Enrico Dallago, Gabriele Sassone, and Giuseppe Venchi. High-frequency power transfomer model for circuit simulation. In IEEE Transactions on Power Electronics, volume 12, pages 664–670, 1997. [40] Hüseyin Akçay and Dogan Gökhan Ece. Modeling of hysteresis and power losses in transformer laminations. In IEEE Transactions on Power Delivery, volume 18, pages 487–492, 2003. [41] A. M. Oliveira, P. Kuo-Peng, M. V. Ferreira da Luz, N. Sadowski, and J. P. A. Bastos. Gen- eralization of coupled circuit-field calculation for polyphase structures. In IEEE Transactions on Magnetics, volume 37, pages 3444–3447, 2001. [42] W. Chandrasena, P. G. McLaren, U. D. Annakkage, R. P. Jayasinghe, and E. Dirks. Simulation of eddy current effects in transformers. In IEEE Canadian Conference on Electrical and Computer Engineering, pages 122–126, 2002. [43] Jian G. Zhu, S. Y. R. Hui, and V. S. Ramsden. A generalized dynamic circuit model of magnetic cores for low- and high-frequency applications-part I: Theorectical calculation of the equivalent core loss resistance. In IEEE Transactions on Power Electronics, volume 11, pages 246–250, 1996. [44] Stanley H. Charap. Magnetic hysteresis model. In IEEE Transactions on Magnetics, volume MAG-10, pages 1091–1096, 1974. [45] D. C. Jiles and D. L. Atherton. Theory of ferromagnetic hysteresis. In Journal of Magnetism and Magnetic Materials, volume 61, pages 48–60, 1986. [46] D. C. Jiles and J. B. Thoelke. Theory of ferromagnetic hysteresis: Determination of model pa- rameters from experimental hysteresis loops. In IEEE Transactions on Magnetics, volume 25, pages 3928–3930, 1989. [47] Z. J. Chen and D. C. Jiles. Modelling of reversible domain wall motion under the action of magnetic field and localized defects. In IEEE Transactions on Magnetics, volume 29, pages 2554–2556, 1993. [48] D. C. Jiles, J. B. Thoelke, and M. K. Devine. Numerical determination of hysteresis parameters for the modeling of magnetic properties using the theory of ferromagnetic hysteresis. In IEEE Transactions on Magnetics, volume 28, pages 27–35, 1992. [49] D. C. Jiles. A self consistent generalized model for the calculation of minor loop excursions in the theory of hysteresis. In IEEE Transactions on Magnetics, volume 28, pages 2602–2604, 1992. [50] F. Preisach. Uber die magnetische nachwirkung. In Zeitschhrift für Physik, volume 94, pages 277–302, 1935. [51] M. A. Krasnosel’skii and A. V. Pokrovskii. Systems with Hysteresis. Springer Verlag, 1989. 137 Bibliography [52] G. Consolo, G. Finocchio, M. Carpentieri, E. Cardelli, and B. Azzerboni. About indentification of scalar Preisach functions of soft magnetic materials. In IEEE Transactions on Magnetics, volume 42, pages 923–926, 2006. [53] Marc De Wulf, Lieven Vandevelde, Jehudi Maes, Luc Dupré, and Jan Melkebeek. Computation of the Preisach distribution function based on a measured everett map. In IEEE Transactions on Magnetics, volume 36, pages 3141–3143, 2000. [54] János Füzi. Analytical approximation of Preisach distribution functions. In IEEE Transactions on Magnetics, volume 39, pages 1357–1359, 2003. [55] Kurt Wiessen and Stanley H. Charap. Vector Preisach modeling. In Journal of Applied Physics, volume 61, pages 4019–4021, 1987. [56] I. D. Mayergoyz. Vector Preisach hysteresis models (invited paper). In MMM Conference, 1987. [57] I. D. Mayergoyz. Mathematical models of hysteresis. In IEEE Transactions on Magnetics, volume MAG-22, pages 603–608, 1986. [58] G. Biorci and D. Pescetti. Analytical theory of the behavior of ferromagnetic materials. In Nuovo Cimento, volume 7, pages 829–842, 1958. [59] S. R. Naidu. Simulation of the hysteresis phenomenon using Preisach’s theory. In IEE Proceedings-A, volume 137, pages 73–79, 1990. [60] S. Y. R. Hui, Jian G. Zhu, and V. S. Ramsden. A generalized dynamic circuit model of magnetic cores for low- and high-frequency applications-part II: Circuit model formulation and implementation. In IEEE Transactions on Power Electronics, volume 11, pages 251–259, 1996. [61] R. M. Del Vecchio. An efficient procedure for modeling complex hysteresis processes in fer- romagnetic materials. In IEEE Transactions on Magnetics, volume MAG-16, pages 809–811, 1980. [62] Kurt Wiessen and Stanley H. Charap. A better scalar Preisach algorithm. In IEEE Transac- tions on Magnetics, volume 24, pages 2491–2493, 1988. [63] I. D. Mayergoyz and G. Friedman. Generalized Preisach model of hysteresis. In IEEE Trans- actions on Magnetics, volume 24, pages 212–217, 1988. [64] I. D. Mayergoyz, A. A. Adly, and G. Friedman. New Preisach-type models of hysteresis and their experimental testing. In Journal of Applied Physics, volume 67, pages 5373–5375, 1990. [65] I. D. Mayergoyz, G. Friedman, and C. Salling. Comparison of the classical and generalized Preisach hysteresis models with experiments. In IEEE Transactions on Magnetics, volume 25, pages 3925–3927, 1989. [66] A. A. Adly and I. D. Mayergoyz. Experimental testing of the average Preisach model of hysteresis. In IEEE Transactions on Magnetics, volume 28, pages 2268–2270, 1992. 138 Bibliography [67] I. D. Mayergoyz and A. A. Adly. Numerical implementation of the feedback Preisach model. In IEEE Transactions on Magnetics, volume 28, pages 2605–2607, 1992. [68] Vlado Ostović. Dynamics of Saturated Electric Machines. Springer Verlag, 1989. [69] J. R. Marti. EECE560 Class Notes. The University of British Columbia, 1994. [70] Emmanuel C. Ifeachor and Barrie W. Jervis. Digital Signal Processing: A Practical Approach. Addison-Wesley, 1993. 139 Appendix A Acquisition of the Experimental Data The experimental setup that was developed to obtain the experimental curves in this work is described here. The experimental apparatus can be divided into three main components: the test material along with its driving and sense coils, the driving circuit, and the data acquisition equipment. Each component is described in detail. The description of the test setup is then followed by some discussion on the limitations of this approach to obtaining the necessary data. A.1 Test Material and Its Associated Coils The measurement of the properties of the test material requires it to be driven in a very specific manner. The proper layout of the test material, the driving coil, and the sense coil is critical in order to minimize the effects of leakage flux paths. Ideally, the test material is driven with a completely uniform H field. This in turn gives rise to a uniform B field inside the material at a given depth along the magnetic path. The presence of leakage flux causes the magnetic material to have a nonuniform B field. Thus, the H field on the surface of the material is no longer uniform with the presence of leakage flux. The leakage flux can be minimized in three ways: 1. wind the driving coil around the test material as uniform as possible; 2. situate the driving coil as far away from the test material as is practical; 3. situate the sense coil as close to the test material as is possible. Typically, setups that are used for measuring the properties of magnetic materials use a different coil for driving the material and sensing the material’s response. This allows the sense coil to be left open-circuited; thus, the induced voltage on the sense coil can be integrated directly to obtain the average B field in the material. If the driving coil was also used as the sense coil then the product of the current flowing in the coil and the coil resistance would be required as well as the voltage across the coil in order to calculate the average magnetic field. Since the resistance can vary over time this leads to more experimental error. The housing for the test material, the test material, and the two coils are shown in Figure A.1. Note that the outer diameter of the housing is 205 mm. A stack of seven laminations of the test 140 Appendix A. Acquisition of the Experimental Data material forms the magnetic core. Since the pressure that is applied to the stack of laminations is relatively small, the effects of eddy currents between laminations is negligible. Figure A.1: Test material, driving, and sense coils The driving coil was wound with 27 turns of AWG 12 magnetic wire. The sense coil was wound with 120 turns of AWG 32 magnetic wire. Two sense coils were wound to check the variation of the magnetic fields in the material. The sense coils produced results that are within 5% of each other. This error was deemed to be acceptable for the verification of the models that are shown in this work. A.2 The Drive Circuit With the introduction of increasingly more powerful power amplifiers, an inexpensive linear driving circuit for this type of testing has become more feasible. Two power amplifiers from Burr-Brown with peak driving currents of 10 A each were used in a master-slave arrangement to produce a total peak current of 20 A. The physical layout of the drive circuit is shown in Figure A.2 whereas the schematic of the driving circuit is shown in Figure A.3. The distortion that is produced by the driving circuit is quite low. The region of the output response that has the most distortion is near the zero crossing of the response. This becomes 141 Appendix A. Acquisition of the Experimental Data increasingly more apparent in the low current responses of the higher frequency waveforms. This distortion is produced by the limitation of the slew rate of the op-amp. Figure A.2: Drive circuit for the magnetic core The input signal was provided by a 33220A signal generation from Argilent. The reversal curves were programmed with included PC software from Arglent that allows the programed curve to be transfered to the unit via a USB interface. The reversal curves were generated at approximately 35 mHz. However, as the first order reversal curves reverse sooner (at larger values of H) the rate of change of the section of the curve that returns the state of the material to positive saturation needs to increase otherwise the induced voltage on the sense coil is not detectable. The frequencies that were used were as low as possible to minimize eddy current effects. The minimal achievable frequency, however, is limited by the minimal detectable voltage on the sense coil and, more criti- cally, the error in the integration of the sensed voltage due to drift. The error due to drift will be described in more detail in the section on the data acquisition equipment. 142 Appendix A. Acquisition of the Experimental Data Vin 1.1 kΩ 1.1 kΩ 6.8 kΩ 6.8 kΩ 0.1 Ω 30 W 0.1 Ω 30 W 3.2 kΩ 0.5 Ω 100 W 3.2 kΩ 0.1 µF 0.1 µF 0.1 µF 0.1 µF 10 µF 10 µF 10 µF 10 µF +15 V +15 V -15 V -15 V UUT 3 4 5,7 6 8 1,2 10,11 3 4 5,7 6 8 1,2 10,11 OPA549 OPA549 All resistors 0.25 W, 5 % unless otherwise specified Figure A.3: Schematic of the drive circuit for the magnetic core 143 Appendix A. Acquisition of the Experimental Data A.3 The Data Acquisition Equipment A closed-loop current sensor from LEM was used to sense the current in the coil that drives the test material. Both the output of the current sensor and the induced voltage of the sense coil were measured using a digital oscilloscope from LeCroy. The oscilloscope is able to sample the data at a very high rate. Thus, the signals can be filtered without distorting the original signals. The sampled waveforms were processed using Matlab by first filtering the data with a 100 point FIR filter and then decimating the filtered signal by 100. The filtered induced voltage is integrated using the trapezoidal rule of digital integration. The voltage waveform is first shifted to remove the voltage offset before it integrated. This procedure was used for all of the data to produce the waveforms that are shown in this work. As is mentioned above, there was evidence of drift in the signals. This was particularly apparent when the data for the first order reversal curves was obtained. If the frequency was too low then the integrated signal was not useable because the distortion in the waveform due to drift was excessively large. The first order reversal curves that were obtained using this testing procedure are shown in Chapter 2. As is mentioned in Chapter 2, the waveforms near the positive saturation point +Hsat tend to be rather noisy. This is not surprising since the level of the voltage signal at this point is very low compared to the signal that produces the waveform near zero. It is difficult to improve the resolution of the voltage signal for small values of input signal because of the dynamic range of the signal. The voltage input of the oscilloscope dictates the maximum range of the input signal. In order to capture the narrow width spikes of voltage near zero current requires a large range for the input signal. Thus, the resolution for small levels of the input is limited. Fortunately, this issue is not a big concern since the width of the hysteresis loop in saturation is narrow compared to the width of the hysteresis loop when the material is unsaturated. A.4 Test Setup Figure A.4 below shows a picture of the entire testing apparatus except for the oscilloscope and the DC voltage supplies for ±15 V. Notice that the 100 W power resistor is actually a precision shunt resistor. The LEM current sensor is part of the metal box that is on the right hand side of the picture. Normally the test material was situated as far from the drive circuit and other sources of EMI as was practical in order to minimize their influence on the test. 144 Appendix A. Acquisition of the Experimental Data Figure A.4: Testing apparatus A.5 Limitations of this Testing Approach Some of the issues that were encountered with using this testing approach have already been mentioned. However, there are other issues with this setup that haven’t been discussed yet. One of the advantages of using the geometry of the test material that was used is there are no breaks or abnormalities in the magnetic path. Unfortunately, the path length is not the same across the width of the material due to its circular shape. Since the width of the test material is small compared to the diameter of its circular path, the error in using the mean path length is small. If the testing of wider materials is required then using this approach would require the diameter of the material to become increasingly larger as the width increases. At some point this is likely to become impractical. The geometry of the test material is suitable for non-oriented materials. For grain oriented materials the geometry is not suitable since the grains are not oriented in circular paths but in straight paths. For these materials the standard Epstein test is still required. In brief, the Epstein test uses an Epstein frame to test the material. Rectangular stripes of the material with tapered ends are positioned into four legs of the frame to make a square geometry. The coils are driven by uniformly distributed windings on all four legs of the apparatus. Underneath the driving coils are wound sense coils to measure the induced voltage. One of the issues of the Epstein test is the field needs to bend around the corners of the material. This causes the field to become nonuniform near 145 Appendix A. Acquisition of the Experimental Data the corners of the material. This, in turn, creates errors in the measured data. For the tests that were performed in this work the test apparatus produced reasonable results. Ideally, the results from this test should be compared to the standard Epstein test to see the effects of the choice of geometry on the response of the material. 146 Appendix B Analysis Data and Supporting Curves This appendix gives the raw data that was generated from the normalized least-squares metric that is defined in Chapter 4. A graphical comparison between the proposed dynamic model and a static resistance model is also given for a four tube structure. Finally, curves that depict the variation of the tube resistances and the magnetic intensity H through the material in time are shown. B.1 Error Data Table B.1: Error data for the comparison of various models Error Hp f 4 Tube Models 10 Tube Models (A/m) (Hz) 50 µs timestep 25 µs timestep 25 µs timestep tuned tuned tuned tuned dynamic @250 Hz @500 Hz dynamic @250 Hz dynamic @250 Hz 1000 1000 0.8006 0.9810 0.7138 0.5257 1.2282 0.3134 1.3570 500 1000 0.4260 0.8704 0.5320 0.4280 1.0601 0.3081 0.9604 125 1000 3.9988 7.3603 8.2862 5.9729 8.3986 3.2882 10.0828 1000 500 0.5249 0.6889 0.4357 0.5864 0.9686 0.2842 0.8832 500 500 0.3498 0.5359 0.1224 0.3213 0.7120 0.3650 0.7656 125 500 2.5215 8.2814 9.0593 3.2291 8.9002 2.1031 9.0216 1000 250 0.2745 0.2820 0.2745 0.2197 0.4697 0.3828 0.3054 500 250 0.4688 0.3638 0.4428 0.3762 0.3706 0.3283 0.3067 125 250 1.9686 8.5733 9.1469 2.4219 8.7278 1.7989 8.3629 1000 60 0.1863 0.2140 0.3670 0.1109 0.1077 0.1536 0.1949 500 60 0.3480 0.3555 0.5401 0.2054 0.2369 0.1860 0.3362 125 60 1.3748 4.7264 4.9704 1.8671 4.5542 1.4202 4.6384 147 Appendix B. Analysis Data and Supporting Curves B.2 A Graphical Comparison Between Four Tube Dynamic and Static Models -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 .5-1 -0 .500. 51 1. 5 H (A /m ) B (T) ex pe rim en ta l d at a 4 tu be m od el wi th b ot h m ec ha nis m s 4 tu be m od el wi th st at ic ad jus tm en t o nly Figure B.1: Response of four tube models for 60 Hz input excitations 148 Appendix B. Analysis Data and Supporting Curves -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 .5-1 -0 .500. 51 1. 5 H (A /m ) B (T) ex pe rim en ta l d at a 4 tu be m od el wi th b ot h m ec ha nis m s 4 tu be m od el wi th st at ic ad jus tm en t o nly Figure B.2: Response of four tube models for 250 Hz input excitations 149 Appendix B. Analysis Data and Supporting Curves -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -1 -0 .500. 51 H (A /m ) B (T) ex pe rim en ta l d at a 4 tu be m od el wi th b ot h m ec ha nis m s 4 tu be m od el wi th st at ic ad jus tm en t o nly Figure B.3: Response of four tube models for 500 Hz input excitations 150 Appendix B. Analysis Data and Supporting Curves -1 00 0 -8 00 -6 00 -4 00 -2 00 0 20 0 40 0 60 0 80 0 10 00 -0 .8 -0 .6 -0 .4 -0 .200. 2 0. 4 0. 6 0. 8 H (A /m ) B (T) ex pe rim en ta l d at a 4 tu be m od el wi th b ot h m ec ha nis m s 4 tu be m od el wi th st at ic ad jus tm en t o nly Figure B.4: Response of four tube models for 1 kHz input excitations 151 Appendix B. Analysis Data and Supporting Curves B.3 Variation of Tube Resistances and Magnetic Intensity Profile Inside the Material 0 0. 00 5 0. 01 0. 01 5 0. 02 0. 02 5 -1 50-1 00-5 005010 0 15 0 tim e (s ) H (A/m) Figure B.5: Magnetic intensity profile inside the material in time for a 10 tube model 152 Appendix B. Analysis Data and Supporting Curves 0 0. 00 5 0. 01 0. 01 5 0. 02 0. 02 5 10 0 20 0 30 0 40 0 L10 ( Ω - 1) tim e (s ) 0 0. 00 5 0. 01 0. 01 5 0. 02 0. 02 5 10 0 20 0 30 0 40 0 L9 ( Ω - 1) 0 0. 00 5 0. 01 0. 01 5 0. 02 0. 02 5 10 0 15 0 20 0 25 0 5 0 L8 ( Ω - 1) 0 0. 00 5 0. 01 0. 01 5 0. 02 0. 02 5 5 0 10 0 15 0 20 0 L7 ( Ω - 1) Figure B.6: Variation of the outermost tube resistances of a 10 tube model for the profile above 153 Appendix C ANSI C Code of the Realized Model C.1 stdafx.h // s t d a f x . h : i n c l ude f i l e f o r s tandard system inc l ude f i l e s // and magnetic model header f i l e s #pragma once #define WIN32 LEAN AND MEAN // Exclude rare l y−used s t u f f from Windows headers #include <s t d i o . h> #include <tchar . h> #include <s t d l i b . h> #include <math . h> #include <s t r i n g . h> #include <windows . h> #include ” h y s t e r e s i s . h” #include ” lookup ga in . h” #include ” cpu time . h” C.2 main.C // modi f ied mode l . cpp : Def ines the entry po in t f o r the magnetic model a p p l i c a t i o n . #include ” s tda fx . h” int tmain ( int argc , TCHAR∗ argv [ ] ) { hy s t i n s t an c e tube1 , tube2 , tube3 , tubex ; hy s t i n s t an c e ∗ tube1 ptr = &tube1 ; hy s t i n s t an c e ∗ tube2 ptr = &tube2 ; hy s t i n s t an c e ∗ tube3 ptr = &tube3 ; hy s t i n s t an c e ∗ tubex ptr = &tubex ; i n i t i a l i z e h y s t i n s t a n c e ( tube1 ptr ) ; i n i t i a l i z e h y s t i n s t a n c e ( tube2 ptr ) ; i n i t i a l i z e h y s t i n s t a n c e ( tube3 ptr ) ; 154 Appendix C. ANSI C Code of the Realized Model i n i t i a l i z e h y s t i n s t a n c e ( tubex ptr ) ; const f loat dt = 5e−5 f ; const f loat h = 4 .8 e−3 f ; const f loat w = 0.635 e−3 f ; const f loat Lp = 1e−3 f ; const f loat inv Lp = 1 / Lp ; const f loat w1 = 1.1682181 e−004 f ; const f loat w2 = 2.2486728 e−004 f ; const f loat A = 1.0160 e−006 f ; const f loat inv At = 1/(3∗A) ; const f loat sigMa = 3 .5 e6 f ; const double pi = 3.14159265358979 ; const f loat R3 base = dt ∗ (2∗ (h−w) /( sigMa∗Lp∗(w/2 − w2) ) + 2∗ pi /( sigMa∗Lp) / log ( w/2 / w2) ) ; const f loat inv R3 base = 1 / R3 base ; const f loat R2 base = dt ∗ (2∗ (h−w) /( sigMa∗Lp∗(w2 − w1) ) + 2∗ pi /( sigMa∗Lp) / log ( w2 / w1) ) ; const f loat R1 base = dt ∗ (2∗ (h−w) /( sigMa∗Lp∗w1) + 2∗ pi /( sigMa∗Lp) ) ; const f loat i nv Re l ba s e = A / Lp ; int H index o ld 1 = tube1 ptr −>H index ; int H index o ld 2 = tube1 ptr −>H index ; int H index o ld 3 = tube1 ptr −>H index ; f loat Hold 1 = 0 ; f loat Hold 2 = 0 ; f loat Hold 3 = 0 ; f loat Bold 1 = tube1 ptr −>Bpv ; f loat Bold 2 = Bold 1 ; f loat Bold 3 = Bold 1 ; f loat Bold x = Bold 1 ; f loat f l u x 1 o l d = Bold x ∗ A; f loat f l u x 2 o l d = 2∗( Bold x ∗ A) ; f loat f l u x 3 o l d = 3∗( Bold x ∗ A) ; int passed 1 = 0 ; int passed 2 = 0 ; int passed 3 = 0 ; int∗ pa s s ed 1 p t r = &passed 1 ; int∗ pa s s ed 2 p t r = &passed 2 ; int∗ pa s s ed 3 p t r = &passed 3 ; 155 Appendix C. ANSI C Code of the Realized Model int c a l c r e v e r s e 1 = 0 ; int c a l c r e v e r s e 2 = 0 ; int c a l c r e v e r s e 3 = 0 ; int∗ c a l c r e v e r s e 1 p t r = &c a l c r e v e r s e 1 ; int∗ c a l c r e v e r s e 2 p t r = &c a l c r e v e r s e 2 ; int∗ c a l c r e v e r s e 3 p t r = &c a l c r e v e r s e 3 ; int va l i d = 0 ; int changed = 1 ; f loat H 1 = 0 ; f loat H 2 = 0 ; f loat H 3 = 0 ; f loat B x = Bold 1 ; f loat H x = 0 ; f loat Fout [ 1 0 0 0 0 ] ; f loat F3 [ 1 0 0 0 0 ] ; f loat inv R1 = inv Re l ba s e ∗ tube1 ptr−>m ; f loat inv R2 = inv Re l ba s e ∗ tube2 ptr−>m ; f loat inv R3 = inv Re l ba s e ∗ tube3 ptr−>m ; f loat inv L1 = R1 base ; f loat inv L2 = R2 base ; f loat L3 = 1 / R3 base ; f loat G11 = −(inv R1 + inv L1 ) ; f loat G22 = −(inv R2 + inv L1 + inv L2 ) ; f loat G33 = −(inv R1 + inv R2 + inv R3 ) ; f loat inv G row1 [ 3 ] = { (G22∗G33 − inv R2∗ inv R2 ) , ( inv R1∗ inv R2 − inv L1 ∗G33 ) , ( inv L1 ∗ inv R2 − inv R1∗G22) } ; f loat inv G row2 [ 3 ] = { inv G row1 [ 1 ] , (G11∗G33 − inv R1∗ inv R1 ) , ( inv L1 ∗ inv R1 − G11∗ inv R2 ) } ; f loat inv G row3 [ 3 ] = { inv G row1 [ 2 ] , inv G row2 [ 2 ] , (G11∗G22 − inv L1 ∗ inv L1 ) } ; f loat inv det G = 1 / ( G11∗ inv G row1 [ 0 ] + inv L1 ∗ inv G row1 [ 1 ] + inv R1∗ inv G row1 [ 2 ] ) ; f loat h i s t [ 3 ] ; 156 Appendix C. ANSI C Code of the Realized Model f loat i n pu t f l u x [ 1 0 0 0 0 ] ; int i ; for ( i =0; i <10000; i++) i npu t f l u x [ i ] = 0 . 75∗2 . 4 e−6∗ s i n ( 2∗ pi ∗60∗ i ∗dt ) ; /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ /∗ Generate input sawtooth waveform ∗/ const int s t ep s = 20 ; /∗ number o f s t e p s f o r 1 khz ∗/ int num steps = 0 ; for ( i =0; i < 10000 ; i++) { i f ( num steps <= step s /2) { i n pu t f l u x [ i ] = 0 . 75∗2 . 4 e−6∗num steps/ s t ep s ∗4 ; num steps++; } else { i f ( num steps < s t ep s ) { i n pu t f l u x [ i ] = 0 . 75∗2 . 4 e−6∗( s teps−num steps ) / s t ep s ∗4 ; num steps++; } else { num steps = 1 ; i npu t f l u x [ i ] = 0 ; } } } /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ int i t e r a t i o n s = 0 ; int c oun t i t e r = 0 ; int ga in H index 1 = 7 ; int ga in B index 1 = 7 ; int∗ g H index 1 pt r = &ga in H index 1 ; int∗ g B index 1 pt r = &ga in B index 1 ; int ga in H index 2 = 7 ; int ga in B index 2 = 7 ; int∗ g H index 2 pt r = &ga in H index 2 ; int∗ g B index 2 pt r = &ga in B index 2 ; 157 Appendix C. ANSI C Code of the Realized Model int ga in H index 3 = 7 ; int ga in B index 3 = 7 ; int∗ g H index 3 pt r = &ga in H index 3 ; int∗ g B index 3 pt r = &ga in B index 3 ; int ga in T index = 0 ; int∗ g T index = &gain T index ; const f loat Kgain [ 3 ] = {0.9151538 f , −0.1895345 f , 0 . 1046883 f } ; f loat t u b e 1 f i l t e r [ 3 ] = {0 ,0 , 0} ; f loat f t ube1 o ld = 0 ; f loat abs derv 1 = 0 ; f loat x1 ; f loat t u b e 2 f i l t e r [ 3 ] = {0 ,0 , 0} ; f loat f t ube2 o ld = 0 ; f loat abs derv 2 = 0 ; f loat x2 ; f loat t u b e 3 f i l t e r [ 3 ] = {0 ,0 , 0} ; f loat f t ube3 o ld = 0 ; f loat abs derv 3 = 0 ; f loat x3 ; f loat t e s t d e r v [ 1 0 0 0 0 ] ; StartTimer ( ) ; // s t a r t t imer f o r t iming ana l y s i s for ( i =0; i <10000; i++) { inv L1 = R1 base∗ f ind L mult ( Hold 1 , Bold 1 , abs derv 1 , g H index 1 ptr , g B index 1 pt r ) ; inv L2 = R2 base∗ f ind L mult ( Hold 2 , Bold 2 , abs derv 2 , g H index 2 ptr , g B index 2 pt r ) ; L3 = inv R3 base ∗ find Lmod ( tubex ptr−>m, Hold 3 , Bold 3 , abs derv 3 , g H index 3 ptr , g B index 3 ptr , g T index ) ; i t e r a t i o n s = 0 ; changed = 1 ; while ( changed ) { 158 Appendix C. ANSI C Code of the Realized Model changed = 0 ; i t e r a t i o n s++; G11 = −(inv R1 + inv L1 ) ; G22 = −(inv R2 + inv L1 + inv L2 ) ; G33 = −(inv R1 + inv R2 + inv R3 ) ; inv G row1 [ 0 ] = G22∗G33 − inv R2∗ inv R2 ; inv G row1 [ 1 ] = inv R1∗ inv R2 − inv L1 ∗G33 ; inv G row1 [ 2 ] = inv L1 ∗ inv R2 − inv R1∗G22 ; inv G row2 [ 1 ] = G11∗G33 − inv R1∗ inv R1 ; inv G row2 [ 2 ] = inv L1 ∗ inv R1 − G11∗ inv R2 ; inv G row3 [ 2 ] = G11∗G22 − inv L1 ∗ inv L1 ; inv G row2 [ 0 ] = inv G row1 [ 1 ] ; inv G row3 [ 0 ] = inv G row1 [ 2 ] ; inv G row3 [ 1 ] = inv G row2 [ 2 ] ; h i s t [ 0 ] = −A∗ tube1 ptr−>Bpv + f l u x 1 o l d ; h i s t [ 1 ] = −A∗ tube2 ptr−>Bpv + f l u x 2 o l d − f l u x 1 o l d ; h i s t [ 2 ] = A∗( tube1 ptr−>Bpv + tube2 ptr−>Bpv + tube3 ptr−>Bpv) − i n pu t f l u x [ i ] ; inv det G = inv Lp /( G11∗ inv G row1 [ 0 ] + inv L1 ∗ inv G row1 [ 1 ] + inv R1∗ inv G row1 [ 2 ] ) ; H 3 = inv det G ∗( inv G row3 [ 0 ] ∗ h i s t [ 0 ] + inv G row3 [ 1 ] ∗ h i s t [ 1 ] + inv G row3 [ 2 ] ∗ h i s t [ 2 ] ) ; v a l i d = output m Bpv ( H index o ld 3 , pas s ed 3 pt r , c a l c r e v e r s e 3 p t r , tube3 ptr , H 3 , Hold 3 ) ; i f ( ! v a l i d ) { inv R3 = inv Re l ba s e ∗ tube3 ptr−>m ; changed = 1 ; } H 2 = H 3 − inv det G ∗( inv G row2 [ 0 ] ∗ h i s t [ 0 ] + inv G row2 [ 1 ] ∗ h i s t [ 1 ] + inv G row2 [ 2 ] ∗ h i s t [ 2 ] ) ; v a l i d = output m Bpv ( H index o ld 2 , pas s ed 2 pt r , c a l c r e v e r s e 2 p t r , tube2 ptr , H 2 , Hold 2 ) ; i f ( ! v a l i d ) { inv R2 = inv Re l ba s e ∗ tube2 ptr−>m ; changed = 1 ; } 159 Appendix C. ANSI C Code of the Realized Model H 1 = H 3 − inv det G ∗( inv G row1 [ 0 ] ∗ h i s t [ 0 ] + inv G row1 [ 1 ] ∗ h i s t [ 1 ] + inv G row1 [ 2 ] ∗ h i s t [ 2 ] ) ; v a l i d = output m Bpv ( H index o ld 1 , pas s ed 1 pt r , c a l c r e v e r s e 1 p t r , tube1 ptr , H 1 , Hold 1 ) ; i f ( ! v a l i d ) { inv R1 = inv Re l ba s e ∗ tube1 ptr−>m ; changed = 1 ; } i f ( i t e r a t i o n s == 15) { changed = 0 ; } } va l i d = 0 ; B x = inpu t f l u x [ i ]∗ inv At ; while ( ! v a l i d ) va l i d = simple output m Bpv ( tubex ptr , B x , Bold x ) ; Bold x = B x ; H x = (B x − tubex ptr−>Bpv) / tubex ptr−>m; Hold 1 = H 1 ; Bold 1 = H 1∗ tube1 ptr−>m + tube1 ptr−>Bpv ; H index o ld 1 = tube1 ptr −>H index ; ∗( pa s s ed 1 p t r ) = 0 ; ∗( c a l c r e v e r s e 1 p t r ) = 0 ; Hold 2 = H 2 ; Bold 2 = H 2∗ tube2 ptr−>m + tube2 ptr−>Bpv ; H index o ld 2 = tube2 ptr −>H index ; ∗( pa s s ed 2 p t r ) = 0 ; ∗( c a l c r e v e r s e 2 p t r ) = 0 ; Hold 3 = H 3 ; Bold 3 = H 3∗ tube3 ptr−>m + tube3 ptr−>Bpv ; H index o ld 3 = tube3 ptr −>H index ; ∗( pa s s ed 3 p t r ) = 0 ; ∗( c a l c r e v e r s e 3 p t r ) = 0 ; f l u x 1 o l d = Lp∗H 1∗ inv R1 + A∗ tube1 ptr−>Bpv ; f l u x 2 o l d = f l u x 1 o l d + Lp∗H 2∗ inv R2 + A∗ tube2 ptr−>Bpv ; Fout [ i ] = Lp∗H 3 + L3∗( i npu t f l u x [ i ] − f l u x 3 o l d ) ; f l u x 3 o l d = inpu t f l u x [ i ] ; 160 Appendix C. ANSI C Code of the Realized Model t u b e 1 f i l t e r [ 0 ] = H 2∗Lp − f t ube1 o l d ; f t ube1 o ld = H 2∗Lp ; x1 = t u b e 1 f i l t e r [ 0 ] ∗ Kgain [ 0 ] − t u b e 1 f i l t e r [ 1 ] ∗ Kgain [ 1 ] − t u b e 1 f i l t e r [ 2 ] ∗ Kgain [ 2 ] ; abs de rv 1 = fabs ( 0 . 5∗ ( x1 + t u b e 1 f i l t e r [ 1 ] ) ) ; t u b e 1 f i l t e r [ 2 ] = t u b e 1 f i l t e r [ 1 ] ; t u b e 1 f i l t e r [ 1 ] = x1 ; t u b e 2 f i l t e r [ 0 ] = H 3∗Lp − f t ube2 o l d ; f t ube2 o ld = H 3∗Lp ; x2 = t u b e 2 f i l t e r [ 0 ] ∗ Kgain [ 0 ] − t u b e 2 f i l t e r [ 1 ] ∗ Kgain [ 1 ] − t u b e 2 f i l t e r [ 2 ] ∗ Kgain [ 2 ] ; abs de rv 2 = fabs ( 0 . 5∗ ( x2 + t u b e 2 f i l t e r [ 1 ] ) ) ; t u b e 2 f i l t e r [ 2 ] = t u b e 2 f i l t e r [ 1 ] ; t u b e 2 f i l t e r [ 1 ] = x2 ; t u b e 3 f i l t e r [ 0 ] = H x∗Lp − f t ube3 o l d ; f t ube3 o ld = H x∗Lp ; x3 = t u b e 3 f i l t e r [ 0 ] ∗ Kgain [ 0 ] − t u b e 3 f i l t e r [ 1 ] ∗ Kgain [ 1 ] − t u b e 3 f i l t e r [ 2 ] ∗ Kgain [ 2 ] ; abs de rv 3 = fabs ( 0 . 5∗ ( x3 + t u b e 3 f i l t e r [ 1 ] ) ) ; t u b e 3 f i l t e r [ 2 ] = t u b e 3 f i l t e r [ 1 ] ; t u b e 3 f i l t e r [ 1 ] = x3 ; } double dtime = StopTimer ( ) ; p r i n t f ( ” execut ing loop took %f seconds \n” , dtime ) ; FILE ∗ fp ; e r r no t e r r ; i f ( ( e r r = fopen s (&fp , ” te s t mod i f i ed mode l C . txt ” , ”wt” ) ) != 0) { p r i n t f ( ”Cannot open f i l e .\n” ) ; e x i t (1 ) ; } for ( i =0; i <10000; i++) { f p r i n t f ( fp , ”%f \ t ” , i npu t f l u x [ i ] / ( 3∗A) ) ; f p r i n t f ( fp , ”%f \n” , Fout [ i ]∗ inv Lp ) ; } i f ( f c l o s e ( fp ) ) 161 Appendix C. ANSI C Code of the Realized Model { p r i n t f ( ”The f i l e was not c l o s ed \n” ) ; } return 0 ; } C.3 cpu time.h void StartTimer ( ) ; double StopTimer ( ) ; C.4 cpu time.C #include ” s tda fx . h” LARGE INTEGER s ta r tT i ck s ; /∗ f o r High−r e s o l u t i o n performance counter ∗/ LARGE INTEGER t imer f rq ; /∗ f o r High−r e s o l u t i o n performance counter ∗/ LARGE INTEGER stopTicks ; LARGE INTEGER to ta lT i ck s ; double totalTime ; /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ /∗ S T A R T T I M E R ∗/ /∗ ∗/ /∗ S ta r t g enera l purpose t imer ∗/ /∗ Use StopTimer () to s top and re turn the t imer va lue ∗/ /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ void StartTimer ( ) { /∗ s e t up high−p r e c i s i on c l k ∗/ QueryPerformanceFrequency(&t ime r f r q ) ; /∗ Use High Performance Counter f o r W2000 and NT ∗/ QueryPerformanceCounter(& s t a r tT i ck s ) ; } /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ /∗ S T O P T I M E R ∗/ /∗ ∗/ /∗ Returns t imer va lue in microseconds ∗/ /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ 162 Appendix C. ANSI C Code of the Realized Model double StopTimer ( ) { /∗ Use High Performance Counter f o r W2000 and NT ∗/ QueryPerformanceCounter(&stopTicks ) ; t o t a lT i c k s . QuadPart = stopTicks . QuadPart − s t a r tT i ck s . QuadPart ; totalTime = (double ) ( (double ) t o t a lT i c k s . QuadPart /(double ) t ime r f r q . QuadPart ) ; return ( ( ( double ) totalTime ) ∗1000000) ; } C.5 hysteresis.h struct STATE struct { f loat H; int j ; f loat C; f loat r ; f loat B; } ; struct hy s t i n s t an c e { int up ; STATE struct STATE[ 1 0 0 ] ; STATE struct∗ STATE ptr ; int H index ; f loat m; f loat Bpv ; } ; void i n i t i a l i z e h y s t i n s t a n c e ( hy s t i n s t an c e ∗) ; int output m Bpv ( int , int ∗ , int ∗ , h y s t i n s t an c e ∗ , f loat , f loat ) ; int simple output m Bpv ( hy s t i n s t an c e ∗ , f loat , f loat ) ; const f loat data m [ 3 0 ] [ 3 0 ] = { . . . } ; const f loat data dB [ 3 1 ] [ 3 1 ] = { . . . } ; const f loat H bounds [ 3 1 ] = { . . . } ; int counter ; const f loat inv dH [ 3 0 ] = { . . . } ; 163 Appendix C. ANSI C Code of the Realized Model C.6 lookup gain.h f loat f ind L mult ( f loat , f loat , f loat , int ∗ , int ∗) ; f loat find Lmod ( f loat , f loat , f loat , f loat , int ∗ , int ∗ , int ∗) ; const f loat m check [ 1 4 ] [ 1 6 ] = { . . . } ; const f loat Bpv check [ 1 4 ] [ 1 5 ] = { . . . } ; const f loat he i gh t va l u e s [ 2 8 ] [ 1 5 ] = { . . . } ; const f loat H corners [ 1 5 ] = { . . . } ; const f loat i nv H corne r s [ 1 4 ] = { . . . } ; const f loat dF dt data [ 8 ] = { . . . } ; const f loat f a l l o f f s l o p e [ 7 ] = { . . . } ; const f loat p i vo t po i n t [ 7 ] = { . . . } ; const f loat dF dt data2 [ 1 4 ] = { . . . } ; const f loat f a l l o f f s l o p e 2 [ 1 3 ] = { . . . } ; const f loat p ivo t po in t2 [ 1 3 ] = { . . . } ; const f loat inv max m = 2.0446 e+001 f ; C.7 lookup gain.C #include ” s tda fx . h” f loat f ind L mult ( f loat H, f loat B, f loat abs derv , int∗ H index , int∗ B index ) { f loat k ; int k index = 1 ; int not done = 1 ; i f ( abs derv >= 0 . 2 ) return 1 ; while ( not done ) ( dF dt data [ k index ] < abs derv ) ? k index++ : not done = 0 ; k index−−; k = f a l l o f f s l o p e [ k index ]∗ abs derv + p ivo t po i n t [ k index ] ; i f ( f abs (H) >= 125) return 1 ; not done = 1 ; while ( not done ) { i f (H >= H corners [ ( ∗ H index ) +1]) 164 Appendix C. ANSI C Code of the Realized Model (∗H index )++; else { i f (H < H corners [∗ H index ] ) (∗H index )−−; else not done = 0 ; } } switch (∗H index ) { case 0 : i f (∗B index > 1) ∗B index = 1 ; break ; case 13 : i f (∗B index > 1) ∗B index = 1 ; break ; case 1 : i f (∗B index > 3) ∗B index = 3 ; break ; case 12 : i f (∗B index > 3) ∗B index = 3 ; break ; case 2 : i f (∗B index > 5) ∗B index = 5 ; break ; case 11 : i f (∗B index > 5) ∗B index = 5 ; break ; case 3 : i f (∗B index > 7) ∗B index = 7 ; break ; case 10 : i f (∗B index > 7) ∗B index = 7 ; break ; case 4 : i f (∗B index > 9) ∗B index = 9 ; break ; case 9 : i f (∗B index > 9) ∗B index = 9 ; break ; case 5 : i f (∗B index > 11) ∗B index = 11 ; break ; case 8 : i f (∗B index > 11) ∗B index = 11 ; break ; default : i f (∗B index > 13) ∗B index = 13 ; break ; } not done = 1 ; while ( not done ) { i f (B >= H∗m check [∗ H index ] [ ( ∗ B index )+1] + Bpv check [∗ H index ] [ ( ∗ B index ) +1]) { (∗B index )++; i f (m check [∗ H index ] [ ∗ B index ] == 0) return 1 ; 165 Appendix C. ANSI C Code of the Realized Model } else { i f (B < H∗m check [∗ H index ] [ ∗ B index ] + Bpv check [∗ H index ] [ ∗ B index ] ) { (∗B index )−−; i f ( (∗B index ) == −1) { ∗B index = 0 ; return 1 ; } } else not done = 0 ; } } register int h index1 = 2∗(∗H index ) ; register f loat r1 = (H − H corners [∗ H index ] ) ∗ i nv H corne r s [∗ H index ] ; register f loat he ight low = ( he i gh t va l u e s [ h index1 +1] [∗B index ] − he i gh t va l u e s [ h index1 ] [ ∗ B index ] ) ∗ r1 ; he ight low = he ight low + he i gh t va l u e s [ h index1 ] [ ∗ B index ] ; register f loat he i gh t h i gh = ( he i gh t va l u e s [ h index1 +1] [ (∗ B index )+1] − he i gh t va l u e s [ h index1 ] [ ( ∗ B index ) +1])∗ r1 ; h e i gh t h i gh = he i gh t h i gh + he i gh t va l u e s [ h index1 ] [ ( ∗ B index ) +1] ; register f loat r2 num = B − (H∗m check [∗ H index ] [ ∗ B index ] + Bpv check [∗ H index ] [ ∗ B index ] ) ; register f loat r2 den = H∗(m check [∗ H index ] [ ( ∗ B index )+1] − m check [∗ H index ] [ ∗ B index ] ) ; r2 den = r2 den + Bpv check [∗ H index ] [ ( ∗ B index )+1]− Bpv check [∗ H index ] [ ∗ B index ] ; return r2 den / ( r2 den + ( ( he i gh t h i gh − he ight low ) ∗r2 num +(he ight low −1)∗ r2 den ) ∗k ) ; } /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ f loat find Lmod ( f loat m, f loat H, f loat B, f loat abs derv , int∗ H index , int∗ B index , int∗ T index ) { f loat k ,T, den ; 166 Appendix C. ANSI C Code of the Realized Model int k index = 1 ; int not done = 1 ; i f ( abs derv >= 0 . 4 ) T = 0.95 f ; else { while ( not done ) { i f ( dF dt data2 [ ( ∗ T index )+1] < abs derv ) (∗T index )++; else i f ( dF dt data2 [∗ T index ] > abs derv ) (∗T index )−−; else not done = 0 ; } T = f a l l o f f s l o p e 2 [∗ T index ]∗ abs derv + p ivo t po in t2 [∗ T index ] ; } i f (T > 1) den = T; else den = T + (1−T) ∗ inv max m∗m; i f ( abs derv >= 0 . 2 ) return (1/ den ) ; not done =1; while ( not done ) ( dF dt data [ k index ] < abs derv ) ? k index++ : not done = 0 ; k index−−; k = f a l l o f f s l o p e [ k index ]∗ abs derv + p ivo t po i n t [ k index ] ; i f ( f abs (H) >= 125) return (1/ den ) ; not done = 1 ; while ( not done ) { i f (H >= H corners [ ( ∗ H index ) +1]) (∗H index )++; else { i f (H < H corners [∗ H index ] ) (∗H index )−−; else not done = 0 ; } } switch (∗H index ) { case 0 : i f (∗B index > 1) ∗B index = 1 ; 167 Appendix C. ANSI C Code of the Realized Model break ; case 13 : i f (∗B index > 1) ∗B index = 1 ; break ; case 1 : i f (∗B index > 3) ∗B index = 3 ; break ; case 12 : i f (∗B index > 3) ∗B index = 3 ; break ; case 2 : i f (∗B index > 5) ∗B index = 5 ; break ; case 11 : i f (∗B index > 5) ∗B index = 5 ; break ; case 3 : i f (∗B index > 7) ∗B index = 7 ; break ; case 10 : i f (∗B index > 7) ∗B index = 7 ; break ; case 4 : i f (∗B index > 9) ∗B index = 9 ; break ; case 9 : i f (∗B index > 9) ∗B index = 9 ; break ; case 5 : i f (∗B index > 11) ∗B index = 11 ; break ; case 8 : i f (∗B index > 11) ∗B index = 11 ; break ; default : i f (∗B index > 13) ∗B index = 13 ; break ; } not done = 1 ; while ( not done ) { i f (B >= H∗m check [∗ H index ] [ ( ∗ B index )+1] + Bpv check [∗ H index ] [ ( ∗ B index ) +1]) { (∗B index )++; i f (m check [∗ H index ] [ ∗ B index ] == 0) return (1/ den ) ; } else { i f (B < H∗m check [∗ H index ] [ ∗ B index ] + Bpv check [∗ H index ] [ ∗ B index ] ) { (∗B index )−−; i f ( (∗B index ) == −1) { ∗B index = 0 ; return (1/ den ) ; } } 168 Appendix C. ANSI C Code of the Realized Model else not done = 0 ; } } register int h index1 = 2∗(∗H index ) ; register f loat r1 = (H − H corners [∗ H index ] ) ∗ i nv H corne r s [∗ H index ] ; register f loat he ight low = ( he i gh t va l u e s [ h index1 +1] [∗B index ] − he i gh t va l u e s [ h index1 ] [ ∗ B index ] ) ∗ r1 ; he ight low = he ight low + he i gh t va l u e s [ h index1 ] [ ∗ B index ] ; register f loat he i gh t h i gh = ( he i gh t va l u e s [ h index1 +1] [ (∗ B index )+1] − he i gh t va l u e s [ h index1 ] [ ( ∗ B index ) +1])∗ r1 ; h e i gh t h i gh = he i gh t h i gh + he i gh t va l u e s [ h index1 ] [ ( ∗ B index ) +1] ; register f loat r2 num = B − (H∗m check [∗ H index ] [ ∗ B index ] + Bpv check [∗ H index ] [ ∗ B index ] ) ; register f loat r2 den = H∗(m check [∗ H index ] [ ( ∗ B index )+1] − m check [∗ H index ] [ ∗ B index ] ) ; r2 den = r2 den + Bpv check [∗ H index ] [ ( ∗ B index )+1]− Bpv check [∗ H index ] [ ∗ B index ] ; return ( r2 den + ( ( he i gh t h i gh − he ight low ) ∗r2 num +(he ight low −1)∗ r2 den ) ∗k ) / ( r2 den ∗ den ) ; } C.8 output m Bpv.C #include ” s tda fx . h” void i n i t i a l i z e h y s t i n s t a n c e ( hy s t i n s t an c e ∗ model ) { model −>up = 1 ; (model −>STATE[ 0 ] ) .B = −1.50465 f ; (model −>STATE[ 0 ] ) .C = 1 ; (model −>STATE[ 0 ] ) .H = −1000; (model −>STATE[ 0 ] ) . j = 28 ; (model −>STATE[ 0 ] ) . r = 0 ; model −>STATE ptr = &(model −>STATE[ 0 ] ) ; model −>H index = 29 ; model −>m = 9.6864 e−005 f ; 169 Appendix C. ANSI C Code of the Realized Model model −>Bpv = −1.4078 e+000 f ; const double pi = 3.14159265358979 ; int H index o ld = 29 ; int passed data = 0 ; int c a l c da t a = 0 ; int∗ passed = &passed data ; int∗ c a l c r e v e r s e = &ca l c da t a ; int output = 0 ; int i ; const f loat dt = 1e−4 f ; f loat Hold = −1000; f loat Hin ; for ( i =0; i <9876; i++) { Hin = −999.99∗ cos (40∗ pi ∗( i +1)∗dt ) ∗exp(−dt ∗5∗( i +1) ) ; output = 0 ; while ( output != 1 ) output = output m Bpv ( H index old , passed , c a l c r e v e r s e , model , Hin , Hold ) ; H index o ld = model −>H index ; ∗passed = 0 ; ∗ c a l c r e v e r s e = 0 ; Hold = Hin ; } return ; } /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ int simple output m Bpv ( hy s t i n s t an c e ∗ hyst data , f loat B, f loat Bold ) { int va l i d = 0 ; i f ( hyst data −> up == 1) { i f (B < Bold ) { hyst data −> up = 0 ; hyst data −>H index = 29 − hyst data −>H index ; f loat dB1 = fabs ( Bold − (∗ ( hyst data −>STATE ptr ) ) .B ) ; f loat Hold = (Bold − hyst data−>Bpv) / hyst data−>m; f loat r = −(Hold + H bounds [ ( hyst data−>H index ) +1])∗ inv dH [ hyst data −>H index ] ; 170 Appendix C. ANSI C Code of the Realized Model int H end = 28 − (∗ ( hyst data −>STATE ptr ) ) . j ; f loat dH u = H bounds [ H end ] + (∗ ( hyst data −>STATE ptr ) ) .H; f loat dB u = data dB [ hyst data−>H index ] [ H end ] − data m [ ( hyst data−> H index ) −1][H end ]∗ dH u ; f loat dB l = data dB [ ( hyst data−>H index ) +1] [ H end ] − data m [ hyst data −>H index ] [ H end ]∗ dH u ; dB l = dB l − data dB [ ( hyst data−>H index ) +1] [ hyst data−>H index ] ; f loat dB2 =(dB u − dB l ) ∗ r + dB l ; dB2 = dB2 + data m [ hyst data−>H index ] [ hyst data−>H index ] ∗ ( H bounds [ hyst data−>H index ]+Hold ) ; f loat C fac to r = dB1 / dB2 ; ( hyst data −>STATE ptr )++; (∗ ( hyst data −>STATE ptr ) ) .C = C fac to r ; (∗ ( hyst data −>STATE ptr ) ) . r = r ; (∗ ( hyst data −>STATE ptr ) ) .H = Hold ; (∗ ( hyst data −>STATE ptr ) ) .B = Bold ; (∗ ( hyst data −>STATE ptr ) ) . j = hyst data−>H index −1; f loat mH = ( data m [ hyst data −>H index −1] [ hyst data −>H index ] ) ; f loat mL = ( data m [ hyst data −>H index ] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bold − m∗Hold ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ not a change o f d i r e c t i o n ∗/ i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( (∗ ( hyst data −>STATE ptr −1) ) .B <= (H bounds [ hyst data −> H index ]∗ hyst data−>m + hyst data−>Bpv) ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (B >= (∗ ( hyst data −>STATE ptr −1) ) .B) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; 171 Appendix C. ANSI C Code of the Realized Model f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data−>STATE ptr−1) ) .B; ( hyst data −>STATE ptr )−=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; return va l i d ; } } } i f (B >= (H bounds [ hyst data−>H index ]∗ hyst data−>m + hyst data−>Bpv) ) { f loat Hstar = H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −> H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; 172 Appendix C. ANSI C Code of the Realized Model } } } else { /∗ d i r e c t i o n i s downwards ∗/ i f (B > Bold ) { hyst data −> up = 1 ; hyst data −>H index = 29 − hyst data −>H index ; f loat dB1 = fabs ( Bold − (∗ ( hyst data −>STATE ptr ) ) .B ) ; f loat Hold = (Bold − hyst data−>Bpv) / hyst data−>m; f loat r = (Hold − H bounds [ ( hyst data−>H index ) +1])∗ inv dH [ hyst data−> H index ] ; int H end = 28 − (∗ ( hyst data −>STATE ptr ) ) . j ; f loat dH u = H bounds [ H end ] − (∗ ( hyst data −>STATE ptr ) ) .H; f loat dB u = data dB [ hyst data−>H index ] [ H end ] − data m [ ( hyst data−> H index ) −1][H end ]∗ dH u ; f loat dB l = data dB [ ( hyst data−>H index ) +1] [ H end ] − data m [ hyst data −>H index ] [ H end ]∗ dH u ; dB l = dB l − data dB [ ( hyst data−>H index ) +1] [ hyst data−>H index ] ; f loat dB2 =(dB u − dB l ) ∗ r + dB l ; dB2 = dB2 + data m [ hyst data−>H index ] [ hyst data−>H index ] ∗ ( H bounds [ hyst data−>H index ]−Hold ) ; f loat C fac to r = dB1 / dB2 ; ( hyst data −>STATE ptr )++; (∗ ( hyst data −>STATE ptr ) ) .C = C fac to r ; (∗ ( hyst data −>STATE ptr ) ) . r = r ; (∗ ( hyst data −>STATE ptr ) ) .H = Hold ; (∗ ( hyst data −>STATE ptr ) ) .B = Bold ; (∗ ( hyst data −>STATE ptr ) ) . j = hyst data−>H index −1; f loat mH = ( data m [ hyst data −>H index −1] [ hyst data −>H index ] ) ; f loat mL = ( data m [ hyst data −>H index ] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bold − m∗Hold ; 173 Appendix C. ANSI C Code of the Realized Model hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ not a change o f d i r e c t i o n ∗/ i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( (∗ ( hyst data −>STATE ptr −1) ) .B >= (−H bounds [ hyst data −> H index ]∗ hyst data−>m + hyst data−>Bpv) ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (B <= (∗ ( hyst data −>STATE ptr −1) ) .B) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data−>STATE ptr−1) ) .B; ( hyst data −>STATE ptr )−=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; return va l i d ; } } } i f (B <= (−H bounds [ hyst data−>H index ]∗ hyst data−>m + hyst data−>Bpv) ) { f loat Hstar = −H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −> H index ] ) ; 174 Appendix C. ANSI C Code of the Realized Model f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } } return va l i d ; } /∗−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−∗/ int output m Bpv ( int H index old , int∗ passed , int∗ c a l c r e v e r s e , hy s t i n s t an c e ∗ hyst data , f loat H, f loat Hold ) { int va l i d = 0 ; i f ( hyst data −> up == 1) { i f (∗ passed != 0) { i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( (∗ ( hyst data −>STATE ptr −1) ) .H <= H bounds [ hyst data −> H index ] ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (H >= (∗ ( hyst data −>STATE ptr −1) ) .H) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data−>STATE ptr−1) ) .B; ( hyst data −>STATE ptr )−=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; 175 Appendix C. ANSI C Code of the Realized Model f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; return va l i d ; } } } /∗ no minor loop c l o su r e in t h i s segment ∗/ i f (H >= H bounds [ hyst data−>H index ] ) { f loat Hstar = H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −> H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { i f ( (∗ ( hyst data −>STATE ptr +1) ) .H >= H bounds [ hyst data −> H index+1]) { /∗ curren t segment conta ins p r e v i o u s l y processed minor loop c l o su r e ∗/ i f ( H < (∗ ( hyst data −>STATE ptr +1) ) .H) { /∗ i s the r e v e r s a l o f the c l o s u r e o f a minor loop requ i r ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr + 1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; 176 Appendix C. ANSI C Code of the Realized Model Bstar = (∗ ( hyst data−>STATE ptr+1) ) .B; ( hyst data −>STATE ptr )+=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; (∗ passed )−−; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } else { /∗ r e v e r s a l o f minor loop not r e qu i r ed ∗/ i f (H < H bounds [ hyst data −>H index+1]) { f loat Hstar = H bounds [ hyst data −>H index +1] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )++; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; 177 Appendix C. ANSI C Code of the Realized Model hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } } } else { /∗ not processed minor loop c l o su r e t h i s t imes t ep ∗/ i f ( (H < Hold ) && ( ( hyst data−>H index == H index o ld ) | | ( 2 9 − hyst data−>H index == H index o ld ) ) ) { hyst data −> up = 0 ; hyst data −>H index = 29 − hyst data −>H index ; f loat Bold = Hold∗hyst data−>m + hyst data−>Bpv ; f loat dB1 = fabs ( Bold − (∗ ( hyst data −>STATE ptr ) ) .B ) ; i f (dB1 == 0) ( hyst data −>STATE ptr )−−; else { /∗ proces s change in d i r e c t i o n ∗/ i f (∗ c a l c r e v e r s e == 1) /∗=1 i f data f o r r e v e r s a l was c a l c u l a t e d in a prev ious i t e r a t i o n ∗/ ( hyst data −>STATE ptr )++; else { f loat r = −(Hold + H bounds [ ( hyst data−> H index ) +1])∗ inv dH [ hyst data−>H index ] ; int H end = 28 − (∗ ( hyst data −>STATE ptr ) ) . j ; f loat dH u = H bounds [ H end ] + (∗ ( hyst data −> STATE ptr ) ) .H; f loat dB u = data dB [ hyst data−>H index ] [ H end ] − data m [ ( hyst data−>H index ) −1][H end ]∗ dH u ; f loat dB l = data dB [ ( hyst data−>H index ) +1] [ H end ] − data m [ hyst data−>H index ] [ H end ]∗ dH u ; dB l = dB l − data dB [ ( hyst data−>H index ) +1] [ hyst data−>H index ] ; f loat dB2 =(dB u − dB l ) ∗ r + dB l ; 178 Appendix C. ANSI C Code of the Realized Model dB2 = dB2 + data m [ hyst data−>H index ] [ hyst data−>H index ] ∗ ( H bounds [ hyst data−> H index ]+Hold ) ; f loat C fac to r = dB1 / dB2 ; ( hyst data −>STATE ptr )++; (∗ ( hyst data −>STATE ptr ) ) .C = C fac to r ; (∗ ( hyst data −>STATE ptr ) ) . r = r ; (∗ ( hyst data −>STATE ptr ) ) .H = Hold ; (∗ ( hyst data −>STATE ptr ) ) .B = Bold ; (∗ ( hyst data −>STATE ptr ) ) . j = hyst data−> H index −1; ∗ c a l c r e v e r s e = 1 ; } f loat mH = ( data m [ hyst data −>H index −1] [ hyst data −> H index ] ) ; f loat mL = ( data m [ hyst data −>H index ] [ hyst data −> H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bold − m∗Hold ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } } else { /∗ not a change o f d i r e c t i o n ∗/ i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( (∗ ( hyst data −>STATE ptr −1) ) .H <= H bounds [ hyst data −>H index ] ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (H >= (∗ ( hyst data −>STATE ptr −1) ) .H) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data−>STATE ptr−1) ) .B; 179 Appendix C. ANSI C Code of the Realized Model ( hyst data −>STATE ptr )−=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; return va l i d ; } } } i f (H >= H bounds [ hyst data−>H index ] ) { f loat Hstar = H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { i f (H < H bounds [ hyst data −>H index+1]) { f loat Hstar = H bounds [ hyst data −>H index +1] ; 180 Appendix C. ANSI C Code of the Realized Model f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )++; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } } } } else { /∗ d i r e c t i o n i s downwards ∗/ i f (∗ passed != 0) { i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( −(∗( hyst data −>STATE ptr −1) ) .H <= H bounds [ hyst data −> H index ] ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (H <= (∗ ( hyst data −>STATE ptr −1) ) .H) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data −>STATE ptr −1) ) .B; ( hyst data −>STATE ptr )−=2; 181 Appendix C. ANSI C Code of the Realized Model f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; (∗ passed )++; return va l i d ; } } } /∗ no minor loop c l o su r e in t h i s segment ∗/ i f (−H >= H bounds [ hyst data−>H index ] ) { f loat Hstar = −H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −> H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { i f ( −(∗( hyst data −>STATE ptr +1) ) .H >= H bounds [ hyst data −> H index+1]) { /∗ curren t segment conta ins p r e v i o u s l y processed minor loop c l o su r e ∗/ i f ( H > (∗ ( hyst data −>STATE ptr +1) ) .H) { /∗ i s the r e v e r s a l o f the c l o s u r e o f a minor loop requ i r ed ∗/ 182 Appendix C. ANSI C Code of the Realized Model f loat Hstar = (∗ ( hyst data −>STATE ptr + 1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; Bstar = (∗ ( hyst data−>STATE ptr+1) ) .B; ( hyst data −>STATE ptr )+=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; (∗ passed )−−; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } else { /∗ r e v e r s a l o f minor loop not r e qu i r ed ∗/ i f (−H < H bounds [ hyst data −>H index+1]) { f loat Hstar = −H bounds [ hyst data −>H index +1] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )++; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; 183 Appendix C. ANSI C Code of the Realized Model hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } } } else { /∗ not processed minor loop c l o su r e t h i s t imes t ep ∗/ i f ( (H > Hold ) && ( ( hyst data−>H index == H index o ld ) | | ( 2 9 − hyst data−>H index == H index o ld ) ) ) { hyst data −> up = 1 ; hyst data −>H index = 29 − hyst data −>H index ; f loat Bold = Hold∗hyst data−>m + hyst data−>Bpv ; f loat dB1 = fabs ( Bold − (∗ ( hyst data −>STATE ptr ) ) .B ) ; i f (dB1 == 0) ( hyst data −>STATE ptr )−−; else { /∗ proces s change in d i r e c t i o n ∗/ i f (∗ c a l c r e v e r s e == 1) /∗=1 i f data f o r r e v e r s a l was c a l c u l a t e d in a prev ious i t e r a t i o n ∗/ ( hyst data −>STATE ptr )++; else { f loat r = (Hold − H bounds [ ( hyst data−>H index ) +1])∗ inv dH [ hyst data−>H index ] ; int H end = 28 − (∗ ( hyst data −>STATE ptr ) ) . j ; f loat dH u = H bounds [ H end ] − (∗ ( hyst data −> STATE ptr ) ) .H; f loat dB u = data dB [ hyst data−>H index ] [ H end ] − data m [ ( hyst data−>H index ) −1][H end ]∗ dH u ; f loat dB l = data dB [ ( hyst data−>H index ) +1] [ H end ] − data m [ hyst data−>H index ] [ H end ]∗ dH u ; dB l = dB l − data dB [ ( hyst data−>H index ) +1] [ hyst data−>H index ] ; f loat dB2 =(dB u − dB l ) ∗ r + dB l ; 184 Appendix C. ANSI C Code of the Realized Model dB2 = dB2 + data m [ hyst data−>H index ] [ hyst data−>H index ] ∗ ( H bounds [ hyst data−> H index ]−Hold ) ; f loat C fac to r = dB1 / dB2 ; ( hyst data −>STATE ptr )++; (∗ ( hyst data −>STATE ptr ) ) .C = C fac to r ; (∗ ( hyst data −>STATE ptr ) ) . r = r ; (∗ ( hyst data −>STATE ptr ) ) .H = Hold ; (∗ ( hyst data −>STATE ptr ) ) .B = Bold ; (∗ ( hyst data −>STATE ptr ) ) . j = hyst data−> H index −1; ∗ c a l c r e v e r s e = 1 ; } f loat mH = ( data m [ hyst data −>H index −1] [ hyst data −> H index ] ) ; f loat mL = ( data m [ hyst data −>H index ] [ hyst data −> H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bold − m∗Hold ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } } else { /∗ not a change o f d i r e c t i o n ∗/ i f ( hyst data −>STATE ptr != &(hyst data −>STATE[ 0 ] ) ) { /∗ Does s t a c k po in t e r not po in t to f i r s t en try ∗/ i f ( −(∗( hyst data −>STATE ptr −1) ) .H <= H bounds [ hyst data −>H index ] ) { /∗ curren t segment conta ins a c l o su r e o f a minor loop ∗/ i f (H <= (∗ ( hyst data −>STATE ptr −1) ) .H) { /∗ has the minor loop c l o s ed ∗/ f loat Hstar = (∗ ( hyst data −>STATE ptr −1) ) .H; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; 185 Appendix C. ANSI C Code of the Realized Model Bstar = (∗ ( hyst data−>STATE ptr−1) ) .B; ( hyst data −>STATE ptr )−=2; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; (∗ passed )++; return va l i d ; } } } i f (−H >= H bounds [ hyst data−>H index ] ) { f loat Hstar = −H bounds [ hyst data −>H index ] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )−−; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { i f (−H < H bounds [ hyst data −>H index+1]) { 186 Appendix C. ANSI C Code of the Realized Model f loat Hstar = −H bounds [ hyst data −>H index +1] ; f loat Bstar = ( hyst data −>m) ∗Hstar + hyst data−>Bpv ; ( hyst data −>H index )++; f loat mH = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j ] [ hyst data −>H index ] ) ; f loat mL = ( data m [ ( ∗ ( hyst data −>STATE ptr ) ) . j +1] [ hyst data −>H index ] ) ; f loat m = (mH−mL) ∗ (∗ ( hyst data −>STATE ptr ) ) . r + mL; m = m∗ (∗ ( hyst data −>STATE ptr ) ) .C; f loat Bpv = Bstar − m∗Hstar ; hyst data −>m = m; hyst data −>Bpv = Bpv ; } else { /∗ s o l u t i o n i s bounded and v a l i d ∗/ va l i d =1; } } } } } return va l i d ; } 187
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- A dynamic circuit-based model for ferromagnetic materials
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
A dynamic circuit-based model for ferromagnetic materials Wicks, Kenneth 2008
pdf
Notice for Google Chrome users:
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.
If you are having trouble viewing or searching the PDF with Google Chrome, please download it here instead.
Page Metadata
Item Metadata
Title | A dynamic circuit-based model for ferromagnetic materials |
Creator |
Wicks, Kenneth |
Publisher | University of British Columbia |
Date Issued | 2008 |
Description | In recent years there has been increased interest in the development of sensorless switched reluctance machine drives. The proper operation of a switched reluctance machine (SRM) requires knowledge of the position of the rotor of the machine. The inclusion of a physical position sensor compromises the inherent robustness of this type of machine. Thus, there has been a need to develop techniques to estimate the position of the rotor in SRM drives. Switched reluctance machines are able to operate over a large range in speed. A fully loaded SRM is typically designed to saturate the ferromagnetic material that comprises the stator and rotor of the machine whereas a lightly loaded machine does not. Therefore, the model of the machine should be able to handle both a large range in frequency and input excitation levels of the magnetic material in the machine. The development of a new dynamic circuit-based ferromagnetic model is described in this thesis. The investigation of the behaviour of 24 gauge M19 silicon steel led to the conclusion that, for this material, a circuit model that has static parameters is unable to accurately reproduce the behaviour of the actual material over a large range of input frequencies and excitation levels without resorting to retuning the parameters of the model. This thesis provides two new mechanisms that dynamically adjust the resistance values of the flux tubes of the model. Comparisons using a normalized vertical least-squares metric between the newly proposed dynamic model and a model that has static resistance values clearly show the improvement that is gained by using these mechanisms. A practical implementation of the new model is also given. Timing using a general purpose CPU shows that this implementation of the model will most likely be able to be used as part of a multi-phase lumped parameter model for a SRM in realtime. |
Extent | 8922930 bytes |
Subject |
Ferromagnetic Dynamic circuit-based SRM |
Genre |
Thesis/Dissertation |
Type |
Text |
FileFormat | application/pdf |
Language | eng |
Date Available | 2008-03-26 |
Provider | Vancouver : University of British Columbia Library |
Rights | Attribution-NonCommercial-NoDerivatives 4.0 International |
DOI | 10.14288/1.0064768 |
URI | http://hdl.handle.net/2429/614 |
Degree |
Doctor of Philosophy - PhD |
Program |
Electrical and Computer Engineering |
Affiliation |
Applied Science, Faculty of Electrical and Computer Engineering, Department of |
Degree Grantor | University of British Columbia |
GraduationDate | 2008-05 |
Campus |
UBCV |
Scholarly Level | Graduate |
Rights URI | http://creativecommons.org/licenses/by-nc-nd/4.0/ |
AggregatedSourceRepository | DSpace |
Download
- Media
- 24-ubc_2008_spring_wicks_kenneth.pdf [ 8.51MB ]
- Metadata
- JSON: 24-1.0064768.json
- JSON-LD: 24-1.0064768-ld.json
- RDF/XML (Pretty): 24-1.0064768-rdf.xml
- RDF/JSON: 24-1.0064768-rdf.json
- Turtle: 24-1.0064768-turtle.txt
- N-Triples: 24-1.0064768-rdf-ntriples.txt
- Original Record: 24-1.0064768-source.json
- Full Text
- 24-1.0064768-fulltext.txt
- Citation
- 24-1.0064768.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
data-media="{[{embed.selectedMedia}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.24.1-0064768/manifest