SlideShare a Scribd company logo
Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.com
Practical Control of Electric Machines Model Based
Design and Simulation 1st Edition Rubén Molina
Llorente
https://ebookmeta.com/product/practical-control-of-electric-
machines-model-based-design-and-simulation-1st-edition-
ruben-molina-llorente/
OR CLICK HERE
DOWLOAD EBOOK
Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com
Advances in Industrial Control
Rubén Molina Llorente
Practical
Control
of Electric
Machines
Model-Based Design and Simulation
Advances in Industrial Control
Series Editors
Michael J. Grimble, Industrial Control Centre, University of Strathclyde, Glasgow,
UK
Antonella Ferrara, Department of Electrical, Computer and Biomedical
Engineering, University of Pavia, Pavia, Italy
Editorial Board
Graham Goodwin, School of Electrical Engineering and Computing, University of
Newcastle, Callaghan, NSW, Australia
Thomas J. Harris, Department of Chemical Engineering, Queen’s University,
Kingston, ON, Canada
Tong Heng Lee, Department of Electrical and Computer Engineering, National
University of Singapore, Singapore, Singapore
Om P. Malik, Schulich School of Engineering, University of Calgary, Calgary, AB,
Canada
Kim-Fung Man, City University Hong Kong, Kowloon, Hong Kong
Gustaf Olsson, Department of Industrial Electrical Engineering and Automation,
Lund Institute of Technology, Lund, Sweden
Asok Ray, Department of Mechanical Engineering, Pennsylvania State University,
University Park, PA, USA
Sebastian Engell, Lehrstuhl für Systemdynamik und Prozessführung, Technische
Universität Dortmund, Dortmund, Germany
Ikuo Yamamoto, Graduate School of Engineering, University of Nagasaki,
Nagasaki, Japan
Advances in Industrial Control is a series of monographs and contributed titles focusing on
the applications of advanced and novel control methods within applied settings. This series
has worldwide distribution to engineers, researchers and libraries.
The series promotes the exchange of information between academia and industry, to
which end the books all demonstrate some theoretical aspect of an advanced or new control
method and show how it can be applied either in a pilot plant or in some real industrial
situation. The books are distinguished by the combination of the type of theory used and the
type of application exemplified. Note that “industrial” here has a very broad interpretation; it
applies not merely to the processes employed in industrial plants but to systems such as
avionics and automotive brakes and drivetrain. This series complements the theoretical and
more mathematical approach of Communications and Control Engineering.
Indexed by SCOPUS and Engineering Index.
Proposals for this series, composed of a proposal form downloaded from this page, a draft
Contents, at least two sample chapters and an author cv (with a synopsis of the whole project,
if possible) can be submitted to either of the:
Series Editors
Professor Michael J. Grimble
Department of Electronic and Electrical Engineering, Royal College Building, 204
George Street, Glasgow G1 1XW, United Kingdom
e-mail: m.j.grimble@strath.ac.uk
Professor Antonella Ferrara
Department of Electrical, Computer and Biomedical Engineering, University of
Pavia, Via Ferrata 1, 27100 Pavia, Italy
e-mail: antonella.ferrara@unipv.it
or the
In-house Editor
Mr. Oliver Jackson
Springer London, 4 Crinan Street, London, N1 9XW, United Kingdom
e-mail: oliver.jackson@springer.com
Proposals are peer-reviewed.
Publishing Ethics
Researchers should conduct their research from research proposal to publication in line with
best practices and codes of conduct of relevant professional bodies and/or national and
international regulatory bodies. For more details on individual ethics matters please see:
https://www.springer.com/gp/authors-editors/journal-author/journal-author-helpdesk/
publishing-ethics/14214
More information about this series at http://www.springer.com/series/1412
Rubén Molina Llorente
Practical Control of Electric
Machines
Model-Based Design and Simulation
123
Rubén Molina Llorente
BASc & MSC in Electronic Engineering
Universitat de Barcelona
Barcelona, Spain
ISSN 1430-9491 ISSN 2193-1577 (electronic)
Advances in Industrial Control
ISBN 978-3-030-34757-4 ISBN 978-3-030-34758-1 (eBook)
https://doi.org/10.1007/978-3-030-34758-1
© Springer Nature Switzerland AG 2020
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part
of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publication does not imply, even in the absence of a specific statement, that such names are exempt from
the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, expressed or implied, with respect to the material contained
herein or for any errors or omissions that may have been made. The publisher remains neutral with regard
to jurisdictional claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Dedicated to my family and friends in special
to my wife Núria and my daughter Martina.
Rubén Molina Llorente
Series Editor’s Foreword
Control system engineering is viewed very differently by researchers and those that
must implement designs. The former group develops general algorithms with a
strong underlying mathematical basis, while the latter have more local concerns
over the limits of equipment, quality of control, and plant downtime. The series
Advances in Industrial Control attempts to bridge this divide and hopes to
encourage the adoption of more advanced control techniques when they are ben-
eficial. The rapid development of new control theory and technology has an impact
on all areas of control engineering and applications. This monograph series
encourages the development of more targeted control theory that is driven by the
needs and challenges of applications. A focus on applications is essential if the
different aspects of the control design problem are to be explored with the same
dedication that control synthesis problems have received. The series provides an
opportunity for researchers to present an extended exposition of new work on
advanced control, raising awareness of the substantial benefits, and exploring the
challenges that can arise.
One of the unusual features of this monograph is that it deals with implemen-
tation problems very often neglected in more academic texts, drawing upon the
author’s very relevant application experience. Chapter 1 sets the tone, being con-
cerned with embedded control systems. Problems in real-time implementation of
control systems have become more onerous now that most advanced control system
designs are “model-based.” They have many advantages and allow for the
multi-input multi-output nature of a process or machine explicitly, but implemen-
tation can be problematic. This first chapter is very wide-ranging, covering areas
such as “hardware-in-the-loop testing, software tools, and system architectures.”
Chapter 2 involves electrical machine control problems covering a range of
classical and fuzzy control methods, and dealing with well-known problems in
digital implementation. Various structures for control systems such as feedforward
and feedback control systems and cascade control structures are considered. The
problems of digital implementation are again considered from a practical viewpoint,
describing the type of equipment involved. It is unusual for an introduction to
classical PI or PID control to be extended into a discussion of real implementation
vii
issues. This should be particularly valuable to engineers in industry. The material
on fuzzy control is also interesting and includes a useful electric machine speed
control application.
Chapter 3 deals with three-phase electrical systems which are of course very
common for use with motor control systems. In this case, the material is more basic
electrical engineering but written from a control engineer’s perspective. This pro-
vides an introduction to some of the material in Chap. 4 on the fundamentals of
electrical machines. From a control viewpoint, it is important to consider the
non-linearities mentioned in these systems. The general model information should
also be valuable to those simulating such systems. This overview of electrical
machine types will be particularly helpful to control engineers that often use very
simplified models and do not need to cover the detailed electromagnetic charac-
teristics of such machines. It is also a reminder that the viewpoint of an electrical
engineer in terms of vector diagrams of machine currents is rather different to the
usual control engineer’s transient characteristic investigations.
Chapter 5 on modeling electrical machines returns to more familiar territory for
the control engineer dealing with state-space systems and how they may be used to
represent AC or DC machines. The discussions extend into simulation of these
systems. Chapter 6 is concerned with measurements in electrical drive systems.
This is also a topic which is often neglected in more academic texts but from a
practical viewpoint is important since faults in systems can often be traced back to
problems with measurements. There is a useful overview of the different types of
sensors used and their characteristics.
Chapter 7 is concerned with microcontrollers for electric drive systems. Most
texts avoid the details of technology since these change so rapidly; however, from a
process or commissioning engineer’s perspective it is one of the most important
areas to understand. The different modules involved and timing problems are dis-
cussed, and aspects of analogue-to-digital conversion are covered. A family of
microcontrollers is described, and the simulation of systems, including the
machines and component parts, is considered.
Chapter 8 deals with three-phase voltage-source inverters for high-performance
control of three-phase machines. This is another area where a good understanding
of the power electronics is useful for both simulating the system and understanding
the noise and uncertainties that are present. This is valuable when treating control
problems and breakdowns. Chapter 9 is concerned with the topic of space vector
modulation. Chapter 10 returns to more familiar territory dealing with the practical
control of AC machines. It describes the speed and current loops using a DC
machine as an introduction to AC machine vector control. The familiar tools of
Bode diagrams and transient time responses are used. The block diagrams of var-
ious machine control systems are helpful, and topics such as sensorless control are
explored.
Chapter 11 is concerned with model-in-the-loop development in vector control
of induction machines. Control loop analysis is performed, and all aspects of
simulation and implementation are discussed. The application to electric vehicle
and electric aircraft propulsion control systems is particularly interesting and
viii Series Editor’s Foreword
topical. This is of course a hugely important topic in the automotive and aircraft
industry at present.
The book contains appendices that also cover practical material needed by
design engineers and their commissioning colleagues. This text is therefore a
valuable contribution to the Advances in Industrial Control series, bridging the gap
between the electrical engineer and the control engineer, and going far into the
application and equipment aspects of producing a real working control system.
Glasgow, UK
October 2019
Michael J. Grimble
Series Editor’s Foreword ix
Preface
It is well known that electric machines are widely used in numerous applications.
Nowadays, recent applications such as electrified aircraft propulsion (EAP) use
propulsors (propeller or fans) driven by electric machines. In the aviation sector, the
electric machines and power converters should meet a power density 2–3 times
state of the art in the MW power range, with efficiencies higher than 96 and 99%,
respectively. In the last few years, applications such as drones and traction
machines in electric vehicles are being a challenge because the demands in terms of
efficiency and durability are also considerable. Renewable energies also consist of
continuous improvement in terms of the efficiency of the energy developed.
The advanced design of the AC machines with finite element analysis
(FEA) increasingly allows obtaining high-performance designs and high power
density machines which together with sophisticated control systems and the
appropriate hardware continue to optimize their operation in a wide range of speed.
The result is that lower-performance machines such as brushed machines are being
displaced in many applications.
The electric machine systems are a multidisciplinary area. The machine design,
the mechanical systems, the electronic hardware composed by the power semi-
conductors, sensors, actuators, and the embedded systems are designed together
with the collaboration of multidisciplinary engineering teams to guarantee success.
Furthermore, the new engineering design process and new sophisticated
co-simulation tools accelerate the time to market of the motor control units (MCUs)
with high-quality results.
The speed/torque variation in electromechanical systems where the speed/torque
is adapted according to the necessity of the system is the role of the electric drives.
The control system of these drives and therefore the control of the machine are
increasingly complex systems and usually consist of microprocessed embedded
systems. During the last few years, the increase of the embedded system complexity
in electrical machine control applications involves an increase of the model-based
design (MBD) where the lines of code are mostly replaced by code generated on
tested models in a personal computer environment. MBD provides a mathematical
and visual approach to develop complex control systems. During the development
xi
process, models of the systems can be used for design, analysis, simulation, veri-
fication, and automatic code generation for the embedded systems. MBD is
transforming the way of working of engineers and scientists since the design tasks
of the laboratory and field are moved to a simulation environment in a desktop. The
simulation and verification tools allow to test, refine, and retest the models without
to build prototypes. Different test stages as model-in-the-loop (MiL) and
software-in-the-loop (SiL) can be carried out in the MBD process. The MBD,
together with appropriate software architecture patterns, guarantees success in the
motor control units (MCUs). The automotive industry is one of the industries which
applies this modern design methodology where the benefits can be observed today.
There is wonderful control of electric machine books based on the experience
of their authors. However, in this book, the intention has been to dedicate as much
as possible to the practical application of how the control of an electric machine
could be carried out with the modern tools available today in an efficient manner.
The book consists of twelve chapters. Chapter 1 describes the modern design
technics based on MBD, the V-model, the computation simulation software
packages, and the software architecture patterns. Chapter 2 discusses the basic
regulation based on classic controllers such as the proportional–integral–differential
(PID), different control structures, digitalization methods for PIDs, aliasing,
zero-order hold, quantifiers, and time delays, and with examples and simulations
including a controller based on fuzzy logic. Chapter 3 discusses three-phase sys-
tems mostly used in AC machines. The three-phase systems with star and delta
connections are analyzed. The power calculation with practical explanations is also
analyzed, being the prelude to the in-depth analysis of the mathematical tools that
facilitate the analysis of AC machines. Furthermore, practical graphics and exam-
ples of a digital implementation of mathematical axis transformations (Clarke and
Park transformations), RMS, and electric power computations are represented.
In Chap. 4, is shown a classification of the most common electrical machines
starting with the more traditional machines such as the DC-brushed and induction
machines (IMs), and finishing with more sophisticated machines such as the per-
manent magnet-assisted synchronous reluctance machine (PMASynRM). Their
primary structures, their mathematical expressions in a steady-state, in space vector,
in dqs transformations, and the electromagnetic torque expression for each machine
are shown. Moreover, basic concepts of machine design, sections of different
machines, and simulation results are introduced based on Altair, Flux™, and
FluxMotor™ FEA software package. Chapter 5 is a continuation of Chap. 4 where
it described the models with continuous state-space methods of the DC and the
different AC machines such as IM, permanent magnet synchronous machine
(PMSM), SynRM, and PMASynRM. As an example of the utility of the discrete
models, the PMASynRM is described with its discrete model for its implementation
in Simulink®
, which can be used for C code generation, to be able to run it in real
time in a DSP or FPGA. As a prelude of the next chapters, the closed-loop control
of the current loops is introduced to verify the effect produced by the inherent
cross-coupling of the AC machines, as well as a solution to the decoupling that
optimizes its control.
xii Preface
Chapter 6 is reserved to treat a different subject as sensors and sensing circuits
used in most of the DC and AC drives. Voltage, current, temperature, speed, and
position are the basic measurements in the machine control applications for control
algorithms and its protection in fail situations such as locked rotor or overtem-
peratures. In some applications, the control part should be isolated from the power
stage, which is typically fed by high voltage. Then, as some of the sensors should
be directly connected to the high-voltage side, some isolation mechanism should be
used as it is shown in this chapter. In this chapter, the design of the above mea-
surement variables with its hardware signal conditioning, software strategies, and
experimental results is deeply analyzed for the proper design of high-performance
machine control.
With the same purpose as Chap. 6, another subject about the knowledge of the
standard microcontroller/DSP peripherals used in the implementation of the electric
machine control such as I/O, timers, and A/D converters is reserved for Chap. 7.
Specific features and functions such as smart high-resolution pulse width modu-
lation (PWM) timers and Delta-Sigma A/D converters are also treated in detail. The
high-resolution PWM signals help to generate smoother sinusoidal waveforms with
high-frequency fine-tuning, while Delta-Sigma A/D converters allow measuring the
machine phase current accurately. The microcontroller/DSP peripherals, as well as
the CPU performance, are determinant for the microcontroller/DPS selection, but it
should be in agreement with the application. The GTM Timer module from Bosch
is an example of a smart high-resolution timer which can be found as an intellectual
property (IP) integrated into different microcontroller manufacturers. In this chapter,
A/D converters and specific peripherals for high-performance machine control are
covered with simulations and real implementation examples for the AURIX™
family of Infineon and RX600 family of Renesas.
After describing the previous chapters, the reader can be more comfortable with
Chap. 8, which discusses all necessary knowledge needed to design a
voltage-source inverter (VSI). The voltage-source inverter (VSI) is a fundamental
power electronic drive where high-performance control for three-phase electrical
machines can be achieved. The continuous improvement of power devices that
increasingly improve their performance, such as high electron mobility transistor
(HEMT) devices, allows higher efficiencies and more and more wide range of use.
The inverter not only is a three-phase bridge made by three half-bridge legs but also
needs other elements for its correct operation. The stability of the voltage source
required by the three-phase bridge is a key to optimizing its performance. Also, the
inverter and machine protection elements allow having a safe behavior in the
abnormal situations that prevent its destruction and other near components. These
protection elements join the control logic and constitute the motor control unit
(MCU). The analysis of the switching and conduction losses in the power devices is
analyzed in detail, as well as the effects of capacitances, inductances, and parasitic
resistances. The key elements, such as gate drivers, are also analyzed, even for
devices in parallel. The effects of high dv/dt are also analyzed, especially when the
length of the connection power cable between the inverter and the machine is
considerable, providing different solutions such as the use of sinusoidal filters. In
Preface xiii
this chapter, all the necessary parts for the design of a VSI for control of three-phase
machines are entered in detail, providing experimental results and simulations for
better understanding, as well as a complete model of a VSI (power plant).
Once minimum knowledge of the VSI is acquired in Chap. 8, in Chap. 9 is
discussed the space vector modulation (SVM), also known as SVPWM. SVM is
increasingly replacing more traditional modulations such as six-step and sinusoidal
modulation as it provides better use of the available DC-link voltage and a
reduction in harmonic content. The model-based design is approached for SVM
algorithm development which is tested to assure a correct operation before its
implementation in real hardware. The theory of SVM in its two modes, continuous
and discontinuous, deadtime compensation, model-based design using MATLAB
and Simulink, simulations, and the experimental results are treated.
Chapter 10 comes back to the machine control by using high-performance
control system as field-oriented control. The electric machine based on a control
system with the machine model is not a simple task but requires necessary simu-
lation tools to understand its basic operation. The complexity of their models
suggests performing first simulations in both open and closed loops, without using
an electric drive (VSI or DC servo stage). High-performance control, such as vector
control for AC machines, can be achieved with excellent results by using suitable
simulations. The chapter starts with the speed and current loop control theory of the
rotation loads for DC machine, which is used as an introduction of AC machine
vector control. Some simulation results with and without electric drive are illus-
trated. The chapter continues with the theoretical and practical part of vector control
through simulations without electric drive, as well as the practical development of
magnitude and position flux observers, and estimators for sensorless systems. The
most relevant AC machines on the market are covered, as seen in Chap. 4.
Chapter 11, which discusses the model-based design (MBD) process in a
field-oriented control for induction machines. Two induction machines are pre-
sented, one with 5 HP of power for industrial purposes and other with 110 HP of
power for electric vehicle (EV) application or full electric aircraft propulsion pro-
peller (one of my many passions), both with a three-phase VSI. The MBD is
increasingly used in the field of electrical machine control because of the numerous
advantages it offers, such as improving product quality and reducing development
time. MBD is transforming the way of working of engineers and scientists since the
design tasks of the laboratory and field are moved to a simulation environment in a
desktop. The control system of an electrical machine can be rapidly prototyped
using a simulation environment while in parallel the software architecture necessary
for its implementation in a microcontroller or DSP can be discussed and designed.
The success of these two steps guarantees a better performance of the
model-in-the-loop (MiL), which is where the control of the machine on a simulated
plant is evaluated, with a certain level of realism. If the control requirements are
minimally met, where most of the errors are solved, the automatic code generation
allows performing tests with the real plant, or on a processor-in-the-loop (PiL) or
hardware-in-the-loop (HiL) scenarios. In EV/HEV automotive systems, the plant is
the vehicle which is also modeled to evaluate the control of the electric machine.
xiv Preface
In the Chap. 12 is treated a possible real-time model for emulation purpose of the
machine and VSI. For faster development, the hardware composed by the machine,
inverter, and controller can be replaced by a precise real-time model for emulation.
The control systems increasingly use their verification and development through a
digitized plant on an field-programmable gate array (FPGA) platform so that control
algorithms can be evaluated without the need for real hardware, in this case an
inverter and an electric machine. However, real-time simulation of electric machine
models and the VSI can be especially complicated due to the rapid nature of the
dynamics, that is, reduced time constants, especially on very low power machines.
The switching of PWM signals of up to tens of kHz requires sampling rates of the
order of several MHz to obtain reasonable accuracy, for example, to model the
ripple produced by the PWM in the inductance of the machine. That is why FPGAs
are the ideal platform for complex real-time simulations due to their ability to
process data in parallel allowing sampling and execution rates up to the MHz range.
To arouse the curiosity of the readers, in the second part of the Appendix, it
presented simulation detail of results performed with FluxMotor™ according to a
similar machine analyzed in Chap. 4 in motor and generator mode. It corresponds to
a 55 kW IPMSM machine with 48 stator slots, 8 poles, and permanent magnets
mounted in V-pole configuration in the rotor. The construction details are deeply
explained. To have an idea of the size, the machine has an external stator radius of
134.5 mm and a stack length of 84 mm. The total mass of the machine is 32.137
Kg, which means a power density of 1.7 kW/Kg. Due to this power density and
other factors, the application of this machine can be for electric vehicles.
The book is intended for a wide variety of readers because during the expla-
nations, my intention has always been to explain the theory as I would have liked it.
The different readers can be academia and industry researchers, graduate students
and their professors, engineers, and practitioners who are working in the field of the
machine control systems for any industrial sector. The theory is always necessary,
but I have intended to keep practical descriptions as much as possible. For students
and newcomers, the main prerequisites are undergraduate courses on system control
theory, basics in electric machines, and power electronics.
The simulations and experimental results in this book have been developed
thanks to my 16 years of experience in power electronics and control systems,
especially in machine control systems from which I decide to graduate with a final
degree project based on field-oriented control for induction machine in 2003. In my
modest opinion, this book is a book that I wish had during my years of research
since it would have greatly facilitated my understanding of the control of electric
machines thanks to its practical contribution.
Preface xv
Lastly, I give my special thanks and love to my wife, Núria, who will always be
at my side, for her patience during these last 3 years which I have been very busy
preparing this book.
Barcelona, Spain
October 2019
Rubén Molina Llorente
Acknowledgements I would like to particularly thank the following persons (in alphabetical
order) for their contributions: Ph.D. Ramón Bargalló Perpiñà (Polytechnic University of
Catalonia), Isabelle Feix (Infineon Technologies AG), Jasmin Hamp (AUTOSAR), Hua Jin
(Powersim), Vincent Leconte (Altair Engineering Inc.), Amadeo Tierno (Altair Engineering Inc.),
Bernd Westhoff (Renesas Electronics Corporation). In addition, I would like to thank MathWorks.
xvi Preface
Trademark Acknowledgements
1. MATLAB®
, Simulink®
, Stateflow®
and Simscape Electrical™ (formerly
SimPowerSystems™ and SimElectronics®
) are registered trademarks or trade-
marks of The MathWorks, Inc. For more information and a list of additional
trademarks contact:
The MathWorks, Inc., 1 Apple Hill Drive, Natick, MA 01760-2098, USA
Web: mathworks.com/trademarks for a list of additional trademarks.
2. PSIM is a registered trademark of Powersim Inc. For more information, please
contact:
Powersim, Inc., 2275 Research Blvd, Suite 500, Rockville, MD 20850, USA
E-mail: info@powersimtech.com, Web: www.powersimtech.com
3. Altair™ and FluxMotor™ is a registered trademark of Altair Engineering, Inc.
For more information, please contact:
Altair Engineering, Inc., 1820 E. Big Beaver Rd., Troy, MI 48083, USA
Phone: +1 (248) 614-2400
Fax: +1 (248) 614-2411
Web: www.altair.com
4. TEKTRONIX is a registered trademarks of Tektronix, Inc. For more informa-
tion, please contact:
Tektronix, Inc., 14150 SW Karl Braun Drive, P.O. Box 500 Beaverton, OR
97077, USA
Web: www.tek.com
5. Teledyne LeCroy is a registered trademark of Teledyne LeCroy, Inc. For more
information, please contact:
Teledyne LeCroy, Inc., 700 Chestnut Ridge Road, Chestnut Ridge, NY
10977-6499, USA
Phone: +1 800-553-2769 or +1 845-425-2000
Web: www.teledynelecroy.com
xvii
6. AUTOSAR is a trademark of AUTOSAR GbR. The word AUTOSAR and the
AUTOSAR logo are registered trademarks. For more information, please
contact:
Frankfurter Ring 224, 80807 Munich, Germany
Phone: +49 (89) 452450-395
7. AURIXTM and TriCore®
are a trademark of Infineon Technologies AG. For
more information, please contact:
Infineon Technologies AG, IFAG C EC MR, Am Campeon 1-15, 85579
Neubiberg, Germany
8. AUDI is a trademark of AUDI AG. For more information, please contact:
Ettinger Street, 85057 Ingolstadt, Bavaria, Germany
9. Renesas and the Renesas logo are trademarks of Renesas Electronics. For more
information, please contact:
TOYOSU FORESIA, 3-2-24 Toyosu, Koto-ku, Tokyo, 135-0061, Japan
Web: www.renesas.com
10. BOSCH is a trademark of Robert Bosch GMBH. For more information, please
contact:
Robert Bosch GmbH, Postfach 13 42, 72703 Reutlingen, Germany
Web: www.bosch.com
11. SIEMENS is a trademark of Siemens Aktiengesellschaft. For more information,
please contact:
Siemens Aktiengesellschaft, Werner-von-Siemens-Straße, 180333 Munich,
Germany
Web: www.siemens.com
xviii Trademark Acknowledgements
Contents
1 Embedded Control System Development Process: Model-Based
Design and Architecture Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Model-Based Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.1 V-Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2.2 Test Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2.1 Model-in-the-Loop (MiL) . . . . . . . . . . . . . . 5
1.2.2.2 Software-in-the-Loop (SiL) . . . . . . . . . . . . . 5
1.2.2.3 Processor-in-the-Loop (PiL) . . . . . . . . . . . . . 5
1.2.2.4 Hardware-in-the-Loop (HiL) . . . . . . . . . . . . 6
1.2.3 MBD Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Computer Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3.1 MATLAB/Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3.2 PSIM®
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.3.3 Finite Element in Electric Machines . . . . . . . . . . . . . . 18
1.4 Software Architecture Patterns . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.4.2 Automotive Open System Architecture
(AUTOSAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5 Discrete-Time Electric Machine Control System Overview . . . . 24
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2 Electric Machine Control Technics . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1 Control Theory Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.1.1 Stability Analysis of Second-Order Systems. . . . . . . . . 29
2.1.1.1 Time Domain . . . . . . . . . . . . . . . . . . . . . . . 30
2.1.1.2 Frequency Domain . . . . . . . . . . . . . . . . . . . 35
2.2 Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2.1 Feedforward Control. . . . . . . . . . . . . . . . . . . . . . . . . . 36
2.2.2 Cascade Control Structure . . . . . . . . . . . . . . . . . . . . . . 39
xix
2.3 Classical PID Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.3.1 PD Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.3.2 PI Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.3.3 PID Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
2.3.4 Anti-windup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4 Digital Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.4.1 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.4.1.1 Zero-Order Hold (ZOH) . . . . . . . . . . . . . . . 52
2.4.2 Quantifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.4.3 Time Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.4.4 Integrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.4.5 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.5 Digital PID Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.5.1 Discrete PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.5.1.1 Trapezoidal Discrete PI Controller . . . . . . . . 62
2.5.1.2 Backward and Forward Discrete PI
Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 63
2.5.2 Digital PI Implementation . . . . . . . . . . . . . . . . . . . . . . 65
2.5.2.1 MATLAB Function Implementation . . . . . . . 65
2.5.2.2 Stateflow®
Implementation . . . . . . . . . . . . . 67
2.6 Fuzzy Logic as Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.6.2 Fuzzy Logic System . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2.6.2.1 Fuzzifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.6.2.2 Knowledge Base . . . . . . . . . . . . . . . . . . . . . 74
2.6.2.3 Inference Mechanism . . . . . . . . . . . . . . . . . 74
2.6.2.4 Defuzzifier . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.6.3 Fuzzy Logic Control. . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.6.3.1 Electric Machine Speed Control
Application . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.6.4 Adaptive Fuzzy PI . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.6.5 Fuzzy + PI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3 Three-Phase Electrical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2 Three-Phase Balanced Linear Load . . . . . . . . . . . . . . . . . . . . . 87
3.2.1 Star (Wye) Connection . . . . . . . . . . . . . . . . . . . . . . . . 87
3.2.2 Delta Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2.3 Low- and High-Voltage AC Machine Connection . . . . 91
3.2.3.1 Delta/Star Connection with Six-Lead
Terminal Wiring . . . . . . . . . . . . . . . . . . . . . 92
3.2.3.2 Low and High Voltage with Nine-Lead
Terminal Wiring . . . . . . . . . . . . . . . . . . . . . 93
xx Contents
3.3 Power in Three-Phase Systems . . . . . . . . . . . . . . . . . . . . . . . . 96
3.4 Vector Representation in Three-Phase Systems . . . . . . . . . . . . . 100
3.5 Mathematical Transformation for AC Machine Analysis . . . . . . 104
3.5.1 The Clarke and Concordia Transformation . . . . . . . . . . 104
3.5.2 The Rotation Transformation. . . . . . . . . . . . . . . . . . . . 108
3.6 Instantaneous Power in Three-Phase Systems . . . . . . . . . . . . . . 112
3.6.1 Instantaneous Power Computation . . . . . . . . . . . . . . . . 113
3.7 RMS Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
4 Fundamentals of Electric Machines . . . . . . . . . . . . . . . . . . . . . . . . 119
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
4.2 Electric Machine Classification . . . . . . . . . . . . . . . . . . . . . . . . 121
4.3 Brushed Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
4.3.1 Universal Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.3.1.1 Torque Variation. . . . . . . . . . . . . . . . . . . . . 128
4.3.2 Self-Excited and Separately Excited Torque
Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
4.3.3 Brushed Machine Operation . . . . . . . . . . . . . . . . . . . . 134
4.4 Three-Phase Brushless AC Machine. . . . . . . . . . . . . . . . . . . . . 135
4.4.1 AC Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . 137
4.4.1.1 Space Vector Theory in Induction
Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
4.4.1.2 Two-Axis Model. . . . . . . . . . . . . . . . . . . . . 143
4.4.1.3 Steady-State Equivalent Circuit . . . . . . . . . . 147
4.4.1.4 Power Flow . . . . . . . . . . . . . . . . . . . . . . . . 149
4.4.1.5 Speed Variation in an Induction
Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
4.4.1.6 Capability Curve of an Induction
Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
4.4.1.7 Induction Machine NEMA Classification . . . 155
4.4.1.8 Induction Machine Operation . . . . . . . . . . . . 157
4.4.2 PMAC and BLDC Machine . . . . . . . . . . . . . . . . . . . . 158
4.4.2.1 IPMSM Machine Analysis Overview
with FEA . . . . . . . . . . . . . . . . . . . . . . . . . . 162
4.4.2.2 Space Vector Theory in PMSM . . . . . . . . . . 168
4.4.2.3 Particularity for SMPMSM . . . . . . . . . . . . . 175
4.4.2.4 Particularity for IPMSM Machine . . . . . . . . 175
4.4.2.5 Steady-State Equations of PMSM . . . . . . . . 175
4.4.2.6 PMSM Operation . . . . . . . . . . . . . . . . . . . . 179
Contents xxi
4.4.3 Synchronous Reluctance Machine . . . . . . . . . . . . . . . . 180
4.4.3.1 Space Vector Theory in SynRM
and PMASynRM . . . . . . . . . . . . . . . . . . . . 185
4.4.3.2 Steady-State Equations of SynRM . . . . . . . . 188
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5 Modeling Electric Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
5.1 Mechanical Motion Model (Newton’s Laws of Motion) . . . . . . 193
5.2 State-Space Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
5.3 Modeling DC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.3.1 Continuous State-Space . . . . . . . . . . . . . . . . . . . . . . . 201
5.4 Three-Phase Brushless AC Machine Model . . . . . . . . . . . . . . . 206
5.4.1 Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.4.1.1 Continuous State-Space Model
of Induction Machine . . . . . . . . . . . . . . . . . 206
5.4.2 PMAC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
5.4.2.1 PMSM Model . . . . . . . . . . . . . . . . . . . . . . . 211
5.4.2.2 Synchronous Reluctance Machine . . . . . . . . 223
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
6 Measurement in Electric Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
6.2 Voltage Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
6.2.1 Non-isolated Voltage Measurement . . . . . . . . . . . . . . . 238
6.2.2 Adding a Low-Pass Filter (LPF) . . . . . . . . . . . . . . . . . 241
6.3 Temperature Measurement. . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
6.3.1 The Thermistor for Temperature Measurement . . . . . . . 246
6.3.1.1 NTC as a Temperature Measurement . . . . . . 247
6.4 Current Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
6.4.1 Non-isolated Current Measurement . . . . . . . . . . . . . . . 251
6.4.1.1 Shunt Resistor . . . . . . . . . . . . . . . . . . . . . . 251
6.4.2 Isolated Current Measurement . . . . . . . . . . . . . . . . . . . 252
6.4.2.1 Using a Current Transformer (CT) . . . . . . . . 252
6.4.2.2 Current Measurement Using a Hall
Effect Sensor . . . . . . . . . . . . . . . . . . . . . . . 253
6.5 Speed Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
6.5.1 Tachometer Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
6.5.2 Speed/Position Measurement . . . . . . . . . . . . . . . . . . . . 256
6.5.2.1 Resolver . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
6.5.2.2 Encoder Position Sensor . . . . . . . . . . . . . . . 258
xxii Contents
7 Microcontroller Peripherals for Electric Drives . . . . . . . . . . . . . . . 263
7.1 General Timer Module (GTM) . . . . . . . . . . . . . . . . . . . . . . . . 263
7.1.1 GTM Sub-modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 265
7.1.1.1 Advanced Routing Unit (ARU) . . . . . . . . . . 265
7.1.1.2 Timer Input Module (TIM) . . . . . . . . . . . . . 265
7.1.1.3 Timer Output Module (TOM)
and ARU-TOM (ATOM) . . . . . . . . . . . . . . 267
7.1.1.4 SPE (Sensor Pattern Evaluation) . . . . . . . . . 271
7.2 Analog-to-Digital Converter . . . . . . . . . . . . . . . . . . . . . . . . . . 273
7.2.1 Successive Approximation A/D Converter . . . . . . . . . . 273
7.2.2 Delta-Sigma Converter . . . . . . . . . . . . . . . . . . . . . . . . 274
7.3 Infineon AURIX™ Automotive Microcontroller . . . . . . . . . . . . 278
7.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
7.3.2 Infineon AURIX™ Family . . . . . . . . . . . . . . . . . . . . . 280
7.3.3 GTM in AURIX™ Family . . . . . . . . . . . . . . . . . . . . . 282
7.3.4 DSADC in AURIX™ Family . . . . . . . . . . . . . . . . . . . 284
7.4 General-Purpose Renesas RX600 Microcontroller . . . . . . . . . . . 285
7.4.1 Multi-function Timer Pulse Unit 3 (MTU3) . . . . . . . . . 286
7.4.1.1 MTU3, MTU4 as Complementary
PWM Mode . . . . . . . . . . . . . . . . . . . . . . . . 286
7.4.1.2 MTU5 as Deadtime Compensation. . . . . . . . 289
7.4.2 A/D Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
7.5 Modeling and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
7.5.1 Modeling and Simulation of ATOM . . . . . . . . . . . . . . 291
7.5.2 ATOM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 295
7.5.3 Simulation of SDADC . . . . . . . . . . . . . . . . . . . . . . . . 298
7.5.4 Simulation of MTU for Three-Phase Machines . . . . . . 302
7.5.5 MTU3-4 PWM Configuration . . . . . . . . . . . . . . . . . . . 303
7.5.6 MTU5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 307
7.5.7 Simulation of A/D Converter . . . . . . . . . . . . . . . . . . . 308
7.5.8 A/D Configuration for Three-Phase Machines . . . . . . . 309
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
8 Analysis of Three-Phase Voltage-Source Inverters . . . . . . . . . . . . . 313
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
8.2 VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
8.2.1 Single-Phase VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
8.2.2 Three-Phase VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
8.3 Power Semiconductor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.3.2 Semiconductor Technology Overview . . . . . . . . . . . . . 324
Contents xxiii
8.3.3 Parasitic Effect in Semiconductor Switches . . . . . . . . . 327
8.3.3.1 Parasitic Capacitance . . . . . . . . . . . . . . . . . . 327
8.3.3.2 Parasitic Inductance. . . . . . . . . . . . . . . . . . . 328
8.3.4 Gate Charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.3.5 Dynamic Characteristic . . . . . . . . . . . . . . . . . . . . . . . . 331
8.3.5.1 Turn-On, Turn-Off Time Definition . . . . . . . 331
8.3.5.2 Turn-On, Turn-Off Dynamic
Characteristic . . . . . . . . . . . . . . . . . . . . . . . 332
8.3.6 Snubber Circuits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
8.3.7 Semiconductor Power Losses . . . . . . . . . . . . . . . . . . . 336
8.3.7.1 Static Losses. . . . . . . . . . . . . . . . . . . . . . . . 337
8.3.7.2 Dynamic Losses . . . . . . . . . . . . . . . . . . . . . 339
8.3.7.3 Total Power Losses . . . . . . . . . . . . . . . . . . . 342
8.3.7.4 Power Losses Simulation. . . . . . . . . . . . . . . 343
8.4 VSI Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
8.4.1 Gate Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
8.4.1.1 Half-Bridge Driver . . . . . . . . . . . . . . . . . . . 352
8.4.1.2 Miller Effect . . . . . . . . . . . . . . . . . . . . . . . . 354
8.4.1.3 Paralleling Power Switch Semiconductor . . . 356
8.4.2 Current Measurement . . . . . . . . . . . . . . . . . . . . . . . . . 357
8.4.2.1 Phase Current Measurement
in a Three-Phase Machine . . . . . . . . . . . . . . 360
8.4.3 Output Voltage Distortion . . . . . . . . . . . . . . . . . . . . . . 366
8.4.3.1 Deadtime, Turn-On, and Turn-Off Effect . . . 366
8.4.3.2 Voltage Drops in the Semiconductors. . . . . . 368
8.4.3.3 Simulation Results . . . . . . . . . . . . . . . . . . . 370
8.4.4 DC Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . 372
8.4.4.1 DC-Link Capacitor Selection . . . . . . . . . . . . 372
8.4.5 DC-Link Pre-charge . . . . . . . . . . . . . . . . . . . . . . . . . . 380
8.4.6 DC-Link Discharge . . . . . . . . . . . . . . . . . . . . . . . . . . 387
8.5 VSI in Dynamic and Regenerative Braking Mode . . . . . . . . . . . 389
8.6 Machine Terminal Overvoltage . . . . . . . . . . . . . . . . . . . . . . . . 393
8.6.1 Involved Impedance . . . . . . . . . . . . . . . . . . . . . . . . . . 394
8.6.2 Sine-Wave Low-Frequency Output Filter . . . . . . . . . . . 396
8.6.3 High-Frequency Output Filter . . . . . . . . . . . . . . . . . . . 397
8.6.4 dv/dt Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
8.6.4.1 Sine-Wave Filter at Inverter Output
Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . 402
8.6.4.2 High-Frequency RC Filter at the Machine
Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . 404
8.7 VSI Self-protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
8.7.1 Short-Circuit Protection (Surge Current Detection) . . . . 406
8.7.2 Overcurrent Detection . . . . . . . . . . . . . . . . . . . . . . . . . 410
xxiv Contents
8.7.3 Overvoltage and Undervoltage Detection . . . . . . . . . . . 411
8.7.4 Overheating Detection . . . . . . . . . . . . . . . . . . . . . . . . 412
8.8 Machine Fault Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
8.8.1 Locked Rotor Detection . . . . . . . . . . . . . . . . . . . . . . . 413
8.8.2 Overload Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . 415
8.8.3 Overheating Detection . . . . . . . . . . . . . . . . . . . . . . . . 418
8.8.4 Open-Phase Detection. . . . . . . . . . . . . . . . . . . . . . . . . 420
8.9 VSI Power Plant Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
9 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.1 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
9.1.2 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . 431
9.1.2.1 Continuous SVM (T0 = T7) . . . . . . . . . . . . . 438
9.1.2.2 Discontinuous SVPWM (T0 6¼ T7) . . . . . . . . 438
9.1.2.3 Voltage Resolution and Restriction Time . . . 440
9.1.2.4 Deadtime Compensation . . . . . . . . . . . . . . . 441
9.2 Model Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
9.2.2 SVPWM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
9.2.3 Deadtime Compensation Model. . . . . . . . . . . . . . . . . . 448
9.2.4 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
9.2.4.1 SVPWM Simulation Results . . . . . . . . . . . . 449
9.2.4.2 Deadtime Compensation Simulation
Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
9.3 Experimental Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453
9.3.1 Continuous SVPWM . . . . . . . . . . . . . . . . . . . . . . . . . 453
9.3.2 Discontinuous SVPWM . . . . . . . . . . . . . . . . . . . . . . . 457
9.3.3 Distortion Effect in the AC Current . . . . . . . . . . . . . . . 458
9.3.4 Semiconductor Temperature Effect . . . . . . . . . . . . . . . 459
9.3.5 Deadtime Compensation . . . . . . . . . . . . . . . . . . . . . . . 460
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
10 Practical Control of AC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . 463
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
10.2 Control Overview in an Electrical Machines . . . . . . . . . . . . . . . 464
10.2.1 Rotating Load Speed Control Design. . . . . . . . . . . . . . 464
10.2.1.1 Open-Loop Speed Control . . . . . . . . . . . . . . 464
10.2.1.2 Closed-Loop Speed Control Design . . . . . . . 466
10.2.2 PI Current Control Design . . . . . . . . . . . . . . . . . . . . . 471
10.2.2.1 Current Control Design for a
DC Machine . . . . . . . . . . . . . . . . . . . . . . . . 471
Contents xxv
10.2.3 DC Servo Motor Drive Model-Based Simulation . . . . . 473
10.2.3.1 Open-Loop Simulation . . . . . . . . . . . . . . . . 475
10.2.3.2 Closed-Loop Simulation . . . . . . . . . . . . . . . 475
10.3 Principle of Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
10.4 Sensored Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
10.4.1 Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
10.4.2 SynRM/PMASynRM . . . . . . . . . . . . . . . . . . . . . . . . . 486
10.4.3 PMSM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
10.5 Flux Weakening Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
10.5.1 Flux Weakening Control of Induction Machine . . . . . . 489
10.5.1.1 Constant Torque Region . . . . . . . . . . . . . . . 492
10.5.1.2 Constant Power Region . . . . . . . . . . . . . . . . 493
10.5.1.3 Constant Slip Region . . . . . . . . . . . . . . . . . 494
10.5.2 Flux Weakening Control of SynRM
and PMASynRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
10.5.3 Flux Weakening Control Strategy . . . . . . . . . . . . . . . . 498
10.6 Sensorless Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
10.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
10.6.2 Rotor Flux Linkage Estimator in IM, PMSM,
SynRM, and PMASynRM . . . . . . . . . . . . . . . . . . . . . 500
10.6.2.1 Open-Loop Flux Observers . . . . . . . . . . . . . 500
10.6.2.2 Closed-Loop Flux Observer Model . . . . . . . 505
10.6.3 Rotor Flux Linkage Estimator PMSM . . . . . . . . . . . . . 509
10.6.4 Instantaneous Slip and Speed Estimator for IM . . . . . . 511
10.7 Simulations Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
10.7.1 Flux Observer and Slip Estimator Simulations
in IM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
10.7.2 Flux Observer in PMSM. . . . . . . . . . . . . . . . . . . . . . . 520
10.7.2.1 Vector Control Simulation . . . . . . . . . . . . . . 520
10.7.2.2 Rotor Flux Estimator. . . . . . . . . . . . . . . . . . 524
10.7.2.3 Permanent Magnet Synchronous
Generator (PMSG) . . . . . . . . . . . . . . . . . . . 526
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
11 Model-in-the-Loop Development in a Vector Control of Induction
Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
11.2 Control Loop Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532
11.3 Rapid Prototype Simulation Without Power Plant . . . . . . . . . . . 534
11.4 Software Architecture Design . . . . . . . . . . . . . . . . . . . . . . . . . 540
xxvi Contents
11.5 MCL SWC Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
11.5.1 Slow Control Loop Task. . . . . . . . . . . . . . . . . . . . . . . 545
11.5.2 Fast Control Loop Task . . . . . . . . . . . . . . . . . . . . . . . 546
11.5.3 MCL Unit Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
11.6 Model-in-the-Loop Test (MiL) . . . . . . . . . . . . . . . . . . . . . . . . . 551
11.6.1 Test Below Nominal Speed. . . . . . . . . . . . . . . . . . . . . 554
11.6.2 Test Above Nominal Speed . . . . . . . . . . . . . . . . . . . . 561
11.7 Application in Electrical Vehicle . . . . . . . . . . . . . . . . . . . . . . . 566
11.7.1 Vehicle Movement Simulation . . . . . . . . . . . . . . . . . . 569
11.7.2 Vehicle Speed Control Simulation . . . . . . . . . . . . . . . . 572
11.8 Application in Propeller Aircraft . . . . . . . . . . . . . . . . . . . . . . . 579
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
12 Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
12.1 Real-Time Implementation: PiL Testing . . . . . . . . . . . . . . . . . . 585
12.2 55 kW IPMSM Simulation Results . . . . . . . . . . . . . . . . . . . . . 590
12.2.1 Static Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
12.2.2 Motor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
12.2.3 Generator Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611
Contents xxvii
Chapter 1
Embedded Control System Development
Process: Model-Based Design
and Architecture Basics
1.1 Introduction
In different markets, such as industry, appliances, automotive, marine, and avionics,
rotating electrical machines are widely used. The adjustable speed drive (ASD) with
DC machines had been used widely to control the torque and speed. However, the
AC machine drive system driven by a variable-voltage/variable-frequency (VVVF)
is widely used due to their high-performance control thanks to the improvements in
the power electronics devices, in the machine efficiency, and in the performance of
the microprocessors. In the literature, it is possible to find different nomenclatures to
specifyavariablespeedACdrivesuchasvariable-frequencydrive(VFD),adjustable-
frequency drive (AFD) where both provide a VVVF. The common part of these drives
is the control of the speed/torque variation in electromechanical systems where the
speed/torque is adapted according to the necessity of the system. The most used
electronic power system (sometimes designed as AC drive) able to perform a VVVF
is known in the literature as an inverter. As it will be discussed in Chap. 8, the inverter
topology can be single-phase, or poly-phase, and basically consists in transform a
DC source into a single- or poly-phase AC source.
The control system of the AC drive and therefore the control of the AC machine
are increasingly complex systems and usually consist of embedded systems. The
embedded system is referred to as an electronic system that is designed to perform
a dedicated function by using a combination of computer hardware and software,
which is often embedded within a larger system. A generic embedded system archi-
tecture is composed of a microprocessor, its memory, and the inputs and outputs.
The embedded software is commonly stored in the non-volatile memory devices
such as flash memory, read-only memory (ROM), or erasable programmable ROM
(EPROM). The microprocessor uses the random-access memory (RAM) for its run-
time computation. Once the embedded system is powered, the software code stored
in the non-volatile memory is read to execute the instructions to process the input
information and set the outputs according to the needs of the external control system.
In the control systems, the inputs usually are sensors, while the outputs are actuators.
© Springer Nature Switzerland AG 2020
R. Molina Llorente, Practical Control of Electric Machines,
Advances in Industrial Control, https://doi.org/10.1007/978-3-030-34758-1_1
1
2 1 Embedded Control System Development Process …
Both are managed by dedicated peripherals such as general-purpose input/output
(I/O), timers, and analog-to-digital converter (ADC or A/D). When the micropro-
cessor, memory, and peripherals are integrated together on a single chip, the device
consists of a microcontroller. The microprocessor with an architecture optimized for
digital signal processing is the digital signal processor (DSP). The DSP is an ideal
processor choice for applications with intensive math computations in constrained
environments. For example, the analog input signals, such as audio or video signals,
are converted to digital with ADC, and then, it is manipulated digitally with sophis-
ticated algorithms and finally converted back to analog form with a digital-to-analog
converter (DAC). Nowadays, some DSPs have dedicated peripherals for a control sys-
tem so that they compete with microcontrollers thanks to their increasingly affordable
price and the tools improvements. New platforms based in programmable system-
on-chip (SoC) which combine programmable logic, DSP, and microprocessor cores
on the same chip are increasingly used in electric machine control. The advantage of
using programmable logic or DSP is its high-performance computation where com-
plex control algorithms can be implemented inside, while the microprocessor can be
dedicated to other tasks such as communication interfaces. The field-programmable
gate array (FPGA) contains programmable logic blocks such as AND and XOR with
faster and parallelizable processing where the performance is higher than the micro-
processor and DSPs. They are generally more expensive and more difficult to use,
and its uses are limited for applications where the high performance is a requirement.
DSPs, microcontroller, SoC, and FPGAs are valid options to perform a machine
control units (MCU), but as it will be seen in Chap. 7, the microcontroller option
will be studied, in particular, the families RX63T of Renesas and AurixTM
Tricore
of Infineon.
The embedded systems can combine any combination of a microprocessor, micro-
controllers, DSPs, FPGA, and SoCs. The embedded systems have to manage millions
of lines of code where their integration and debugging with other systems are increas-
ingly more complex. To deal with the complexity of embedded software development
in different markets, and especially in electronic control units (ECU) or more specifi-
cally, in MCUs of modern automobiles, the development is increasingly based in the
model-based design. Hence, in the automotive sector, the traditional way of building
embedded code, where lines of code are written by hand, has become obsolete. The
model-based design (MBD) focuses on the models that describe the desired control
and the behavior of the system under development. The MBD has been discussed
for a few decades, but it is not until these recent years where it is being involved in
the flow of system design. In the MBD, the engineer focuses on the functionality, the
modeling of physical phenomena, the interface of modules, the general behavior of
the system, and verification through their own simulations.
On the other hand, the definition of fundamental standard software architecture is
mandatory if certain security, reliability, and interactive work methodology require-
ments between the designers, the client, and the quality regulators should be satisfied.
For example, in automotive, in many occasions, the development of a project is exe-
cuted between OEMs (Original Equipment Manufacturers) and their Tier1 and Tier2
suppliers. To allow the exchange of models and software, the standardization of a
1.1 Introduction 3
work platform is necessary. In this sense, the AUTOMotive Open System ARchitec-
ture (AUTOSAR) partnership guarantees a process for the development of standard
automotive software. As will be discussed in Sect. 1.4, AUTOSAR offers a frame-
work guide for electronic automotive control systems which comes with layered
software architecture.
Lastly, the MCU and ECUs are tested with selected methods in agreement with the
standards, e.g., the International Electrotechnical Commission (IEC), to guarantee
and minimum safety requirements. The objective is to ensure the safety of persons, to
measure performances, and to ensure compatibility with other systems. For example,
the IEC 61508 describes the basic functional safety standard applicable to all types
of industry, while the International Organization for Standardization (ISO) 26262
specifies the functional safety for road vehicles which is derived from IEC 61508.
In this chapter, it basically introduces the MBD technique, the simulation tools
used in this book, the software architecture of the ECUs and MCUs, and the different
test systems for each of the development phases.
1.2 Model-Based Design
MBD is a mathematical and visual method that facilitates the complex designs of
embedded systems. Instead of using extensive and complicated programming codes,
designers can use MBD to define models with advanced functional features using
continuous-time and discrete-time simulations. The main components of a model-
based design are design and simulation at the system and component level, automatic
code generation, and continuous testing and verification.
1.2.1 V-Model
The MBD can be considered a software development methodology based on the
V-model. The V-model was first presented in 1991 (Forsberg and Mooz 1991), and it
is a variation of the waterfall model in a V shape folded in half at the lowest level of
decomposition. Figure 1.1 shows the V-model adapted for the software development
process.
V-model is denoted as a linear refinement process that follows a top-down
approach shown on the left side of the V, while validation and verification take a
bottom-up approach that is shown on the right side of V. V-model demonstrates the
relationships between each phase of the development life cycle and its associated
testing phase. The horizontal and vertical axes represent the time or integrity of the
project (from left to right) and the level of abstraction (the abstraction of coarser
grain upwards), respectively.
The project starts with the system requirements where the system specification
is derived. This defines a detailed specification where is specified the functionality
4 1 Embedded Control System Development Process …
System
Requirements
FuncƟonal
SpecificaƟon
Architecture
Design
Coding
Unit TesƟng
FuncƟonal TesƟng
Maintenance
Module Design
Hardware/
SoŌware
IntegraƟon
SIL
PIL/HIL
HIL
MIL
System Test Design
IntegraƟon
Test Design
Unit Test
Desing
System
SpecificaƟon
System TesƟng
Acceptance Test Design
Fig. 1.1 V-model. The left side is denoted as a linear life-cycle process that follows a top-down
approach, while the right side of the V is the validation and verification using a bottom-up approach
to meet and allows designing a software architecture. For example, it could define
the speed control functionality of an electric machine. In this step is developed a
basic MiL, which in the mentioned example, should consist of a speed control loop
on a plant model. Taking into account the different functionalities, the architecture
software platform can be designed. On this architecture, the design of the different
modules or software components (SWC) is perfectly defined with their respective
inputs and outputs. The code generation can be generated for each one of the SWCs
designed to finally be tested by means of a unit test (UT). If the UT meets the
requirements, a hardware/software integration test with the rest of the modules can
be performed using a processor-in-the-loop (PiL) or hardware-in-the-loop (HiL).
Otherwise, horizontally it would return to the design of the module to modify its fea-
tures to rebuild the UT. If the integration test does not comply with the requirements,
in particular, it is necessary to proceed with the redesign either of the architecture or
of the different modules. If this is not the case, the functional tests are carried out. As
in the previous cases, if the test requirements are not met, it is returned horizontally
to the refinement.
1.2.2 Test Stage
As mentioned, it is possible to consider different test stages as illustrated in Fig. 1.1:
model-in-the-loop (MiL), software-in-the-loop (SiL), PiL, and HiL. MiL stage is
1.2 Model-Based Design 5
implemented during the refinement process in order to validate demodel according
to the requirements specification. The rest of the test stage is usually implemented
in the validation and verification of the model, as explained before. In the following
section, each of them is explained separately.
1.2.2.1 Model-in-the-Loop (MiL)
The MiL scenario is a technique used to abstract the behavior of a system or sub-
system so that this model can be used to test, simulate, and verify that model. For
example, the control system of an electric machine based on a PID regulator with
a power stage, it would be possible to adjust and test its correct operation on a
modeled plant formed by the power stage and the electric machine. By using a chain
of industry standard tools such as Simulink®
to define the model, it is possible to
test and refine that model within a personal computer (PC), which allows managing
a complex system efficiently.
1.2.2.2 Software-in-the-Loop (SiL)
Unlike the MiL, the SiL scenario allows testing the code generated from the model
also on a PC where it is possible to perform the simulation, but based on the model
code. That is, on the same example of the previous control system, the PID controller
based on a model, its code is generated and therefore tested in the same environment.
This phase requires only the simulation model and is independent of the hardware,
focusing on software interfaces and numerical results. The requirements and specifi-
cations of the software can be analyzed and verified here. The first phase of refinement
of the requirements is carried out during the SiL simulations.
1.2.2.3 Processor-in-the-Loop (PiL)
The PiL scenario allows developing real-time control over a microprocessor target
connected to a digital platform that emulates, in this case, the most complicated parts
to obtain at the beginning of the project, such as the power stage and the electric
machine. Unlike MiL and SiL, in this case, the real microprocessor of the ECU is
tested, where the software not only consists of the application layer control algorithm
but a part of the software architecture. Unlike the simulation in the SiL scenario,
where the runtime metrics were not obvious, due to the higher calculation capacity of
a PC, the PiL has the ability to detect insufficient hardware capabilities. For example,
PiL provides real-time metrics, detects bottlenecks, adds used memory, supervises
hardware and software interruptions, analysis of waveforms, thermal effects, and
electromagnetic interferences, among others.
On the other hand, the digital platform that emulates the power stage and the
machine can be a PC, a field-programmable gate array (FPGA), or even a DSP. The
6 1 Embedded Control System Development Process …
increase in the speed of processing of the DSPs and of their reduction in cost make
that the option of using a DSP to emulate an electrical machine is one of the best
alternatives.
1.2.2.4 Hardware-in-the-Loop (HiL)
The hardware-in-the-loop (HIL) scenario tends to become the standard electronic
development tool for testing ECUs, MCUs, and, more particularly, its software for
different OEMs. Especially during development, the individual software change tests
(MBD changes) of the ECU can be tested using the HiL in real time. Increasing the
complexity of control algorithms requires the use of this scenario, which advances
the problems that can be encountered before testing in real conditions. In the case
of an MCU, consisting of a power stage based on a three-phase inverter, and its
control logic for an electrical machine, the HiL scenario can be used as a tool to
develop and validate control strategies in all operating conditions, including extreme
conditions, such as non-destructive failures in the machine itself. In this scenario,
the machine is emulated, with a certain degree of fidelity, in a processor that acts on
an electronic load that emulates its physical behavior. Additionally, it is possible to
include a power supply emulator for the inverter where different power conditions can
be tested. Then, the MCU is exposed to the different possible power conditions, and
to the different behaviors of the electric machine. If the power supply of the MCU
or inverter is by means of a battery as in electric vehicle (EV), the HiL scenario
can emulate its operation in different states of charge (SOC), where the voltage is
reduced as the battery energy is consumed. Otherwise, if the power is through the
single-phase or three-phase electricity network grid, the voltage and frequency can
be varied according to the voltages and frequencies and their corresponding limits set
by each country. The most critical test cases can be evaluated, such as degradation
and derating conditions. These are usually those where the power supply is low,
and the demand for machine load is high, or when the temperature is above normal
limits. In addition, if during the development phase changes the characteristics of
the electric machine or even the type of machine, simply changing the model that
controls the electronic load will suffice.
On the other hand, the different dynamic behaviors of the electric machine to be
controlled, such as load variation, and inertia, can be tested by the electronic load.
For example, in the case of the EV, one can simulate, among other things, the driving
speed, the vehicle mass, the dynamics, the aerodynamics and the drag resistance, and
the regenerative brake. In this case, during the iterative design phases, it is possible
to find optimal parameters for the inverter + electrical machine set.
In this scenario, the MCU under test would be wholly tested and validated with
the test cases created, providing the corresponding reports as output. If the results
of the reports are satisfactory, it is possible to proceed to perform the test with the
real machine on a test bench with a dynamometer. Dynamometers are widely used to
test the torque and power of combustion engines and electric machines. It involves
moving mechanical parts so that it can be dangerous if it is not carried out with
1.2 Model-Based Design 7
all the necessary safety elements. The test bench consists of the real machine con-
nected to a machine that acts as a brake (dynamometer) to simulate different pairs of
dynamic loads. The torque and speed meter is monitored by means of instrumentation
equipment connected to a PC.
It is essential to mention that the HiL scenario described above usually has a high
cost, so it will not always be possible to have one during the development phase. That
is why other more modest verification systems are often used as well as digitized
plants. In this case, the hardware formed by the machine and the inverter + controller
can be replaced by a precise model in real time for emulation, for faster development
and if it is not expected to have a complete HiL scenario. It is true that control systems
increasingly use their verification and development through a plant digitized on a
field-programmable gate array (FPGA) platform so that control algorithms can be
evaluated without the need for real hardware, in this case, an inverter and an electrical
machine (Tavana and Dinavahi 2015). However, the real-time simulation of electric
machine models and the inverter can be especially complicated due to the rapid
nature of the dynamics, that is, reduced time constants especially in very low-power
machines. The switching of PWM signals up to tens of kHz requires sampling rates of
the order of several MHz to obtain a reasonable accuracy and model, for example, the
ripple produced by the PWM in the inductance of the machine. That is why FPGAs
are the ideal platform for complex simulations in real time due to their capacity
to process data in parallel allowing sampling and execution rates up to the MHz
range. The FPGA is a reconfigurable digital logic platform, which allows execution
of millions of operations in parallel. As cited in (Le-Huy et al. 2006), research
has advanced considerably in modeling and real-time simulation of different power
systems that use the FPGA as computational devices. The control algorithm designed
in this case for the control of an electric machine is loaded into a card where it will
be tested with the FPGA modeling the inverter and the machine. Different test cases
can be verified quickly by advancing many of the possible problems, for example,
on the stability of the control.
Finally, there will be occasions when, due to cost, although not as high as that of
the HiL scenario, these plant modeling systems will not be available. In this case, the
tests are carried out directly on the actual plant or on a test bench, typically being the
longest and most complicated development, since numerous software and hardware
errors will be found in the real system or in the test bench according to the case.
1.2.3 MBD Process
The MBD begins with the MiL scenario (Lamberg et al. 2004), which consists of
developing models submitted to simulated test environments at the beginning of the
design. The models are then refined and transformed into software. This software
can be tested in the SiL scenario, or in the microprocessor, PiL scenario. Finally, the
HiL scenario (Hanselmann 1993) contains the real hardware and software (MCU),
integrated into a simulated environment. The plant (electric machine) controlled by
8 1 Embedded Control System Development Process …
MCU is developed during the functional specification phase, which can be used by
the HiL scenario, defining the simulated environment.
The model-based design allows systems to be developed with a model-centered
approach, since the basic idea is to develop the model without the need for a physical
prototype, in a simulation-based verification environment. The model includes all
the relevant components for the behavior of the system: algorithms, control logic,
physical components, and the environment. Once the model has been developed and
verified that it works according to the requirements, code of the control logic can
be generated in the chosen programming language, for its later implementation in
a microcontroller, FPGA, or DSP. The programming language will vary depending
on the chosen hardware, being typically C/C++ language for the microcontroller
and DSP, while VHSIC (very high speed integrated circuit) hardware description
language (VHDL) is reserved for the FPGA.
The model development environment also allows generating reports and other
types of documentation that are very beneficial for the developers and the customer.
MBD has the ability to develop a functional version of the system from the beginning,
with the plant, sensors, actuators, etc. For example, in electric machine control, it is
possible to develop the speed control system in an environment where the plant will
be an AC machine model, together with a power stage and the necessary sensing
stages. That is to say, when the hardware is not available, some of the problems that
could only be encountered with the physical prototype can be progressed in a very
effective way. The results of the simulation can be shared with the customer instead
of the results of the hardware tests and can be used to measure progress, verify that
the system meets the requirements, and perform automatic test reports with coverage
results of the control system. In addition, as the model is developed, it can be used
to perform a MiL, generate code for SiL/PiL-type tests, and finally for HiL tests.
Code generation is automatic in a way that reduces any manual implementation and
therefore reduces development times. Figure 1.2 shows the structure of the MBD
where two parts are differentiated. On the one hand, the design, simulation, and
verification based on a personal computer (PC) (MiL and SiL), and on the other
hand the verification on real hardware (PiL and HiL). The hardware can be modeled
with a reasonable degree of precision in order to verify the design results of the
models with an adequate degree. Different input test cases can be implemented in
order to test accurately the models where the results should be compared with the
expected outputs.
The change of requirements or conditions that affect one or several models can
be modified and verified independently without waiting for the other models to be
finalized. Through the simulations, it is verified that the changes do not cause an
involuntary behavior of the system by providing regression tests.
In the previous example, a control engineering team is developing software for a
control system of an AC electric machine without a speed sensor. The system bases
the machine speed estimation by means of an adaptive model by measuring the
current and voltage that circulates through the machine terminals. In the first phase,
each sub-team (or group of engineers) models their respective sub-systems, using
a model in simulation software shared at the system level to coordinate their work.
1.2 Model-Based Design 9
Controller
Model
Inverter/
Motor Models
VerificaƟon
Input
Test
Cases
Embedded
System
(Controller)
Inverter &
Motor
PC
MCU
Code
GeneraƟon
Expected
Outpus
Fig. 1.2 MBD setup application in an MCU
Because the system will only control the machine, the application layer of the SW
architecture will be composed of the control model. In this first phase, simulations
can be run to see how the control behaves under various conditions. Each of the sub-
systems can be separately debugged (MiL), where the parameters to be optimized
are identified, and the performance metrics are displayed without generating a single
line of code.
The first test version will be the one where all the MiL sub-systems are integrated
to perform the main task of the system where it is possible to extract performance
metrics. At this point, the teams can adjust or improve the models according to the
needs of the customers as, for example, the need to extend the maximum speed of the
machine at speed higher than the initial one of the project. The code generated by the
models is a part of the system code so that there will be an integration process with
the rest of the code. The rest of the code basically consists of sub-systems such as
drivers for the ADC converter, driver for the I/O control, and Timers configuration.
In the next phase, the models can be verified by SiL tests that are more rigorous than
the MiL to have a more advanced level of verification. Here, the compiled model for
its simulation is no longer verified, but it is verified as the generated code performs
the same functions as the compiled model.
The last step consists of the most rigorous checks in real time such as the PiL and
HiL test to ensure that the design meets the customer’s requirements. At this point,
there has been time for the hardware team to design and develop the real hardware.
It is here, where the control of the machine can be evaluated on a real plant, that is,
with an inverter and an electric machine, or in its absence, on an advanced simulation
system of the plant. In addition, they also verify that the established standards and
guidelines of the models and code comply, use static analysis and formal methods to
prove the absence of critical errors at runtime, and produce reports and other artifacts
in preparation for standards certification. As the project progresses, the needs of
10 1 Embedded Control System Development Process …
customers may change. For example, the customer can request a machine position
sensing to make the system more robust in the face of any adversity in the control.
Due to the fact that a system model is being used in this project, the team will only
have to create a new model for the processing of the rotor position of the machine
and compare it with the estimated position to activate the corresponding alarms in
case of particular deviation. The remaining models remain unchanged so that the
team must re-run simulations for MiL and SiL verification and share them with the
client before executing the PiL and the HiL. If it works as expected, it is possible to
proceed to perform HiL tests for the final verification of the new functionality.
1.3 Computer Simulations
In Engineering, there are three methods to resolve a problem: analytical method,
numerical method, and experimental method. The analytical method is the classical
approach, with 100% accurate results. However, it is applicable only for simple prob-
lems. The numerical method consists of a mathematical representation where some
approximation and assumptions are made, and the results cannot be believed in 100%.
The last method is the experimental method which consists of actual measurement
and only applicable if the physical prototype is available.
Computer simulations, in general terms, use numerical methods to mimic the
operations of real-world processes according to appropriately developed assumptions
taking the form of logical, statistical or mathematical relationships that have been
developed and formed in a model (McHaney 2009). These techniques for imitating
real-world process operations are generally called systems, and assumptions about
their functioning are generally made. These assumptions, which usually take the
form of logical or mathematical relationships, constitute the model used to try to
understand how the system acts (Law 2006). A system is defined as a collection
of entities (such as people or machines), which act and interact together to achieve
a logical end. In practice, the definition of “the system” depends on the objectives
of a particular study. The collection of entities that comprise a system for a study
may be only a subset of the totality of another system. The state of a system is
defined as a collection of variables necessary to describe a system at a particular
time, relative to the objectives of a study. The systems are categorized into two
types, discrete and continuous. A discrete system is one for which state variables
change instantaneously at separate points of time. A continuous system is one for
which state variables change continuously over time. In practice, few systems are
entirely discrete or entirely continuous. But since a type of change predominates in
most systems, it is generally possible to classify a system as discrete or continuous.
The models can be simulated in a computer either in continuous or discrete time,
depending on the system, in increasingly sophisticated simulation environments that
facilitate their development and understanding of their behavior.
In general, most simulation packages use numerical methods to perform the out-
put results following a discrete approach. The discretization of a continuous system
1.3 Computer Simulations 11
with infinite degrees of freedom (DOF) to a finite degree of freedom is known as
meshing (nodes and elements). Figure 1.3 illustrates the meshing concept for an
AC machine where phase winding is not meshing. As it can be observed, there
are a numerous number of nodes and elements, in concrete, 39,669 and 88,582,
respectively. The finite element (FE) is a numerical technique used to determine the
approximated solution for a partial differential equation on a defined domain (Altair
University 2019). FE is more focused to solve problems of engineering and mathe-
matical physics as electromechanical phenomena, coupled effects, electromagnetic
effects, mechanical structures, etc.
The FE has an excellent performance to solve partial differential equations over
complex domains that can vary with time. It only makes calculations at a limited
(finite) number of points and then interpolates the results for the entire domain
(surface or volume). It is possible to define “Finite” as the reduction of the degrees
of freedom from infinite to finite with the help of discretization or meshing (nodes
and elements), and the “Element” as the entity joining nodes and forming a specific
shape such as quadrilateral or triangular as shown in Fig. 1.3b. Hence, all of the
calculations are made at a limited number of points known as nodes. To get the value
of a variable anywhere in between the calculation points, an interpolation function
is used as commented before.
On the other hand, simulation packages, which are not based in FE, use solvers. A
solver applies a numerical method to solve the set of ordinary differential equations
that represent the model [MathWorks]. The continuous solvers use the numerical
integration to calculate continuous states of a model at the current time step based on
the states at previous time steps and the state derivatives. Continuous solvers depend
on individual blocks to calculate the values of the discrete states of the model at each
time step. Discrete solvers are mainly for solving purely discrete models. Simulink
provides two main types of solvers, fixed-step where it fixes step sizes from the
beginning to the end of the simulation, and variable-step solvers, where solvers vary
the step size during the simulation. In general, a smaller step size increases the
accuracy of the results but increases the time required to simulate the system. The
advantage of the variable-step is that it is possible to reduce the simulation time
required since the size step is automatically chosen according to the actual results.
In power electronics, thanks to the simulation packages, the complicated alge-
bra in power circuits is sometimes avoided, such as root mean square (RMS) of
the currents, transients, and power losses for example. The precision of the power
circuit can be fine-tuned with the knowledge of the layout where stray components
such as inductance, resistance, and capacitance can be included in the simulation.
It improves the results in such a way it is possible to perform accurate harmonic
content simulations which can prevent future hardware modifications.
In the market, there are a large number of simulation packages for device-level
power electronics which offers accurate and precision results of the behavior of the
power stage. These packages can generate the dynamic equations of the system,
which can be simplified for a computationally efficient. The device-level model
such as power semiconductors device, resistors, capacitors, inductors, voltage, and
current sources are used to perform the power circuit where often are solved by using
12 1 Embedded Control System Development Process …
Fig. 1.3 Discretization of a continuous model by using nodes and elements. a Three dimensions,
b two dimensions
1.3 Computer Simulations 13
non-linear differential-algebraic equations. The high accuracy is, in general, due to
the high precision device model and the different numerical integration algorithms
such as Newton-Raphson (solver) with a very low step size. The great detail of the
waveforms results allows to analyze precisely, for example, the transients. However,
the simulation execution speed is relatively slow, which can derive to bottleneck
during the project development. For this reason, different simulations areas such as
system level as MATLAB/Simulink®
and device level such as PSIM®
can be used
during the development to exploit the modeling strengths for every area. Moreover,
analog, digital, and mixed-signal simulations are often used in the same environment.
On the other hand, the co-simulation is becoming more prevalent in the power
electronic circuits simulations. The co-simulation allows interconnection between
several simulation tools such as system level and device level, where the advantages
of both systems are emphasized. In this section, the simulation MATLAB/Simulink®
,
PSIM®
, and Altair FluxTM
finite element analysis (FEA) are introduced.
1.3.1 MATLAB/Simulink
Simulink®
developed by MathWorks is a block diagram environment for multi-
domain simulation and model-based design. It is compatible with system-level
design, simulation, automatic code generation, and continuous testing and verifica-
tion of integrated systems. Simulink®
provides a graphics editor, customizable block
libraries, and solvers for modeling and simulating dynamic systems. It is integrated
with MATLAB®
, allowing the incorporation of MATLAB®
algorithms in models
and the export of simulation results to MATLAB®
for further analysis. These factors
make Simulink®
a powerful engineering tool. Simulink®
control toolbox allows to
design and simulate the behavior of the plant control in the same environment with
algebraic differential equations. The control theory is shown graphically as plots
such as Bode diagram and root locus, where stability analysis can be performed in a
friendly way. Figure 1.4 shows the Simulink®
environment.
On the other hand, Simscape Electrical Specialized Power Systems library of
Simulink®
contains blocks that use their own, specialized electrical domain. It pro-
vides a unique environment for modeling and simulating physical systems that span
mechanical, electrical, and other physical domains. It provides fundamental building
blocks of these domains that can be assembled into models of physical components,
such as electrical machines, hydraulic valves, and other mechanisms. Simscape mod-
els can be used to develop system-level control and performance systems. It is pos-
sible to expand the libraries using the Simscape language based on MATLAB®
,
which enables the text-based creation of components, domains, and physical model-
ing libraries. Using the Simscape language, users can control accurately what effects
are captured in their models. Figure 1.5 represents an example of a DC machine con-
trol with a power stage based in two isolated gate bipolar transistor (IGBT) power
semiconductor devices made with Simscape Electrical Specialized Power Systems
library.
14 1 Embedded Control System Development Process …
Fig. 1.4 Simulink environment software package
Fig. 1.5 DC machine control system made with Simscape electrical specialized power sys-
tems library
With Simscape, users build a system model in the same way that they would
assemble a system. Simscape employs a physical network approach, also known as
acausal modeling, building models: Components (blocks) corresponding to physical
elements, such as pumps, machines, and operational amplifiers are joined by lines
corresponding to physical connections that transmit power. This approach allows
users to describe the physical structure of a system instead of the underlying math-
ematics. From the model, which looks a lot like a scheme, Simscape automatically
Other documents randomly have
different content
took her arm.
The general, with his usual levity, told St. Louis, that he came in
time to prevent him from running away with his wife. Then twining
round her arm a wreath of jessamin he had taken from my hand,
said, with such fetters only you should be bound! Does she find
those that bind her too heavy? asked her husband. No, replied the
general, she seems content. Then casting a look of disappointment
at Clara, he mounted his horse and rode off.
Major B—— engaged St. Louis in a conversation on the situation of
the colony, which made him forget the dangerous one in which he
had found his wife.
Clara, leaning on my arm, seemed oppressed by a variety of
sensations, among which indignation predominated. The security
and presumption of the general shocked her, and the recollection of
having, at least negatively encouraged him, gave an additional pang
to her heart. We returned slowly home. Our meeting with general
Rochambeau was thought accidental by St. Louis, and was taken no
notice of.
LETTER XIV.
Cape Francois.
Ah, my dear friend, where shall I find expressions to convey to you
an idea of the horror that fills my soul; how describe scenes at which
I tremble even now with terror?
Three negroes were caught setting fire to a plantation near the
town. They were sentenced to be burnt alive; and the sentence was
actually executed. When they were tied to the stake and the fire
kindled, one of them, I understand, held his head over the smoke
and was suffocated immediately. The second made horrible
contortions, and howled dreadfully. The third, looking at him
contemptuously said, Peace! do you not know how to die? and
preserved an unalterable firmness till the devouring flames
consumed him. This cruel act has been blamed by every body, as
giving a bad example to the negroes, who will not fail to retaliate on
the first prisoners they take. But it has been succeeded by a deed
which has absolutely chilled the hearts of the people. Every one
trembles for his own safety, and silent horror reigns throughout the
place.
A young Creole, who united to the greatest elegance of person the
most polished manners and the most undaunted courage, had
incurred, I know not how, the displeasure of general Rochambeau,
and had received a hint of approaching danger, but neither knew
what he had to fear, nor how to avoid it, when he received an order
to pay into the treasury, before three o'clock, twenty thousand
dollars on pain of death. This was at ten in the morning. He thought
at first it was a jest; but when assured that the order was serious,
said he would rather die than submit to such injustice, and was
conducted by a guard to prison. Some of his friends went to the
government-house to intercede for him. Nobody was admitted. His
brother exerted himself to raise the sum required; but though their
house has a great deal of property, and government is indebted to
them more than a hundred thousand dollars, it was difficult, from
the scarcity of cash, to raise so large a sum in so short a time, and
nobody thought there was any danger to be apprehended. At half
after two o'clock he was taken to the fosset, where his grave was
already dug. The captain of the guard sent to know if there was no
reprieve: and was told that there was none. He sent again, the same
answer was returned, with an order to perform his duty, or his life
would be the forfeit of his disobedience. He was a Creole, the friend,
the companion of the unfortunate Feydon. Ah! how could he submit
to be the vile instrument of tyranny? how could he sacrifice his
friend? Why did he not resign his commission on the spot, and abide
by the consequence? Approaching Feydon, he offered to bind his
eyes; but he refused, saying, No, let me witness your horrors to the
last moment. He was placed on the brink of his grave. They fired: he
fell! but from the bottom of his grave cried, I am not dead—finish
me! My heart bleeds: I knew him; and while I live, the impression
this dreadful event has made on me will never be effaced. At the
moment he was killed his brother, having collected the required sum,
carried it to the general, who took the money, and sent the young
man, who was frantic when he heard of his brother's fate, to prison.
It is said a reprieve had been granted, but had been suppressed by
Nero the commandant de la place, who is as cruel, and as much
detested as was the tyrant whose name he bears.
A few days after, nine of the principal merchants were selected. One
hundred thousand dollars was the sum demanded from them; and
they were imprisoned till it should be found. It was then the virtuous
Leaumont approached, fearless of consequences, the retreat of the
tyrant, and obliged him to listen to the voice of truth. He
represented the impossibility of finding the sum demanded from
these unfortunate men, and entreated to have a tax laid on every
individual of the place in proportion to his property, which, after
much debate was consented to. The money was soon furnished, and
the prisoners released.
Since the death of Feydon the general appears no more in public. A
settled gloom pervades the place, and every one trembles lest he
should be the next victim of a monster from whose power there is
no retreat. St. Louis, above all, is in the greatest danger, for he has
the reputation of being rich, and, having excited the aversion of
general Rochambeau, it is not probable that he will escape without
some proof of his animosity.
Clara is in the greatest dejection. She repents bitterly the levity of
her conduct, and is torn with anxiety for the fate of her husband.
She loves him not, it is true, but would be in despair if through her
fault the least evil befel him, and feels for the first time the danger
of awakening the passions of those who are capable of sacrificing all
considerations to gratify their wishes or revenge their
disappointment. She requested the general to give her a passport for
St. Jago de Cuba. He replied that he could only grant them to the
old and ugly, and she, not being of this description, he was obliged
to refuse her; however, after much solicitation, she obtained one for
herself for me and her servants, and we shall sail in a few days. All
the women are suffered to depart, but no man can procure a
passport. Some it is true, find means to escape in disguise, and they
are fortunate, for it is much feared that those who remain will be
sacrificed. Every vessel that sails from hence is seized and plundered
by the English; but, as we are Americans, perhaps we may pass.
Our intention is to stay at St. Jago till St. Louis joins us. God knows
whether we shall ever see him again. With what joy I shall leave this
land of oppression! how much that joy would be increased if I was
going to the continent; but in all places, and in all countries I shall
be affectionately yours,
LETTER XV.
Barracoa.
You will no doubt be surprised at receiving a letter from hence, but
here we are my dear friend, deprived of every thing we possessed,
in a strange country, of whose language we are ignorant, and where,
even with money, it would be impossible to procure what we have
been accustomed to consider as the necessaries of life. Yet here we
have found an asylum, and met with sympathy; not that of words,
but active and effectual sympathy, from strangers, which, perhaps,
we should have sought in vain in our own country, and among our
own people.
We embarked at the Cape, Clara, myself and six servants, in a small
schooner, which was full of women, and bound to St. Jago. As soon
as we were out of the harbour a boat from a British frigate boarded
us, condemned the vessel as French property, and, without further
ceremony, sent the passengers on board another vessel which was
lying near us, and was going to Barracoa, where we arrived in three
days, after having suffered much from want of provisions and water.
Every thing belonging to us had been left in the schooner the
English made a prize of. St. Louis, having forseen the probability of
this event, had made Clara conceal fifty doubloons in her corset.
On our arrival at Barracoa, a Frenchman we had known at the Cape
came on board. He conducted us ashore, and procured us a room in
a miserable hut, where we passed the night on a board laid on the
ground, it being impossible to procure a mattrass. The next morning
the first consideration was clothes. There was not a pair of shoes to
be found in the place, nor any thing which we would have thought
of employing for our use if we had not been obliged by the pressure
of necessity. Clara had given a corner of our hut to a lady who, with
two children, was without a shilling.
While we were at breakfast, which we made of chocolate, served in
little calabashes, lent us by the people of the house, a priest of most
benign aspect entered, and addressing Clara in French, which he
speaks fluently, told her that having heard of our arrival and
misfortunes, he had come to offer his services, and enquired how
we had passed the night? Clara shewed him the boards on which we
had slept. He rose instantly, and calling the mistress of the house,
spoke to her angrily. I afterwards learned that he reproached her for
not having informed him of our distress as soon as we arrived. He
took his leave and returned in half an hour with three or four
negroes who brought mattrasses, and baskets filled with fowls, and
every kind of fruit the island produces. Then, telling Clara that his
sister would call on her in the evening, and begging her to consider
him as her servant, and every thing he possessed at her disposal, he
went away. In the afternoon he returned with his sister. She is a
widow. Her manners are interesting, but she speaks no language
except her own, of which not one of us understood a word.
Father Philip sent for the only shopkeeper in the place, who
furnished us with black silk for dresses, and some miserable linen.
By the next day we were decently equipped. We were then
presented to the governor, whose wife is divinely beautiful. Nothing
can equal the lustre of her eyes, or surpass the fascinating power of
her graceful and enchanting manners. The changes of her charming
countenance express every emotion of her soul, and she seems not
to require the aid of words to be understood. She conceived at once
a fervent friendship for Clara, and having learned our misfortunes
from father Philip, insisted on our living in her house whilst we
remained at Barracoa. This point was disputed by Donna Angelica,
who said she had provided a chamber for us in her own. But
madame la Governadora was not to be thwarted; she seized Clara by
the arm, and drawing her playfully into another room, insisted on
dressing her a la Espagnole, which is nothing more than a cambric
chemise, cut very low in the bosom, an under petticoat of linen,
made very stiff with starch, and a muslin one over it, both very
short. To this is added, when they go out, a large black silk veil,
which covers the head and falls below the waist. By this dress the
beauty of the bosom, which is so carefully preserved by the French
is lost.
Clara looked very well in this costume, but felt uncomfortable. As
Donna Jacinta would not hear of our leaving her we consented to
stay; and a chamber was prepared for us. In the evening we walked
through the town, and were surprised to see such extreme want in
this abode of hospitality. The houses are built of twigs, interwoven
like basket work, and slightly thatched with the leaves of the palm
tree, with no other floor than the earth. The inhabitants sit on the
ground, and eat altogether out of the pot in which their food is
prepared. Their bed is formed of a dried hide, and they have no
clothes but what they wear, nor ever think of procuring any till these
are in rags.
There are only three decent houses in the place, which belong to the
governor, to father Philip, and his sister; yet these good people are
happy, for they are contented. Their poverty is not rendered hideous
by the contrast of insolent pride or unfeeling luxury. They dose away
their lives in a peaceful obscurity, which if I do not envy, I cannot
despise. There are many French families here from St. Domingo;
some almost without resource; and this place offers none for talents
of any kind. It is not uncommon to hear the sound of a harp or
piano from beneath a straw built shed, or to be arrested by a
celestial voice issuing from a hut which would be supposed
uninhabitable.
Clara studies with so much application the Spanish language that
she can already hold with tolerable ease a conversation, especially
with the seignora Jacinta, whose eyes are so eloquent that it would
be impossible not to understand her. She is a native of the Havanna,
was married very young, and her husband having been appointed
governor of Barracoa, was obliged to leave the gaiety and splendour
of her native place for this deserted spot, where fashion, taste or
elegance had never been known. It has been a little enlivened since
the misfortunes of the French have forced them to seek in it a
retreat.
Jacinta has too much sensibility not to regret the change of
situation; but she never repines, and seeks to diffuse around her the
cheerfulness by which she is animated. From early prejudice she
loves not the French character. Fortunately Clara is an American; and
the influence of her enchanting qualities on the heart of her fair
friend is strengthened by the charm of novelty.
We are waiting for a vessel to carry us to St. Jago, and its arrival, I
assure you will fill us with regret.
LETTER XVI.
St. Jago de Cuba.
We have left Barracoa, the good father Philip, his generous sister,
and the beautiful Jacinta. Removed from them for ever, the
recollection of their goodness will accompany me through life, and a
sigh for the peaceful solitude of their retreat will often heave my
breast amid the mingled scenes of pleasure and vexation in which I
shall be again engaged. Fortunate people! who, instead of rambling
about the world, end their lives beneath the roofs where they first
drew breath. Fortunate in knowing nothing beyond their horizon; for
whom even the next town is a strange country, and who find their
happiness in contributing to that of those who surround them! The
wife of the governor could not separate herself from us. Taking from
her neck a rosary of pearls, she put it round that of Clara, pressed
her in her arms, wept on her bosom, and said she never passed a
moment so painful. She is young, her soul is all tenderness and
ardour, and Clara has filled her breast with feelings to which till now
she has been a stranger. Her husband is a good man, but without
energy or vivacity, the direct reverse of his charming wife. She can
never have awakened an attachment more lively than the calmest
friendship. She has no children, nor any being around her, whose
soul is in unison with her own. With what devotion she would love!
but if a stranger to the exquisite pleasures of that sentiment she is
also ignorant of its pains! may no destructive passion ever trouble
her repose.
She walked with us to the shore and waited on the beach till we
embarked. She shrieked with agony when she clasped Clara for the
last time to her breast, and leaning against a tree, gave unrestrained
course to her tears.
The good father Philip accompanied us to the vessel, and staid till
the moment of our departure. He had previously sent aboard every
thing that he thought would be agreeable to us during the voyage.
His friendly soul poured itself forth in wishes for our happiness. May
all the blessings of heaven be showered on his head!
It is Clara's fate to inspire great passions. Nobody loves her
moderately. As soon as she is known she seizes on the soul, and
centres every desire in that of pleasing her. The friendship she felt
for Jacinta, and the impression father Philip's goodness made on her,
rendered her insensible to all around her.
The vessel was full of passengers, most of them ladies, who were
astonished at beholding such grief. One of them, a native of
Jeremie, was the first who attracted the attention of Clara. This lady,
who is very handsome, and very young, has three children of the
greatest beauty, for whom she has the most impassioned fondness,
and seems to view in them her own protracted existence. She has all
the bloom of youth, and when surrounded by her children, no
picture of Venus with the loves and graces was ever half so
interesting. She is going to join her husband at St. Jago, who I hear,
is a great libertine, and not sensible of her worth. An air of sadness
dwells on her lovely countenance, occasioned, no doubt, by his
neglect and the pain of finding a rival in every woman he meets.
There is also on board a beautiful widow whose husband was killed
by the negroes, and who, without fortune or protection, is going to
seek at St. Jago a subsistence, by employing her talents. There is
something inconceivably interesting in these ladies. Young, beautiful,
and destitute of all resource, supporting with cheerfulness their
wayward fortune.
But the most captivating trait in their character is their fondness for
their children! The Creole ladies, marrying very young, appear more
like the sisters than the mothers of their daughters. Unfortunately
they grow up too soon, and not unfrequently become the rivals of
their mothers.
We are still on board, at the entrance of the harbour of St. Jago,
which is guarded by a fort, the most picturesque object I ever saw.
It is built on a rock that hangs over the sea, and the palm trees
which wave their lofty heads over its ramparts, add to its beauty.
We are obliged to wait here till to-morrow; for this day being the
festival of a saint, all the offices are shut. No business is transacted,
and no vessel can approach the town without permission.
This delay is painful; I am on the wing to leave the vessel, though it
is only four days since we left Barracoa.—I wish to know whether we
shall meet as much hospitality here as in that solitary place. Yet why
should I expect it? Hearts like those of father Philip and the lovely
Jacinta do not abound.—How many are there who, never having
witnessed such goodness, doubt its existence?
We have letters to several families here, from the governor of
Barracoa and father Philip, and St. Louis has friends who have been
long established at this place. Therefore, on arriving, we shall feel at
home; perhaps too, we may find letters from the Cape;—God grant
they may contain satisfactory intelligence.
LETTER XVII.
St. Jago de Cuba.
A month has passed, since our arrival in this place, in such a round
of visits and such a variety of amusements, that I am afraid, my
dear friend, you will think I have forgotten you. We were received by
the gentleman, to whom Clara was directed, with the most cordial
friendship. He is an ancient Chevalier de St. Louis, and retains, with
much of the formality of the court of France, at which he was raised,
all its elegance and urbanity; and having lived a number of years in
this island, he is loved and respected by all its inhabitants.
The letters which father Philip and the governor of Barracoa gave us
to their friends, have procured us great attention.
The people here are much the same as at Barracoa; perhaps they
are a little more civilized. There is some wealth, with much poverty.
The women have made great progress towards improvement since
such numbers of French have arrived from St. Domingo.—They are
at least a century before the men in refinement, but women are
every where more susceptible of polish than the lords of the
creation. Those of this town are not generally remarkable for their
beauty. There are some, however, who would be admired even in
Philadelphia, particularly the wife of the governor; but they are all
remarkable for the smallness of their feet, and they dress their hair
with a degree of taste in which they could not be excelled by the
ladies of Paris.
We arrived in the season of gaiety, and have been at several balls;
but their balls please me not!—Every body in the room dances a
minuet, which you may suppose is tedious enough; then follow the
country dances, which resemble the English, except that they are
more complicated and more fatiguing.
There are in this town eleven churches, all of them splendid, and the
number of priests is incredible! Many of them may be ranked among
the most worthless members of the community. It is not at all
uncommon to see them drunk in the street, or to hear of their
having committed the most shocking excesses. Some, however, are
excellent men, who do honour to their order and to human nature.
But the thickest veil of superstition covers the land, and it is
rendered more impervious by the clouds of ignorance in which the
people are enveloped!
Clara, who speaks the language with the facility of a native, asked
some of her Spanish friends for books, but there was not one to be
found in the place. She complained some days ago of a head-ache,
and a Spanish lady gave her a ribbon, which had been bound round
the head of an image of the Virgin, telling her it was a sovereign
remedy for all pains of the head.
The bishop is a very young man and very handsome. We see him
often at church, where we go, attracted by the music. But one
abominable custom observed there, destroys our pleasure. The
women kneel on carpets, spread on the ground, and when they are
fatigued, cross their legs, and sit Turkish fashion; whilst the men loll
at their ease on sofas. From whence this subversion of the general
order? Why are the women placed in the churches at the feet of
their slaves?
The lower classes of the people are the greatest thieves in the
world, and they steal with so much dexterity, that it is quite a
science. The windows are not glazed, but secured by wooden bars,
placed very close together. The Spaniards introduce between these
bars long poles, which have at one end a hook of iron, and thus
steal every thing in the room, even the sheets off the beds. The
friars excel in this practice, and conceal their booty in their large
sleeves!
In the best houses and most wealthy families there is a contrast of
splendour and poverty which is shocking. Their beds and furniture
are covered with a profusion of gilding and clumsy ornaments, while
the slaves, who serve in the family, and even those who are about
the persons of the ladies, are in rags and filthy to the most
disgusting degree!
How different were the customs of St. Domingo! The slaves, who
served in the houses, were dressed with the most scrupulous
neatness, and nothing ever met the eye that could occasion an
unpleasant idea.
The Spanish women are sprightly, and devoted to intrigue. Their
assignations are usually made at church. The processions at night,
and the masses celebrated before daylight, are very favourable to
the completion of their wishes, to which also their dress is well
adapted. They wear a black silk petticoat; their head is covered with
a veil of the same colour, that falls below the waist; and, this
costume being universal, and never changed, it is difficult to
distinguish one woman from another. A man may pass his own wife
in the street without knowing her. Their attachments are merely
sensual. They are equally strangers to the delicacy of affection or
that refinement of passion which can make any sacrifice the
happiness of its object may require.
To the licentiousness of the people, more than to their extreme
poverty, may be attributed the number of children which are
continually exposed to perish in the street. Almost every morning, at
the door of one of the churches, and often at more than one, a new-
born infant is found. There is an hospital, where they are received,
but those who find them, are (if so disposed,) at liberty to keep
them. The unfortunate little beings who happen to fall into the
hands of the lower classes of the people, increase, during their
childhood, the throng of beggars, and augment, as they grow up,
the number of thieves.
The heart recoils at the barbarity of a mother who can thus abandon
her child; but the custom, here, as in China, is sanctioned by habit,
and excites no horror!
LETTER XVIII.
St. Jago de Cuba.
We have received no news from the Cape, my dear friend, but it is
generally expected that it will be evacuated, as several parts of the
island have been already.
This place is full of the inhabitants of that unfortunate country, and
the story of every family would offer an interesting and pathetic
subject to the pen of the novelist.
All have been enveloped in the same terrible fate, but with different
circumstances; all have suffered, but the sufferings of each
individual derive their hue from the disposition of his mind.
One catastrophe, which I witnessed, is dreadfully impressive! I saw
youth, beauty and affection sink to an untimely grave, without
having the power of softening the bitterness of their fate.
Madame C——, a native of Jeremie, had been sent by her husband
to Philadelphia, at the beginning of the revolution, where she
continued several years, devoting all her time to improving the mind
and cultivating the talents of her only child, the beautiful Clarissa.
Sometime after the arrival of the French fleet, Madame C——, and
her daughter returned to Jeremie. She had still all the charms of
beauty, all the bloom of youth. She was received by her husband
with a want of tenderness which chilled her heart, and she soon
learned that he was attached to a woman of colour on whom he
lavished all his property. This, you may suppose, was a source of
mortification to Madame C——, but she suffered in silence, and
sought consolation in the bosom of her daughter.
When the troubles of Jeremie encreased, and it was expected every
day that it would be evacuated, Monsieur C—— resolved to remove
to St. Jago de Cuba. He sent his wife and child in one vessel, and
embarked with his mistress in another. Arriving nearly at the same
time, he took a house in the country, to which he retired with his
superannuated favourite, leaving his family in town, and in such
distress that they were often in want of bread.
Madame C——, too delicate to expose the conduct of her husband,
or to complain, concealed from her friends her wants and her grief.
A young Frenchman was deeply in love with her daughter, but his
fortune had been lost in the general wreck, and he had nothing to
offer to the object of his adoration except a heart glowing with
tenderness. He made Madame C—— the confidant of his affection.
She was sensible of his worth, and would willingly have made him
the protector of her daughter, had she not been struggling herself
with all the horrors of poverty and therefore thought it wrong to
encourage his passion.
He addressed himself to her father, and this father was rich! He
lavished on his mistress all the comforts and elegancies of life, yet
refused to his family the scantiest pittance! He replied to the
proposal that his daughter might marry, but that it was impossible
for him to give her a shilling.
Clarissa heard the unfeeling sentence with calm despair. She had
just reached the age in which the affections of the heart develope
themselves. The beauty of her form was unequalled, and innocence,
candour, modesty, generosity, and heroism, were expressed with
ineffable grace in every attitude and every feature. Clarissa was
adored. Her lover was idolatrous. The woods, the dawning day, the
starry heavens, witnessed their mutual vows. The grass pressed by
her feet, the air she respired, the shade in which she reposed, were
consecrated by her presence.
Her mother marked, with pity, the progress of their mutual passion,
which she could not forbid, for her own heart was formed for
tenderness, nor could she sanction it, seeing no probability of its
being crowned with success. But the happiness of her daughter was
her only wish, and moved by her tears, her sighs, and the ardent
prayers of her lover, she at length consented to their union. They
were married and they were happy. But alas! a few days after their
marriage a fever seized Clarissa. The distracted husband flew to her
father who refused to send her the least assistance. She languished,
and her mother and her husband hung over her in all the bitterness
of anguish. The impossibility of paying a physician prevented their
calling one, till it was too late, and, ten days after she had become a
wife, she expired. I have held this disconsolate mother to my breast,
my tears have mingled with hers: all the ties that bound her to the
world are severed, and she wishes only for the moment that will put
a period to her existence, when she fondly hopes she may be again
united to her daughter. To the husband I have never uttered a word.
His sorrow is deep and gloomy. He avoids all conversation, and an
attempt to console him would be an insult on the sacredness of his
grief. He has tasted celestial joys. He has lost the object of his love,
and henceforth the earth is for him a desert.
For the brutal father there is no punishment. His conscience itself
inflicts none, for he expressed not the least regret when informed of
the fate of his daughter.
But when the story became known, the detestation his conduct
excited was so violent, that the friends of Madame C—— have
caused her to be separated from him, and obliged him to allow her a
separate maintenance. Unfortunately their interest has been exerted
too late. A few weeks sooner it might have saved her daughter.
How terrible is the fate of a woman thus dependent on a man who
has lost all sense of justice, reason, or humanity; who, regardless of
his duties, or the respect he owes society, leaves his wife to contend
with all the pains of want, and sees his child sink to an untimely
grave, without stretching forth a hand to assist the one or save the
other!
LETTER XIX.
St. Jago de Cuba.
I write continually, my dear friend, though the fate of my letters is
very uncertain. If they arrive safe they will prove that I have not
forgotten you, and that I suffer no opportunity to pass without
informing you that I exist.
I understand that, after our departure from the Cape, the tyranny of
the general in chief encreased, and that the inhabitants were daily
exposed to new vexations. St. Louis, in particular, was the
distinguished object of his hatred. Eternally on guard at the most
dangerous posts, it was finally whispered that something, more
decidedly bad, was intended him, and he thought it was time to try
to escape from the threatening danger. Being informed of a vessel,
that was on the point of sailing, he prevailed on a fisherman to put
him outside of the fort in his boat, and wait till it came out, the
captain not daring to take him on board in the harbour. On the day
appointed, St. Louis, disguised as a fisherman, went into the boat,
and, working at the oar, they were soon beyond the fort. The vessel
approached shortly after, and St. Louis, embarking, thought himself
out of danger. As soon as they were in reach of the English ships
they were boarded, plundered and sent to Barracoa.
St. Louis had no trunk, nor any clothes but what were on him, in
which however was concealed gold to a great amount.
A gentleman, who left the Cape the day after him, informed us of his
escape, and of his having been sent to Barracoa, and also that, as
soon as the general had heard of his departure, he had sent three
barges after the vessel with orders to seize him, take him back, and,
as soon as he was landed, shoot him without further ceremony.
The whole town was in the greatest consternation. The barges were
well manned and gained on the vessel, but a light wind springing up
put it soon beyond their reach, and it was even believed that the
officer, who commanded the barges, did not use all possible
diligence to overtake them.
We were rejoiced to hear of the fortunate escape of St. Louis but felt
some anxiety at his not arriving, when lo! he appeared and gave us
himself an account of his adventures.
He is in raptures with the governor of Barracoa, his charming wife
and the good father Philip, who, hearing that he was the husband of
Clara, shewed him the most friendly attention. He brought us from
them letters glowing with affectionate recollection.
He talks of buying a plantation and of settling here. If he does I shall
endeavour to return to the continent, but poor Clara! she weeps
when I speak of leaving her, and when I consider the loneliness to
which she will be condemned without me, I have almost heroism
enough to sacrifice my happiness to her comfort.
Before the arrival of St. Louis we lived in the house of the gentleman
to whose care he had recommended us. He is a widower, the most
cheerful creature in the world, but he lives in the times that are
past; all his stories are at least forty years old. He talks continually of
the mystification of Beaumarchais, and of the magic of Cagliostro.
He told me, with all the solemnity of truth, that a lady at the court of
France, who was past fifty, bought from Cagliostro, at a great price,
a liquid, a single drop of which would take off, in appearance, ten
years of age. The lady swallowed two drops, and went to the opera
with her charms renewed, and her bloom restored to the freshness
of thirty.—At her return she called her waiting woman, who had been
her nurse and was at least seventy. She was nowhere to be found,
but a little girl came skipping in. The lady, enquiring who she was,
learned that old Ursula, intending to try the effect of the drops, had
taken too large a dose, and was skipping about with all the
sprightliness of fifteen.
Nothing enrages the old gentleman so much as to doubt the truth of
what he relates, or even to question its probability. He assured me

More Related Content

PDF
Induction Motor Control Design 1st Edition Riccardo Marino Patrizio Tomei
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Control Of Ships And Underwater Vehicles Design For Underactuated And Nonline...
PDF
Nonlinear Control Of Vehicles And Robots 1st Edition Bla Lantos
PDF
Modelling And Control Of Miniflying Machines Advances In Industrial Control 1...
PDF
Advanced Control For Constrained Processes And Systems Fabricio Garelli
Induction Motor Control Design 1st Edition Riccardo Marino Patrizio Tomei
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Control Of Ships And Underwater Vehicles Design For Underactuated And Nonline...
Nonlinear Control Of Vehicles And Robots 1st Edition Bla Lantos
Modelling And Control Of Miniflying Machines Advances In Industrial Control 1...
Advanced Control For Constrained Processes And Systems Fabricio Garelli

Similar to Practical Control of Electric Machines Model Based Design and Simulation 1st Edition Rubén Molina Llorente (20)

PDF
Predictive Functional Control Principles And Industrial Applications 1st Edit...
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Nonlinear Predictive Control Theory And Practice Basil Kouvaritakis
PDF
Practical Greybox Process Identification Theory And Applications Advances In ...
PDF
Modelling Control Systems Using Iec 61499 2nd Ed 2014 Alois Zoitl
PDF
Control Of Large Wind Energy Systems Theory And Methods For The User 1st Edit...
PDF
Control Of Mechatronic Systems Demirel Burak Emirler Mmin Tolga Gven
PDF
Fault Diagnosis And Faulttolerant Control Of Robotic And Autonomous Systems A...
PDF
Thermal Power Plant Simulation And Control Damian Flynn A Alessandri Institut...
PDF
Flexible Robot Manipulators Modelling Simulation And Control 2nd Ed Azad
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Analysis And Design Of Reset Control Systems Yuqian Guo Lihua Xie
PDF
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
PDF
Practical Pid Control 2006th Edition Antonio Visioli
PDF
Automation and control_theory_and_practice
PDF
Advanced Control Engineering Methods in Electrical Engineering Systems Mohamm...
PDF
Transparency For Robots And Autonomous Systems Fundamentals Technologies And ...
PDF
Flexible Robot Manipulators Modelling Simulation and Control Azad
PDF
Flexible Robot Manipulators Modelling Simulation and Control Azad
PDF
Design of Embedded Robust Control Systems Using MATLAB Simulink 1st Edition b...
Predictive Functional Control Principles And Industrial Applications 1st Edit...
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Nonlinear Predictive Control Theory And Practice Basil Kouvaritakis
Practical Greybox Process Identification Theory And Applications Advances In ...
Modelling Control Systems Using Iec 61499 2nd Ed 2014 Alois Zoitl
Control Of Large Wind Energy Systems Theory And Methods For The User 1st Edit...
Control Of Mechatronic Systems Demirel Burak Emirler Mmin Tolga Gven
Fault Diagnosis And Faulttolerant Control Of Robotic And Autonomous Systems A...
Thermal Power Plant Simulation And Control Damian Flynn A Alessandri Institut...
Flexible Robot Manipulators Modelling Simulation And Control 2nd Ed Azad
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Analysis And Design Of Reset Control Systems Yuqian Guo Lihua Xie
Modelling Control Systems Using IEC 61499 2nd ed. 2014 Edition Alois Zoitl
Practical Pid Control 2006th Edition Antonio Visioli
Automation and control_theory_and_practice
Advanced Control Engineering Methods in Electrical Engineering Systems Mohamm...
Transparency For Robots And Autonomous Systems Fundamentals Technologies And ...
Flexible Robot Manipulators Modelling Simulation and Control Azad
Flexible Robot Manipulators Modelling Simulation and Control Azad
Design of Embedded Robust Control Systems Using MATLAB Simulink 1st Edition b...
Ad

Recently uploaded (20)

PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
Empowerment Technology for Senior High School Guide
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
Hazard Identification & Risk Assessment .pdf
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
A powerpoint presentation on the Revised K-10 Science Shaping Paper
PDF
HVAC Specification 2024 according to central public works department
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Unit 4 Computer Architecture Multicore Processor.pptx
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Empowerment Technology for Senior High School Guide
Share_Module_2_Power_conflict_and_negotiation.pptx
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Hazard Identification & Risk Assessment .pdf
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
A powerpoint presentation on the Revised K-10 Science Shaping Paper
HVAC Specification 2024 according to central public works department
TNA_Presentation-1-Final(SAVE)) (1).pptx
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
medical_surgical_nursing_10th_edition_ignatavicius_TEST_BANK_pdf.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
Ad

Practical Control of Electric Machines Model Based Design and Simulation 1st Edition Rubén Molina Llorente

  • 1. Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.com Practical Control of Electric Machines Model Based Design and Simulation 1st Edition Rubén Molina Llorente https://ebookmeta.com/product/practical-control-of-electric- machines-model-based-design-and-simulation-1st-edition- ruben-molina-llorente/ OR CLICK HERE DOWLOAD EBOOK Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com
  • 2. Advances in Industrial Control Rubén Molina Llorente Practical Control of Electric Machines Model-Based Design and Simulation
  • 3. Advances in Industrial Control Series Editors Michael J. Grimble, Industrial Control Centre, University of Strathclyde, Glasgow, UK Antonella Ferrara, Department of Electrical, Computer and Biomedical Engineering, University of Pavia, Pavia, Italy Editorial Board Graham Goodwin, School of Electrical Engineering and Computing, University of Newcastle, Callaghan, NSW, Australia Thomas J. Harris, Department of Chemical Engineering, Queen’s University, Kingston, ON, Canada Tong Heng Lee, Department of Electrical and Computer Engineering, National University of Singapore, Singapore, Singapore Om P. Malik, Schulich School of Engineering, University of Calgary, Calgary, AB, Canada Kim-Fung Man, City University Hong Kong, Kowloon, Hong Kong Gustaf Olsson, Department of Industrial Electrical Engineering and Automation, Lund Institute of Technology, Lund, Sweden Asok Ray, Department of Mechanical Engineering, Pennsylvania State University, University Park, PA, USA Sebastian Engell, Lehrstuhl für Systemdynamik und Prozessführung, Technische Universität Dortmund, Dortmund, Germany Ikuo Yamamoto, Graduate School of Engineering, University of Nagasaki, Nagasaki, Japan
  • 4. Advances in Industrial Control is a series of monographs and contributed titles focusing on the applications of advanced and novel control methods within applied settings. This series has worldwide distribution to engineers, researchers and libraries. The series promotes the exchange of information between academia and industry, to which end the books all demonstrate some theoretical aspect of an advanced or new control method and show how it can be applied either in a pilot plant or in some real industrial situation. The books are distinguished by the combination of the type of theory used and the type of application exemplified. Note that “industrial” here has a very broad interpretation; it applies not merely to the processes employed in industrial plants but to systems such as avionics and automotive brakes and drivetrain. This series complements the theoretical and more mathematical approach of Communications and Control Engineering. Indexed by SCOPUS and Engineering Index. Proposals for this series, composed of a proposal form downloaded from this page, a draft Contents, at least two sample chapters and an author cv (with a synopsis of the whole project, if possible) can be submitted to either of the: Series Editors Professor Michael J. Grimble Department of Electronic and Electrical Engineering, Royal College Building, 204 George Street, Glasgow G1 1XW, United Kingdom e-mail: m.j.grimble@strath.ac.uk Professor Antonella Ferrara Department of Electrical, Computer and Biomedical Engineering, University of Pavia, Via Ferrata 1, 27100 Pavia, Italy e-mail: antonella.ferrara@unipv.it or the In-house Editor Mr. Oliver Jackson Springer London, 4 Crinan Street, London, N1 9XW, United Kingdom e-mail: oliver.jackson@springer.com Proposals are peer-reviewed. Publishing Ethics Researchers should conduct their research from research proposal to publication in line with best practices and codes of conduct of relevant professional bodies and/or national and international regulatory bodies. For more details on individual ethics matters please see: https://www.springer.com/gp/authors-editors/journal-author/journal-author-helpdesk/ publishing-ethics/14214 More information about this series at http://www.springer.com/series/1412
  • 5. Rubén Molina Llorente Practical Control of Electric Machines Model-Based Design and Simulation 123
  • 6. Rubén Molina Llorente BASc & MSC in Electronic Engineering Universitat de Barcelona Barcelona, Spain ISSN 1430-9491 ISSN 2193-1577 (electronic) Advances in Industrial Control ISBN 978-3-030-34757-4 ISBN 978-3-030-34758-1 (eBook) https://doi.org/10.1007/978-3-030-34758-1 © Springer Nature Switzerland AG 2020 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
  • 7. Dedicated to my family and friends in special to my wife Núria and my daughter Martina. Rubén Molina Llorente
  • 8. Series Editor’s Foreword Control system engineering is viewed very differently by researchers and those that must implement designs. The former group develops general algorithms with a strong underlying mathematical basis, while the latter have more local concerns over the limits of equipment, quality of control, and plant downtime. The series Advances in Industrial Control attempts to bridge this divide and hopes to encourage the adoption of more advanced control techniques when they are ben- eficial. The rapid development of new control theory and technology has an impact on all areas of control engineering and applications. This monograph series encourages the development of more targeted control theory that is driven by the needs and challenges of applications. A focus on applications is essential if the different aspects of the control design problem are to be explored with the same dedication that control synthesis problems have received. The series provides an opportunity for researchers to present an extended exposition of new work on advanced control, raising awareness of the substantial benefits, and exploring the challenges that can arise. One of the unusual features of this monograph is that it deals with implemen- tation problems very often neglected in more academic texts, drawing upon the author’s very relevant application experience. Chapter 1 sets the tone, being con- cerned with embedded control systems. Problems in real-time implementation of control systems have become more onerous now that most advanced control system designs are “model-based.” They have many advantages and allow for the multi-input multi-output nature of a process or machine explicitly, but implemen- tation can be problematic. This first chapter is very wide-ranging, covering areas such as “hardware-in-the-loop testing, software tools, and system architectures.” Chapter 2 involves electrical machine control problems covering a range of classical and fuzzy control methods, and dealing with well-known problems in digital implementation. Various structures for control systems such as feedforward and feedback control systems and cascade control structures are considered. The problems of digital implementation are again considered from a practical viewpoint, describing the type of equipment involved. It is unusual for an introduction to classical PI or PID control to be extended into a discussion of real implementation vii
  • 9. issues. This should be particularly valuable to engineers in industry. The material on fuzzy control is also interesting and includes a useful electric machine speed control application. Chapter 3 deals with three-phase electrical systems which are of course very common for use with motor control systems. In this case, the material is more basic electrical engineering but written from a control engineer’s perspective. This pro- vides an introduction to some of the material in Chap. 4 on the fundamentals of electrical machines. From a control viewpoint, it is important to consider the non-linearities mentioned in these systems. The general model information should also be valuable to those simulating such systems. This overview of electrical machine types will be particularly helpful to control engineers that often use very simplified models and do not need to cover the detailed electromagnetic charac- teristics of such machines. It is also a reminder that the viewpoint of an electrical engineer in terms of vector diagrams of machine currents is rather different to the usual control engineer’s transient characteristic investigations. Chapter 5 on modeling electrical machines returns to more familiar territory for the control engineer dealing with state-space systems and how they may be used to represent AC or DC machines. The discussions extend into simulation of these systems. Chapter 6 is concerned with measurements in electrical drive systems. This is also a topic which is often neglected in more academic texts but from a practical viewpoint is important since faults in systems can often be traced back to problems with measurements. There is a useful overview of the different types of sensors used and their characteristics. Chapter 7 is concerned with microcontrollers for electric drive systems. Most texts avoid the details of technology since these change so rapidly; however, from a process or commissioning engineer’s perspective it is one of the most important areas to understand. The different modules involved and timing problems are dis- cussed, and aspects of analogue-to-digital conversion are covered. A family of microcontrollers is described, and the simulation of systems, including the machines and component parts, is considered. Chapter 8 deals with three-phase voltage-source inverters for high-performance control of three-phase machines. This is another area where a good understanding of the power electronics is useful for both simulating the system and understanding the noise and uncertainties that are present. This is valuable when treating control problems and breakdowns. Chapter 9 is concerned with the topic of space vector modulation. Chapter 10 returns to more familiar territory dealing with the practical control of AC machines. It describes the speed and current loops using a DC machine as an introduction to AC machine vector control. The familiar tools of Bode diagrams and transient time responses are used. The block diagrams of var- ious machine control systems are helpful, and topics such as sensorless control are explored. Chapter 11 is concerned with model-in-the-loop development in vector control of induction machines. Control loop analysis is performed, and all aspects of simulation and implementation are discussed. The application to electric vehicle and electric aircraft propulsion control systems is particularly interesting and viii Series Editor’s Foreword
  • 10. topical. This is of course a hugely important topic in the automotive and aircraft industry at present. The book contains appendices that also cover practical material needed by design engineers and their commissioning colleagues. This text is therefore a valuable contribution to the Advances in Industrial Control series, bridging the gap between the electrical engineer and the control engineer, and going far into the application and equipment aspects of producing a real working control system. Glasgow, UK October 2019 Michael J. Grimble Series Editor’s Foreword ix
  • 11. Preface It is well known that electric machines are widely used in numerous applications. Nowadays, recent applications such as electrified aircraft propulsion (EAP) use propulsors (propeller or fans) driven by electric machines. In the aviation sector, the electric machines and power converters should meet a power density 2–3 times state of the art in the MW power range, with efficiencies higher than 96 and 99%, respectively. In the last few years, applications such as drones and traction machines in electric vehicles are being a challenge because the demands in terms of efficiency and durability are also considerable. Renewable energies also consist of continuous improvement in terms of the efficiency of the energy developed. The advanced design of the AC machines with finite element analysis (FEA) increasingly allows obtaining high-performance designs and high power density machines which together with sophisticated control systems and the appropriate hardware continue to optimize their operation in a wide range of speed. The result is that lower-performance machines such as brushed machines are being displaced in many applications. The electric machine systems are a multidisciplinary area. The machine design, the mechanical systems, the electronic hardware composed by the power semi- conductors, sensors, actuators, and the embedded systems are designed together with the collaboration of multidisciplinary engineering teams to guarantee success. Furthermore, the new engineering design process and new sophisticated co-simulation tools accelerate the time to market of the motor control units (MCUs) with high-quality results. The speed/torque variation in electromechanical systems where the speed/torque is adapted according to the necessity of the system is the role of the electric drives. The control system of these drives and therefore the control of the machine are increasingly complex systems and usually consist of microprocessed embedded systems. During the last few years, the increase of the embedded system complexity in electrical machine control applications involves an increase of the model-based design (MBD) where the lines of code are mostly replaced by code generated on tested models in a personal computer environment. MBD provides a mathematical and visual approach to develop complex control systems. During the development xi
  • 12. process, models of the systems can be used for design, analysis, simulation, veri- fication, and automatic code generation for the embedded systems. MBD is transforming the way of working of engineers and scientists since the design tasks of the laboratory and field are moved to a simulation environment in a desktop. The simulation and verification tools allow to test, refine, and retest the models without to build prototypes. Different test stages as model-in-the-loop (MiL) and software-in-the-loop (SiL) can be carried out in the MBD process. The MBD, together with appropriate software architecture patterns, guarantees success in the motor control units (MCUs). The automotive industry is one of the industries which applies this modern design methodology where the benefits can be observed today. There is wonderful control of electric machine books based on the experience of their authors. However, in this book, the intention has been to dedicate as much as possible to the practical application of how the control of an electric machine could be carried out with the modern tools available today in an efficient manner. The book consists of twelve chapters. Chapter 1 describes the modern design technics based on MBD, the V-model, the computation simulation software packages, and the software architecture patterns. Chapter 2 discusses the basic regulation based on classic controllers such as the proportional–integral–differential (PID), different control structures, digitalization methods for PIDs, aliasing, zero-order hold, quantifiers, and time delays, and with examples and simulations including a controller based on fuzzy logic. Chapter 3 discusses three-phase sys- tems mostly used in AC machines. The three-phase systems with star and delta connections are analyzed. The power calculation with practical explanations is also analyzed, being the prelude to the in-depth analysis of the mathematical tools that facilitate the analysis of AC machines. Furthermore, practical graphics and exam- ples of a digital implementation of mathematical axis transformations (Clarke and Park transformations), RMS, and electric power computations are represented. In Chap. 4, is shown a classification of the most common electrical machines starting with the more traditional machines such as the DC-brushed and induction machines (IMs), and finishing with more sophisticated machines such as the per- manent magnet-assisted synchronous reluctance machine (PMASynRM). Their primary structures, their mathematical expressions in a steady-state, in space vector, in dqs transformations, and the electromagnetic torque expression for each machine are shown. Moreover, basic concepts of machine design, sections of different machines, and simulation results are introduced based on Altair, Flux™, and FluxMotor™ FEA software package. Chapter 5 is a continuation of Chap. 4 where it described the models with continuous state-space methods of the DC and the different AC machines such as IM, permanent magnet synchronous machine (PMSM), SynRM, and PMASynRM. As an example of the utility of the discrete models, the PMASynRM is described with its discrete model for its implementation in Simulink® , which can be used for C code generation, to be able to run it in real time in a DSP or FPGA. As a prelude of the next chapters, the closed-loop control of the current loops is introduced to verify the effect produced by the inherent cross-coupling of the AC machines, as well as a solution to the decoupling that optimizes its control. xii Preface
  • 13. Chapter 6 is reserved to treat a different subject as sensors and sensing circuits used in most of the DC and AC drives. Voltage, current, temperature, speed, and position are the basic measurements in the machine control applications for control algorithms and its protection in fail situations such as locked rotor or overtem- peratures. In some applications, the control part should be isolated from the power stage, which is typically fed by high voltage. Then, as some of the sensors should be directly connected to the high-voltage side, some isolation mechanism should be used as it is shown in this chapter. In this chapter, the design of the above mea- surement variables with its hardware signal conditioning, software strategies, and experimental results is deeply analyzed for the proper design of high-performance machine control. With the same purpose as Chap. 6, another subject about the knowledge of the standard microcontroller/DSP peripherals used in the implementation of the electric machine control such as I/O, timers, and A/D converters is reserved for Chap. 7. Specific features and functions such as smart high-resolution pulse width modu- lation (PWM) timers and Delta-Sigma A/D converters are also treated in detail. The high-resolution PWM signals help to generate smoother sinusoidal waveforms with high-frequency fine-tuning, while Delta-Sigma A/D converters allow measuring the machine phase current accurately. The microcontroller/DSP peripherals, as well as the CPU performance, are determinant for the microcontroller/DPS selection, but it should be in agreement with the application. The GTM Timer module from Bosch is an example of a smart high-resolution timer which can be found as an intellectual property (IP) integrated into different microcontroller manufacturers. In this chapter, A/D converters and specific peripherals for high-performance machine control are covered with simulations and real implementation examples for the AURIX™ family of Infineon and RX600 family of Renesas. After describing the previous chapters, the reader can be more comfortable with Chap. 8, which discusses all necessary knowledge needed to design a voltage-source inverter (VSI). The voltage-source inverter (VSI) is a fundamental power electronic drive where high-performance control for three-phase electrical machines can be achieved. The continuous improvement of power devices that increasingly improve their performance, such as high electron mobility transistor (HEMT) devices, allows higher efficiencies and more and more wide range of use. The inverter not only is a three-phase bridge made by three half-bridge legs but also needs other elements for its correct operation. The stability of the voltage source required by the three-phase bridge is a key to optimizing its performance. Also, the inverter and machine protection elements allow having a safe behavior in the abnormal situations that prevent its destruction and other near components. These protection elements join the control logic and constitute the motor control unit (MCU). The analysis of the switching and conduction losses in the power devices is analyzed in detail, as well as the effects of capacitances, inductances, and parasitic resistances. The key elements, such as gate drivers, are also analyzed, even for devices in parallel. The effects of high dv/dt are also analyzed, especially when the length of the connection power cable between the inverter and the machine is considerable, providing different solutions such as the use of sinusoidal filters. In Preface xiii
  • 14. this chapter, all the necessary parts for the design of a VSI for control of three-phase machines are entered in detail, providing experimental results and simulations for better understanding, as well as a complete model of a VSI (power plant). Once minimum knowledge of the VSI is acquired in Chap. 8, in Chap. 9 is discussed the space vector modulation (SVM), also known as SVPWM. SVM is increasingly replacing more traditional modulations such as six-step and sinusoidal modulation as it provides better use of the available DC-link voltage and a reduction in harmonic content. The model-based design is approached for SVM algorithm development which is tested to assure a correct operation before its implementation in real hardware. The theory of SVM in its two modes, continuous and discontinuous, deadtime compensation, model-based design using MATLAB and Simulink, simulations, and the experimental results are treated. Chapter 10 comes back to the machine control by using high-performance control system as field-oriented control. The electric machine based on a control system with the machine model is not a simple task but requires necessary simu- lation tools to understand its basic operation. The complexity of their models suggests performing first simulations in both open and closed loops, without using an electric drive (VSI or DC servo stage). High-performance control, such as vector control for AC machines, can be achieved with excellent results by using suitable simulations. The chapter starts with the speed and current loop control theory of the rotation loads for DC machine, which is used as an introduction of AC machine vector control. Some simulation results with and without electric drive are illus- trated. The chapter continues with the theoretical and practical part of vector control through simulations without electric drive, as well as the practical development of magnitude and position flux observers, and estimators for sensorless systems. The most relevant AC machines on the market are covered, as seen in Chap. 4. Chapter 11, which discusses the model-based design (MBD) process in a field-oriented control for induction machines. Two induction machines are pre- sented, one with 5 HP of power for industrial purposes and other with 110 HP of power for electric vehicle (EV) application or full electric aircraft propulsion pro- peller (one of my many passions), both with a three-phase VSI. The MBD is increasingly used in the field of electrical machine control because of the numerous advantages it offers, such as improving product quality and reducing development time. MBD is transforming the way of working of engineers and scientists since the design tasks of the laboratory and field are moved to a simulation environment in a desktop. The control system of an electrical machine can be rapidly prototyped using a simulation environment while in parallel the software architecture necessary for its implementation in a microcontroller or DSP can be discussed and designed. The success of these two steps guarantees a better performance of the model-in-the-loop (MiL), which is where the control of the machine on a simulated plant is evaluated, with a certain level of realism. If the control requirements are minimally met, where most of the errors are solved, the automatic code generation allows performing tests with the real plant, or on a processor-in-the-loop (PiL) or hardware-in-the-loop (HiL) scenarios. In EV/HEV automotive systems, the plant is the vehicle which is also modeled to evaluate the control of the electric machine. xiv Preface
  • 15. In the Chap. 12 is treated a possible real-time model for emulation purpose of the machine and VSI. For faster development, the hardware composed by the machine, inverter, and controller can be replaced by a precise real-time model for emulation. The control systems increasingly use their verification and development through a digitized plant on an field-programmable gate array (FPGA) platform so that control algorithms can be evaluated without the need for real hardware, in this case an inverter and an electric machine. However, real-time simulation of electric machine models and the VSI can be especially complicated due to the rapid nature of the dynamics, that is, reduced time constants, especially on very low power machines. The switching of PWM signals of up to tens of kHz requires sampling rates of the order of several MHz to obtain reasonable accuracy, for example, to model the ripple produced by the PWM in the inductance of the machine. That is why FPGAs are the ideal platform for complex real-time simulations due to their ability to process data in parallel allowing sampling and execution rates up to the MHz range. To arouse the curiosity of the readers, in the second part of the Appendix, it presented simulation detail of results performed with FluxMotor™ according to a similar machine analyzed in Chap. 4 in motor and generator mode. It corresponds to a 55 kW IPMSM machine with 48 stator slots, 8 poles, and permanent magnets mounted in V-pole configuration in the rotor. The construction details are deeply explained. To have an idea of the size, the machine has an external stator radius of 134.5 mm and a stack length of 84 mm. The total mass of the machine is 32.137 Kg, which means a power density of 1.7 kW/Kg. Due to this power density and other factors, the application of this machine can be for electric vehicles. The book is intended for a wide variety of readers because during the expla- nations, my intention has always been to explain the theory as I would have liked it. The different readers can be academia and industry researchers, graduate students and their professors, engineers, and practitioners who are working in the field of the machine control systems for any industrial sector. The theory is always necessary, but I have intended to keep practical descriptions as much as possible. For students and newcomers, the main prerequisites are undergraduate courses on system control theory, basics in electric machines, and power electronics. The simulations and experimental results in this book have been developed thanks to my 16 years of experience in power electronics and control systems, especially in machine control systems from which I decide to graduate with a final degree project based on field-oriented control for induction machine in 2003. In my modest opinion, this book is a book that I wish had during my years of research since it would have greatly facilitated my understanding of the control of electric machines thanks to its practical contribution. Preface xv
  • 16. Lastly, I give my special thanks and love to my wife, Núria, who will always be at my side, for her patience during these last 3 years which I have been very busy preparing this book. Barcelona, Spain October 2019 Rubén Molina Llorente Acknowledgements I would like to particularly thank the following persons (in alphabetical order) for their contributions: Ph.D. Ramón Bargalló Perpiñà (Polytechnic University of Catalonia), Isabelle Feix (Infineon Technologies AG), Jasmin Hamp (AUTOSAR), Hua Jin (Powersim), Vincent Leconte (Altair Engineering Inc.), Amadeo Tierno (Altair Engineering Inc.), Bernd Westhoff (Renesas Electronics Corporation). In addition, I would like to thank MathWorks. xvi Preface
  • 17. Trademark Acknowledgements 1. MATLAB® , Simulink® , Stateflow® and Simscape Electrical™ (formerly SimPowerSystems™ and SimElectronics® ) are registered trademarks or trade- marks of The MathWorks, Inc. For more information and a list of additional trademarks contact: The MathWorks, Inc., 1 Apple Hill Drive, Natick, MA 01760-2098, USA Web: mathworks.com/trademarks for a list of additional trademarks. 2. PSIM is a registered trademark of Powersim Inc. For more information, please contact: Powersim, Inc., 2275 Research Blvd, Suite 500, Rockville, MD 20850, USA E-mail: info@powersimtech.com, Web: www.powersimtech.com 3. Altair™ and FluxMotor™ is a registered trademark of Altair Engineering, Inc. For more information, please contact: Altair Engineering, Inc., 1820 E. Big Beaver Rd., Troy, MI 48083, USA Phone: +1 (248) 614-2400 Fax: +1 (248) 614-2411 Web: www.altair.com 4. TEKTRONIX is a registered trademarks of Tektronix, Inc. For more informa- tion, please contact: Tektronix, Inc., 14150 SW Karl Braun Drive, P.O. Box 500 Beaverton, OR 97077, USA Web: www.tek.com 5. Teledyne LeCroy is a registered trademark of Teledyne LeCroy, Inc. For more information, please contact: Teledyne LeCroy, Inc., 700 Chestnut Ridge Road, Chestnut Ridge, NY 10977-6499, USA Phone: +1 800-553-2769 or +1 845-425-2000 Web: www.teledynelecroy.com xvii
  • 18. 6. AUTOSAR is a trademark of AUTOSAR GbR. The word AUTOSAR and the AUTOSAR logo are registered trademarks. For more information, please contact: Frankfurter Ring 224, 80807 Munich, Germany Phone: +49 (89) 452450-395 7. AURIXTM and TriCore® are a trademark of Infineon Technologies AG. For more information, please contact: Infineon Technologies AG, IFAG C EC MR, Am Campeon 1-15, 85579 Neubiberg, Germany 8. AUDI is a trademark of AUDI AG. For more information, please contact: Ettinger Street, 85057 Ingolstadt, Bavaria, Germany 9. Renesas and the Renesas logo are trademarks of Renesas Electronics. For more information, please contact: TOYOSU FORESIA, 3-2-24 Toyosu, Koto-ku, Tokyo, 135-0061, Japan Web: www.renesas.com 10. BOSCH is a trademark of Robert Bosch GMBH. For more information, please contact: Robert Bosch GmbH, Postfach 13 42, 72703 Reutlingen, Germany Web: www.bosch.com 11. SIEMENS is a trademark of Siemens Aktiengesellschaft. For more information, please contact: Siemens Aktiengesellschaft, Werner-von-Siemens-Straße, 180333 Munich, Germany Web: www.siemens.com xviii Trademark Acknowledgements
  • 19. Contents 1 Embedded Control System Development Process: Model-Based Design and Architecture Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Model-Based Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.1 V-Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2.2 Test Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.2.1 Model-in-the-Loop (MiL) . . . . . . . . . . . . . . 5 1.2.2.2 Software-in-the-Loop (SiL) . . . . . . . . . . . . . 5 1.2.2.3 Processor-in-the-Loop (PiL) . . . . . . . . . . . . . 5 1.2.2.4 Hardware-in-the-Loop (HiL) . . . . . . . . . . . . 6 1.2.3 MBD Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Computer Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3.1 MATLAB/Simulink . . . . . . . . . . . . . . . . . . . . . . . . . . 13 1.3.2 PSIM® . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 1.3.3 Finite Element in Electric Machines . . . . . . . . . . . . . . 18 1.4 Software Architecture Patterns . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 1.4.2 Automotive Open System Architecture (AUTOSAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.5 Discrete-Time Electric Machine Control System Overview . . . . 24 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 2 Electric Machine Control Technics . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.1 Control Theory Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.1.1 Stability Analysis of Second-Order Systems. . . . . . . . . 29 2.1.1.1 Time Domain . . . . . . . . . . . . . . . . . . . . . . . 30 2.1.1.2 Frequency Domain . . . . . . . . . . . . . . . . . . . 35 2.2 Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.1 Feedforward Control. . . . . . . . . . . . . . . . . . . . . . . . . . 36 2.2.2 Cascade Control Structure . . . . . . . . . . . . . . . . . . . . . . 39 xix
  • 20. 2.3 Classical PID Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 2.3.1 PD Controller. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 2.3.2 PI Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 2.3.3 PID Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 2.3.4 Anti-windup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 2.4 Digital Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 2.4.1 Aliasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 2.4.1.1 Zero-Order Hold (ZOH) . . . . . . . . . . . . . . . 52 2.4.2 Quantifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 2.4.3 Time Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 2.4.4 Integrators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 2.4.5 Derivative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 2.5 Digital PID Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.5.1 Discrete PI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 2.5.1.1 Trapezoidal Discrete PI Controller . . . . . . . . 62 2.5.1.2 Backward and Forward Discrete PI Controller . . . . . . . . . . . . . . . . . . . . . . . . . . 63 2.5.2 Digital PI Implementation . . . . . . . . . . . . . . . . . . . . . . 65 2.5.2.1 MATLAB Function Implementation . . . . . . . 65 2.5.2.2 Stateflow® Implementation . . . . . . . . . . . . . 67 2.6 Fuzzy Logic as Controllers . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 2.6.2 Fuzzy Logic System . . . . . . . . . . . . . . . . . . . . . . . . . . 72 2.6.2.1 Fuzzifier . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 2.6.2.2 Knowledge Base . . . . . . . . . . . . . . . . . . . . . 74 2.6.2.3 Inference Mechanism . . . . . . . . . . . . . . . . . 74 2.6.2.4 Defuzzifier . . . . . . . . . . . . . . . . . . . . . . . . . 74 2.6.3 Fuzzy Logic Control. . . . . . . . . . . . . . . . . . . . . . . . . . 74 2.6.3.1 Electric Machine Speed Control Application . . . . . . . . . . . . . . . . . . . . . . . . . 76 2.6.4 Adaptive Fuzzy PI . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 2.6.5 Fuzzy + PI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 3 Three-Phase Electrical Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 3.2 Three-Phase Balanced Linear Load . . . . . . . . . . . . . . . . . . . . . 87 3.2.1 Star (Wye) Connection . . . . . . . . . . . . . . . . . . . . . . . . 87 3.2.2 Delta Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90 3.2.3 Low- and High-Voltage AC Machine Connection . . . . 91 3.2.3.1 Delta/Star Connection with Six-Lead Terminal Wiring . . . . . . . . . . . . . . . . . . . . . 92 3.2.3.2 Low and High Voltage with Nine-Lead Terminal Wiring . . . . . . . . . . . . . . . . . . . . . 93 xx Contents
  • 21. 3.3 Power in Three-Phase Systems . . . . . . . . . . . . . . . . . . . . . . . . 96 3.4 Vector Representation in Three-Phase Systems . . . . . . . . . . . . . 100 3.5 Mathematical Transformation for AC Machine Analysis . . . . . . 104 3.5.1 The Clarke and Concordia Transformation . . . . . . . . . . 104 3.5.2 The Rotation Transformation. . . . . . . . . . . . . . . . . . . . 108 3.6 Instantaneous Power in Three-Phase Systems . . . . . . . . . . . . . . 112 3.6.1 Instantaneous Power Computation . . . . . . . . . . . . . . . . 113 3.7 RMS Computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 4 Fundamentals of Electric Machines . . . . . . . . . . . . . . . . . . . . . . . . 119 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 4.2 Electric Machine Classification . . . . . . . . . . . . . . . . . . . . . . . . 121 4.3 Brushed Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 4.3.1 Universal Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 4.3.1.1 Torque Variation. . . . . . . . . . . . . . . . . . . . . 128 4.3.2 Self-Excited and Separately Excited Torque Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 4.3.3 Brushed Machine Operation . . . . . . . . . . . . . . . . . . . . 134 4.4 Three-Phase Brushless AC Machine. . . . . . . . . . . . . . . . . . . . . 135 4.4.1 AC Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . 137 4.4.1.1 Space Vector Theory in Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 4.4.1.2 Two-Axis Model. . . . . . . . . . . . . . . . . . . . . 143 4.4.1.3 Steady-State Equivalent Circuit . . . . . . . . . . 147 4.4.1.4 Power Flow . . . . . . . . . . . . . . . . . . . . . . . . 149 4.4.1.5 Speed Variation in an Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 4.4.1.6 Capability Curve of an Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 4.4.1.7 Induction Machine NEMA Classification . . . 155 4.4.1.8 Induction Machine Operation . . . . . . . . . . . . 157 4.4.2 PMAC and BLDC Machine . . . . . . . . . . . . . . . . . . . . 158 4.4.2.1 IPMSM Machine Analysis Overview with FEA . . . . . . . . . . . . . . . . . . . . . . . . . . 162 4.4.2.2 Space Vector Theory in PMSM . . . . . . . . . . 168 4.4.2.3 Particularity for SMPMSM . . . . . . . . . . . . . 175 4.4.2.4 Particularity for IPMSM Machine . . . . . . . . 175 4.4.2.5 Steady-State Equations of PMSM . . . . . . . . 175 4.4.2.6 PMSM Operation . . . . . . . . . . . . . . . . . . . . 179 Contents xxi
  • 22. 4.4.3 Synchronous Reluctance Machine . . . . . . . . . . . . . . . . 180 4.4.3.1 Space Vector Theory in SynRM and PMASynRM . . . . . . . . . . . . . . . . . . . . 185 4.4.3.2 Steady-State Equations of SynRM . . . . . . . . 188 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 5 Modeling Electric Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 5.1 Mechanical Motion Model (Newton’s Laws of Motion) . . . . . . 193 5.2 State-Space Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196 5.3 Modeling DC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200 5.3.1 Continuous State-Space . . . . . . . . . . . . . . . . . . . . . . . 201 5.4 Three-Phase Brushless AC Machine Model . . . . . . . . . . . . . . . 206 5.4.1 Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 206 5.4.1.1 Continuous State-Space Model of Induction Machine . . . . . . . . . . . . . . . . . 206 5.4.2 PMAC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211 5.4.2.1 PMSM Model . . . . . . . . . . . . . . . . . . . . . . . 211 5.4.2.2 Synchronous Reluctance Machine . . . . . . . . 223 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 6 Measurement in Electric Drives . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 6.2 Voltage Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 6.2.1 Non-isolated Voltage Measurement . . . . . . . . . . . . . . . 238 6.2.2 Adding a Low-Pass Filter (LPF) . . . . . . . . . . . . . . . . . 241 6.3 Temperature Measurement. . . . . . . . . . . . . . . . . . . . . . . . . . . . 245 6.3.1 The Thermistor for Temperature Measurement . . . . . . . 246 6.3.1.1 NTC as a Temperature Measurement . . . . . . 247 6.4 Current Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250 6.4.1 Non-isolated Current Measurement . . . . . . . . . . . . . . . 251 6.4.1.1 Shunt Resistor . . . . . . . . . . . . . . . . . . . . . . 251 6.4.2 Isolated Current Measurement . . . . . . . . . . . . . . . . . . . 252 6.4.2.1 Using a Current Transformer (CT) . . . . . . . . 252 6.4.2.2 Current Measurement Using a Hall Effect Sensor . . . . . . . . . . . . . . . . . . . . . . . 253 6.5 Speed Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 6.5.1 Tachometer Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . 255 6.5.2 Speed/Position Measurement . . . . . . . . . . . . . . . . . . . . 256 6.5.2.1 Resolver . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 6.5.2.2 Encoder Position Sensor . . . . . . . . . . . . . . . 258 xxii Contents
  • 23. 7 Microcontroller Peripherals for Electric Drives . . . . . . . . . . . . . . . 263 7.1 General Timer Module (GTM) . . . . . . . . . . . . . . . . . . . . . . . . 263 7.1.1 GTM Sub-modules . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 7.1.1.1 Advanced Routing Unit (ARU) . . . . . . . . . . 265 7.1.1.2 Timer Input Module (TIM) . . . . . . . . . . . . . 265 7.1.1.3 Timer Output Module (TOM) and ARU-TOM (ATOM) . . . . . . . . . . . . . . 267 7.1.1.4 SPE (Sensor Pattern Evaluation) . . . . . . . . . 271 7.2 Analog-to-Digital Converter . . . . . . . . . . . . . . . . . . . . . . . . . . 273 7.2.1 Successive Approximation A/D Converter . . . . . . . . . . 273 7.2.2 Delta-Sigma Converter . . . . . . . . . . . . . . . . . . . . . . . . 274 7.3 Infineon AURIX™ Automotive Microcontroller . . . . . . . . . . . . 278 7.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 7.3.2 Infineon AURIX™ Family . . . . . . . . . . . . . . . . . . . . . 280 7.3.3 GTM in AURIX™ Family . . . . . . . . . . . . . . . . . . . . . 282 7.3.4 DSADC in AURIX™ Family . . . . . . . . . . . . . . . . . . . 284 7.4 General-Purpose Renesas RX600 Microcontroller . . . . . . . . . . . 285 7.4.1 Multi-function Timer Pulse Unit 3 (MTU3) . . . . . . . . . 286 7.4.1.1 MTU3, MTU4 as Complementary PWM Mode . . . . . . . . . . . . . . . . . . . . . . . . 286 7.4.1.2 MTU5 as Deadtime Compensation. . . . . . . . 289 7.4.2 A/D Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290 7.5 Modeling and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291 7.5.1 Modeling and Simulation of ATOM . . . . . . . . . . . . . . 291 7.5.2 ATOM Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 295 7.5.3 Simulation of SDADC . . . . . . . . . . . . . . . . . . . . . . . . 298 7.5.4 Simulation of MTU for Three-Phase Machines . . . . . . 302 7.5.5 MTU3-4 PWM Configuration . . . . . . . . . . . . . . . . . . . 303 7.5.6 MTU5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . 307 7.5.7 Simulation of A/D Converter . . . . . . . . . . . . . . . . . . . 308 7.5.8 A/D Configuration for Three-Phase Machines . . . . . . . 309 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312 8 Analysis of Three-Phase Voltage-Source Inverters . . . . . . . . . . . . . 313 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313 8.2 VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 8.2.1 Single-Phase VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 8.2.2 Three-Phase VSI . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 8.3 Power Semiconductor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 8.3.2 Semiconductor Technology Overview . . . . . . . . . . . . . 324 Contents xxiii
  • 24. 8.3.3 Parasitic Effect in Semiconductor Switches . . . . . . . . . 327 8.3.3.1 Parasitic Capacitance . . . . . . . . . . . . . . . . . . 327 8.3.3.2 Parasitic Inductance. . . . . . . . . . . . . . . . . . . 328 8.3.4 Gate Charge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331 8.3.5 Dynamic Characteristic . . . . . . . . . . . . . . . . . . . . . . . . 331 8.3.5.1 Turn-On, Turn-Off Time Definition . . . . . . . 331 8.3.5.2 Turn-On, Turn-Off Dynamic Characteristic . . . . . . . . . . . . . . . . . . . . . . . 332 8.3.6 Snubber Circuits. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335 8.3.7 Semiconductor Power Losses . . . . . . . . . . . . . . . . . . . 336 8.3.7.1 Static Losses. . . . . . . . . . . . . . . . . . . . . . . . 337 8.3.7.2 Dynamic Losses . . . . . . . . . . . . . . . . . . . . . 339 8.3.7.3 Total Power Losses . . . . . . . . . . . . . . . . . . . 342 8.3.7.4 Power Losses Simulation. . . . . . . . . . . . . . . 343 8.4 VSI Design Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 8.4.1 Gate Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 8.4.1.1 Half-Bridge Driver . . . . . . . . . . . . . . . . . . . 352 8.4.1.2 Miller Effect . . . . . . . . . . . . . . . . . . . . . . . . 354 8.4.1.3 Paralleling Power Switch Semiconductor . . . 356 8.4.2 Current Measurement . . . . . . . . . . . . . . . . . . . . . . . . . 357 8.4.2.1 Phase Current Measurement in a Three-Phase Machine . . . . . . . . . . . . . . 360 8.4.3 Output Voltage Distortion . . . . . . . . . . . . . . . . . . . . . . 366 8.4.3.1 Deadtime, Turn-On, and Turn-Off Effect . . . 366 8.4.3.2 Voltage Drops in the Semiconductors. . . . . . 368 8.4.3.3 Simulation Results . . . . . . . . . . . . . . . . . . . 370 8.4.4 DC Voltage Source . . . . . . . . . . . . . . . . . . . . . . . . . . 372 8.4.4.1 DC-Link Capacitor Selection . . . . . . . . . . . . 372 8.4.5 DC-Link Pre-charge . . . . . . . . . . . . . . . . . . . . . . . . . . 380 8.4.6 DC-Link Discharge . . . . . . . . . . . . . . . . . . . . . . . . . . 387 8.5 VSI in Dynamic and Regenerative Braking Mode . . . . . . . . . . . 389 8.6 Machine Terminal Overvoltage . . . . . . . . . . . . . . . . . . . . . . . . 393 8.6.1 Involved Impedance . . . . . . . . . . . . . . . . . . . . . . . . . . 394 8.6.2 Sine-Wave Low-Frequency Output Filter . . . . . . . . . . . 396 8.6.3 High-Frequency Output Filter . . . . . . . . . . . . . . . . . . . 397 8.6.4 dv/dt Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 8.6.4.1 Sine-Wave Filter at Inverter Output Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . 402 8.6.4.2 High-Frequency RC Filter at the Machine Terminals . . . . . . . . . . . . . . . . . . . . . . . . . . 404 8.7 VSI Self-protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 8.7.1 Short-Circuit Protection (Surge Current Detection) . . . . 406 8.7.2 Overcurrent Detection . . . . . . . . . . . . . . . . . . . . . . . . . 410 xxiv Contents
  • 25. 8.7.3 Overvoltage and Undervoltage Detection . . . . . . . . . . . 411 8.7.4 Overheating Detection . . . . . . . . . . . . . . . . . . . . . . . . 412 8.8 Machine Fault Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413 8.8.1 Locked Rotor Detection . . . . . . . . . . . . . . . . . . . . . . . 413 8.8.2 Overload Detection. . . . . . . . . . . . . . . . . . . . . . . . . . . 415 8.8.3 Overheating Detection . . . . . . . . . . . . . . . . . . . . . . . . 418 8.8.4 Open-Phase Detection. . . . . . . . . . . . . . . . . . . . . . . . . 420 8.9 VSI Power Plant Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424 9 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.1 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427 9.1.2 Space Vector Modulation . . . . . . . . . . . . . . . . . . . . . . 431 9.1.2.1 Continuous SVM (T0 = T7) . . . . . . . . . . . . . 438 9.1.2.2 Discontinuous SVPWM (T0 6¼ T7) . . . . . . . . 438 9.1.2.3 Voltage Resolution and Restriction Time . . . 440 9.1.2.4 Deadtime Compensation . . . . . . . . . . . . . . . 441 9.2 Model Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444 9.2.2 SVPWM Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445 9.2.3 Deadtime Compensation Model. . . . . . . . . . . . . . . . . . 448 9.2.4 Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . 449 9.2.4.1 SVPWM Simulation Results . . . . . . . . . . . . 449 9.2.4.2 Deadtime Compensation Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 9.3 Experimental Results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453 9.3.1 Continuous SVPWM . . . . . . . . . . . . . . . . . . . . . . . . . 453 9.3.2 Discontinuous SVPWM . . . . . . . . . . . . . . . . . . . . . . . 457 9.3.3 Distortion Effect in the AC Current . . . . . . . . . . . . . . . 458 9.3.4 Semiconductor Temperature Effect . . . . . . . . . . . . . . . 459 9.3.5 Deadtime Compensation . . . . . . . . . . . . . . . . . . . . . . . 460 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 10 Practical Control of AC Machine . . . . . . . . . . . . . . . . . . . . . . . . . . 463 10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 10.2 Control Overview in an Electrical Machines . . . . . . . . . . . . . . . 464 10.2.1 Rotating Load Speed Control Design. . . . . . . . . . . . . . 464 10.2.1.1 Open-Loop Speed Control . . . . . . . . . . . . . . 464 10.2.1.2 Closed-Loop Speed Control Design . . . . . . . 466 10.2.2 PI Current Control Design . . . . . . . . . . . . . . . . . . . . . 471 10.2.2.1 Current Control Design for a DC Machine . . . . . . . . . . . . . . . . . . . . . . . . 471 Contents xxv
  • 26. 10.2.3 DC Servo Motor Drive Model-Based Simulation . . . . . 473 10.2.3.1 Open-Loop Simulation . . . . . . . . . . . . . . . . 475 10.2.3.2 Closed-Loop Simulation . . . . . . . . . . . . . . . 475 10.3 Principle of Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 478 10.4 Sensored Vector Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 10.4.1 Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . 480 10.4.2 SynRM/PMASynRM . . . . . . . . . . . . . . . . . . . . . . . . . 486 10.4.3 PMSM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 10.5 Flux Weakening Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 10.5.1 Flux Weakening Control of Induction Machine . . . . . . 489 10.5.1.1 Constant Torque Region . . . . . . . . . . . . . . . 492 10.5.1.2 Constant Power Region . . . . . . . . . . . . . . . . 493 10.5.1.3 Constant Slip Region . . . . . . . . . . . . . . . . . 494 10.5.2 Flux Weakening Control of SynRM and PMASynRM . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496 10.5.3 Flux Weakening Control Strategy . . . . . . . . . . . . . . . . 498 10.6 Sensorless Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 10.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499 10.6.2 Rotor Flux Linkage Estimator in IM, PMSM, SynRM, and PMASynRM . . . . . . . . . . . . . . . . . . . . . 500 10.6.2.1 Open-Loop Flux Observers . . . . . . . . . . . . . 500 10.6.2.2 Closed-Loop Flux Observer Model . . . . . . . 505 10.6.3 Rotor Flux Linkage Estimator PMSM . . . . . . . . . . . . . 509 10.6.4 Instantaneous Slip and Speed Estimator for IM . . . . . . 511 10.7 Simulations Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 10.7.1 Flux Observer and Slip Estimator Simulations in IM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514 10.7.2 Flux Observer in PMSM. . . . . . . . . . . . . . . . . . . . . . . 520 10.7.2.1 Vector Control Simulation . . . . . . . . . . . . . . 520 10.7.2.2 Rotor Flux Estimator. . . . . . . . . . . . . . . . . . 524 10.7.2.3 Permanent Magnet Synchronous Generator (PMSG) . . . . . . . . . . . . . . . . . . . 526 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530 11 Model-in-the-Loop Development in a Vector Control of Induction Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 11.2 Control Loop Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 532 11.3 Rapid Prototype Simulation Without Power Plant . . . . . . . . . . . 534 11.4 Software Architecture Design . . . . . . . . . . . . . . . . . . . . . . . . . 540 xxvi Contents
  • 27. 11.5 MCL SWC Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 11.5.1 Slow Control Loop Task. . . . . . . . . . . . . . . . . . . . . . . 545 11.5.2 Fast Control Loop Task . . . . . . . . . . . . . . . . . . . . . . . 546 11.5.3 MCL Unit Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 11.6 Model-in-the-Loop Test (MiL) . . . . . . . . . . . . . . . . . . . . . . . . . 551 11.6.1 Test Below Nominal Speed. . . . . . . . . . . . . . . . . . . . . 554 11.6.2 Test Above Nominal Speed . . . . . . . . . . . . . . . . . . . . 561 11.7 Application in Electrical Vehicle . . . . . . . . . . . . . . . . . . . . . . . 566 11.7.1 Vehicle Movement Simulation . . . . . . . . . . . . . . . . . . 569 11.7.2 Vehicle Speed Control Simulation . . . . . . . . . . . . . . . . 572 11.8 Application in Propeller Aircraft . . . . . . . . . . . . . . . . . . . . . . . 579 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 12 Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 12.1 Real-Time Implementation: PiL Testing . . . . . . . . . . . . . . . . . . 585 12.2 55 kW IPMSM Simulation Results . . . . . . . . . . . . . . . . . . . . . 590 12.2.1 Static Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592 12.2.2 Motor Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594 12.2.3 Generator Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 Contents xxvii
  • 28. Chapter 1 Embedded Control System Development Process: Model-Based Design and Architecture Basics 1.1 Introduction In different markets, such as industry, appliances, automotive, marine, and avionics, rotating electrical machines are widely used. The adjustable speed drive (ASD) with DC machines had been used widely to control the torque and speed. However, the AC machine drive system driven by a variable-voltage/variable-frequency (VVVF) is widely used due to their high-performance control thanks to the improvements in the power electronics devices, in the machine efficiency, and in the performance of the microprocessors. In the literature, it is possible to find different nomenclatures to specifyavariablespeedACdrivesuchasvariable-frequencydrive(VFD),adjustable- frequency drive (AFD) where both provide a VVVF. The common part of these drives is the control of the speed/torque variation in electromechanical systems where the speed/torque is adapted according to the necessity of the system. The most used electronic power system (sometimes designed as AC drive) able to perform a VVVF is known in the literature as an inverter. As it will be discussed in Chap. 8, the inverter topology can be single-phase, or poly-phase, and basically consists in transform a DC source into a single- or poly-phase AC source. The control system of the AC drive and therefore the control of the AC machine are increasingly complex systems and usually consist of embedded systems. The embedded system is referred to as an electronic system that is designed to perform a dedicated function by using a combination of computer hardware and software, which is often embedded within a larger system. A generic embedded system archi- tecture is composed of a microprocessor, its memory, and the inputs and outputs. The embedded software is commonly stored in the non-volatile memory devices such as flash memory, read-only memory (ROM), or erasable programmable ROM (EPROM). The microprocessor uses the random-access memory (RAM) for its run- time computation. Once the embedded system is powered, the software code stored in the non-volatile memory is read to execute the instructions to process the input information and set the outputs according to the needs of the external control system. In the control systems, the inputs usually are sensors, while the outputs are actuators. © Springer Nature Switzerland AG 2020 R. Molina Llorente, Practical Control of Electric Machines, Advances in Industrial Control, https://doi.org/10.1007/978-3-030-34758-1_1 1
  • 29. 2 1 Embedded Control System Development Process … Both are managed by dedicated peripherals such as general-purpose input/output (I/O), timers, and analog-to-digital converter (ADC or A/D). When the micropro- cessor, memory, and peripherals are integrated together on a single chip, the device consists of a microcontroller. The microprocessor with an architecture optimized for digital signal processing is the digital signal processor (DSP). The DSP is an ideal processor choice for applications with intensive math computations in constrained environments. For example, the analog input signals, such as audio or video signals, are converted to digital with ADC, and then, it is manipulated digitally with sophis- ticated algorithms and finally converted back to analog form with a digital-to-analog converter (DAC). Nowadays, some DSPs have dedicated peripherals for a control sys- tem so that they compete with microcontrollers thanks to their increasingly affordable price and the tools improvements. New platforms based in programmable system- on-chip (SoC) which combine programmable logic, DSP, and microprocessor cores on the same chip are increasingly used in electric machine control. The advantage of using programmable logic or DSP is its high-performance computation where com- plex control algorithms can be implemented inside, while the microprocessor can be dedicated to other tasks such as communication interfaces. The field-programmable gate array (FPGA) contains programmable logic blocks such as AND and XOR with faster and parallelizable processing where the performance is higher than the micro- processor and DSPs. They are generally more expensive and more difficult to use, and its uses are limited for applications where the high performance is a requirement. DSPs, microcontroller, SoC, and FPGAs are valid options to perform a machine control units (MCU), but as it will be seen in Chap. 7, the microcontroller option will be studied, in particular, the families RX63T of Renesas and AurixTM Tricore of Infineon. The embedded systems can combine any combination of a microprocessor, micro- controllers, DSPs, FPGA, and SoCs. The embedded systems have to manage millions of lines of code where their integration and debugging with other systems are increas- ingly more complex. To deal with the complexity of embedded software development in different markets, and especially in electronic control units (ECU) or more specifi- cally, in MCUs of modern automobiles, the development is increasingly based in the model-based design. Hence, in the automotive sector, the traditional way of building embedded code, where lines of code are written by hand, has become obsolete. The model-based design (MBD) focuses on the models that describe the desired control and the behavior of the system under development. The MBD has been discussed for a few decades, but it is not until these recent years where it is being involved in the flow of system design. In the MBD, the engineer focuses on the functionality, the modeling of physical phenomena, the interface of modules, the general behavior of the system, and verification through their own simulations. On the other hand, the definition of fundamental standard software architecture is mandatory if certain security, reliability, and interactive work methodology require- ments between the designers, the client, and the quality regulators should be satisfied. For example, in automotive, in many occasions, the development of a project is exe- cuted between OEMs (Original Equipment Manufacturers) and their Tier1 and Tier2 suppliers. To allow the exchange of models and software, the standardization of a
  • 30. 1.1 Introduction 3 work platform is necessary. In this sense, the AUTOMotive Open System ARchitec- ture (AUTOSAR) partnership guarantees a process for the development of standard automotive software. As will be discussed in Sect. 1.4, AUTOSAR offers a frame- work guide for electronic automotive control systems which comes with layered software architecture. Lastly, the MCU and ECUs are tested with selected methods in agreement with the standards, e.g., the International Electrotechnical Commission (IEC), to guarantee and minimum safety requirements. The objective is to ensure the safety of persons, to measure performances, and to ensure compatibility with other systems. For example, the IEC 61508 describes the basic functional safety standard applicable to all types of industry, while the International Organization for Standardization (ISO) 26262 specifies the functional safety for road vehicles which is derived from IEC 61508. In this chapter, it basically introduces the MBD technique, the simulation tools used in this book, the software architecture of the ECUs and MCUs, and the different test systems for each of the development phases. 1.2 Model-Based Design MBD is a mathematical and visual method that facilitates the complex designs of embedded systems. Instead of using extensive and complicated programming codes, designers can use MBD to define models with advanced functional features using continuous-time and discrete-time simulations. The main components of a model- based design are design and simulation at the system and component level, automatic code generation, and continuous testing and verification. 1.2.1 V-Model The MBD can be considered a software development methodology based on the V-model. The V-model was first presented in 1991 (Forsberg and Mooz 1991), and it is a variation of the waterfall model in a V shape folded in half at the lowest level of decomposition. Figure 1.1 shows the V-model adapted for the software development process. V-model is denoted as a linear refinement process that follows a top-down approach shown on the left side of the V, while validation and verification take a bottom-up approach that is shown on the right side of V. V-model demonstrates the relationships between each phase of the development life cycle and its associated testing phase. The horizontal and vertical axes represent the time or integrity of the project (from left to right) and the level of abstraction (the abstraction of coarser grain upwards), respectively. The project starts with the system requirements where the system specification is derived. This defines a detailed specification where is specified the functionality
  • 31. 4 1 Embedded Control System Development Process … System Requirements FuncƟonal SpecificaƟon Architecture Design Coding Unit TesƟng FuncƟonal TesƟng Maintenance Module Design Hardware/ SoŌware IntegraƟon SIL PIL/HIL HIL MIL System Test Design IntegraƟon Test Design Unit Test Desing System SpecificaƟon System TesƟng Acceptance Test Design Fig. 1.1 V-model. The left side is denoted as a linear life-cycle process that follows a top-down approach, while the right side of the V is the validation and verification using a bottom-up approach to meet and allows designing a software architecture. For example, it could define the speed control functionality of an electric machine. In this step is developed a basic MiL, which in the mentioned example, should consist of a speed control loop on a plant model. Taking into account the different functionalities, the architecture software platform can be designed. On this architecture, the design of the different modules or software components (SWC) is perfectly defined with their respective inputs and outputs. The code generation can be generated for each one of the SWCs designed to finally be tested by means of a unit test (UT). If the UT meets the requirements, a hardware/software integration test with the rest of the modules can be performed using a processor-in-the-loop (PiL) or hardware-in-the-loop (HiL). Otherwise, horizontally it would return to the design of the module to modify its fea- tures to rebuild the UT. If the integration test does not comply with the requirements, in particular, it is necessary to proceed with the redesign either of the architecture or of the different modules. If this is not the case, the functional tests are carried out. As in the previous cases, if the test requirements are not met, it is returned horizontally to the refinement. 1.2.2 Test Stage As mentioned, it is possible to consider different test stages as illustrated in Fig. 1.1: model-in-the-loop (MiL), software-in-the-loop (SiL), PiL, and HiL. MiL stage is
  • 32. 1.2 Model-Based Design 5 implemented during the refinement process in order to validate demodel according to the requirements specification. The rest of the test stage is usually implemented in the validation and verification of the model, as explained before. In the following section, each of them is explained separately. 1.2.2.1 Model-in-the-Loop (MiL) The MiL scenario is a technique used to abstract the behavior of a system or sub- system so that this model can be used to test, simulate, and verify that model. For example, the control system of an electric machine based on a PID regulator with a power stage, it would be possible to adjust and test its correct operation on a modeled plant formed by the power stage and the electric machine. By using a chain of industry standard tools such as Simulink® to define the model, it is possible to test and refine that model within a personal computer (PC), which allows managing a complex system efficiently. 1.2.2.2 Software-in-the-Loop (SiL) Unlike the MiL, the SiL scenario allows testing the code generated from the model also on a PC where it is possible to perform the simulation, but based on the model code. That is, on the same example of the previous control system, the PID controller based on a model, its code is generated and therefore tested in the same environment. This phase requires only the simulation model and is independent of the hardware, focusing on software interfaces and numerical results. The requirements and specifi- cations of the software can be analyzed and verified here. The first phase of refinement of the requirements is carried out during the SiL simulations. 1.2.2.3 Processor-in-the-Loop (PiL) The PiL scenario allows developing real-time control over a microprocessor target connected to a digital platform that emulates, in this case, the most complicated parts to obtain at the beginning of the project, such as the power stage and the electric machine. Unlike MiL and SiL, in this case, the real microprocessor of the ECU is tested, where the software not only consists of the application layer control algorithm but a part of the software architecture. Unlike the simulation in the SiL scenario, where the runtime metrics were not obvious, due to the higher calculation capacity of a PC, the PiL has the ability to detect insufficient hardware capabilities. For example, PiL provides real-time metrics, detects bottlenecks, adds used memory, supervises hardware and software interruptions, analysis of waveforms, thermal effects, and electromagnetic interferences, among others. On the other hand, the digital platform that emulates the power stage and the machine can be a PC, a field-programmable gate array (FPGA), or even a DSP. The
  • 33. 6 1 Embedded Control System Development Process … increase in the speed of processing of the DSPs and of their reduction in cost make that the option of using a DSP to emulate an electrical machine is one of the best alternatives. 1.2.2.4 Hardware-in-the-Loop (HiL) The hardware-in-the-loop (HIL) scenario tends to become the standard electronic development tool for testing ECUs, MCUs, and, more particularly, its software for different OEMs. Especially during development, the individual software change tests (MBD changes) of the ECU can be tested using the HiL in real time. Increasing the complexity of control algorithms requires the use of this scenario, which advances the problems that can be encountered before testing in real conditions. In the case of an MCU, consisting of a power stage based on a three-phase inverter, and its control logic for an electrical machine, the HiL scenario can be used as a tool to develop and validate control strategies in all operating conditions, including extreme conditions, such as non-destructive failures in the machine itself. In this scenario, the machine is emulated, with a certain degree of fidelity, in a processor that acts on an electronic load that emulates its physical behavior. Additionally, it is possible to include a power supply emulator for the inverter where different power conditions can be tested. Then, the MCU is exposed to the different possible power conditions, and to the different behaviors of the electric machine. If the power supply of the MCU or inverter is by means of a battery as in electric vehicle (EV), the HiL scenario can emulate its operation in different states of charge (SOC), where the voltage is reduced as the battery energy is consumed. Otherwise, if the power is through the single-phase or three-phase electricity network grid, the voltage and frequency can be varied according to the voltages and frequencies and their corresponding limits set by each country. The most critical test cases can be evaluated, such as degradation and derating conditions. These are usually those where the power supply is low, and the demand for machine load is high, or when the temperature is above normal limits. In addition, if during the development phase changes the characteristics of the electric machine or even the type of machine, simply changing the model that controls the electronic load will suffice. On the other hand, the different dynamic behaviors of the electric machine to be controlled, such as load variation, and inertia, can be tested by the electronic load. For example, in the case of the EV, one can simulate, among other things, the driving speed, the vehicle mass, the dynamics, the aerodynamics and the drag resistance, and the regenerative brake. In this case, during the iterative design phases, it is possible to find optimal parameters for the inverter + electrical machine set. In this scenario, the MCU under test would be wholly tested and validated with the test cases created, providing the corresponding reports as output. If the results of the reports are satisfactory, it is possible to proceed to perform the test with the real machine on a test bench with a dynamometer. Dynamometers are widely used to test the torque and power of combustion engines and electric machines. It involves moving mechanical parts so that it can be dangerous if it is not carried out with
  • 34. 1.2 Model-Based Design 7 all the necessary safety elements. The test bench consists of the real machine con- nected to a machine that acts as a brake (dynamometer) to simulate different pairs of dynamic loads. The torque and speed meter is monitored by means of instrumentation equipment connected to a PC. It is essential to mention that the HiL scenario described above usually has a high cost, so it will not always be possible to have one during the development phase. That is why other more modest verification systems are often used as well as digitized plants. In this case, the hardware formed by the machine and the inverter + controller can be replaced by a precise model in real time for emulation, for faster development and if it is not expected to have a complete HiL scenario. It is true that control systems increasingly use their verification and development through a plant digitized on a field-programmable gate array (FPGA) platform so that control algorithms can be evaluated without the need for real hardware, in this case, an inverter and an electrical machine (Tavana and Dinavahi 2015). However, the real-time simulation of electric machine models and the inverter can be especially complicated due to the rapid nature of the dynamics, that is, reduced time constants especially in very low-power machines. The switching of PWM signals up to tens of kHz requires sampling rates of the order of several MHz to obtain a reasonable accuracy and model, for example, the ripple produced by the PWM in the inductance of the machine. That is why FPGAs are the ideal platform for complex simulations in real time due to their capacity to process data in parallel allowing sampling and execution rates up to the MHz range. The FPGA is a reconfigurable digital logic platform, which allows execution of millions of operations in parallel. As cited in (Le-Huy et al. 2006), research has advanced considerably in modeling and real-time simulation of different power systems that use the FPGA as computational devices. The control algorithm designed in this case for the control of an electric machine is loaded into a card where it will be tested with the FPGA modeling the inverter and the machine. Different test cases can be verified quickly by advancing many of the possible problems, for example, on the stability of the control. Finally, there will be occasions when, due to cost, although not as high as that of the HiL scenario, these plant modeling systems will not be available. In this case, the tests are carried out directly on the actual plant or on a test bench, typically being the longest and most complicated development, since numerous software and hardware errors will be found in the real system or in the test bench according to the case. 1.2.3 MBD Process The MBD begins with the MiL scenario (Lamberg et al. 2004), which consists of developing models submitted to simulated test environments at the beginning of the design. The models are then refined and transformed into software. This software can be tested in the SiL scenario, or in the microprocessor, PiL scenario. Finally, the HiL scenario (Hanselmann 1993) contains the real hardware and software (MCU), integrated into a simulated environment. The plant (electric machine) controlled by
  • 35. 8 1 Embedded Control System Development Process … MCU is developed during the functional specification phase, which can be used by the HiL scenario, defining the simulated environment. The model-based design allows systems to be developed with a model-centered approach, since the basic idea is to develop the model without the need for a physical prototype, in a simulation-based verification environment. The model includes all the relevant components for the behavior of the system: algorithms, control logic, physical components, and the environment. Once the model has been developed and verified that it works according to the requirements, code of the control logic can be generated in the chosen programming language, for its later implementation in a microcontroller, FPGA, or DSP. The programming language will vary depending on the chosen hardware, being typically C/C++ language for the microcontroller and DSP, while VHSIC (very high speed integrated circuit) hardware description language (VHDL) is reserved for the FPGA. The model development environment also allows generating reports and other types of documentation that are very beneficial for the developers and the customer. MBD has the ability to develop a functional version of the system from the beginning, with the plant, sensors, actuators, etc. For example, in electric machine control, it is possible to develop the speed control system in an environment where the plant will be an AC machine model, together with a power stage and the necessary sensing stages. That is to say, when the hardware is not available, some of the problems that could only be encountered with the physical prototype can be progressed in a very effective way. The results of the simulation can be shared with the customer instead of the results of the hardware tests and can be used to measure progress, verify that the system meets the requirements, and perform automatic test reports with coverage results of the control system. In addition, as the model is developed, it can be used to perform a MiL, generate code for SiL/PiL-type tests, and finally for HiL tests. Code generation is automatic in a way that reduces any manual implementation and therefore reduces development times. Figure 1.2 shows the structure of the MBD where two parts are differentiated. On the one hand, the design, simulation, and verification based on a personal computer (PC) (MiL and SiL), and on the other hand the verification on real hardware (PiL and HiL). The hardware can be modeled with a reasonable degree of precision in order to verify the design results of the models with an adequate degree. Different input test cases can be implemented in order to test accurately the models where the results should be compared with the expected outputs. The change of requirements or conditions that affect one or several models can be modified and verified independently without waiting for the other models to be finalized. Through the simulations, it is verified that the changes do not cause an involuntary behavior of the system by providing regression tests. In the previous example, a control engineering team is developing software for a control system of an AC electric machine without a speed sensor. The system bases the machine speed estimation by means of an adaptive model by measuring the current and voltage that circulates through the machine terminals. In the first phase, each sub-team (or group of engineers) models their respective sub-systems, using a model in simulation software shared at the system level to coordinate their work.
  • 36. 1.2 Model-Based Design 9 Controller Model Inverter/ Motor Models VerificaƟon Input Test Cases Embedded System (Controller) Inverter & Motor PC MCU Code GeneraƟon Expected Outpus Fig. 1.2 MBD setup application in an MCU Because the system will only control the machine, the application layer of the SW architecture will be composed of the control model. In this first phase, simulations can be run to see how the control behaves under various conditions. Each of the sub- systems can be separately debugged (MiL), where the parameters to be optimized are identified, and the performance metrics are displayed without generating a single line of code. The first test version will be the one where all the MiL sub-systems are integrated to perform the main task of the system where it is possible to extract performance metrics. At this point, the teams can adjust or improve the models according to the needs of the customers as, for example, the need to extend the maximum speed of the machine at speed higher than the initial one of the project. The code generated by the models is a part of the system code so that there will be an integration process with the rest of the code. The rest of the code basically consists of sub-systems such as drivers for the ADC converter, driver for the I/O control, and Timers configuration. In the next phase, the models can be verified by SiL tests that are more rigorous than the MiL to have a more advanced level of verification. Here, the compiled model for its simulation is no longer verified, but it is verified as the generated code performs the same functions as the compiled model. The last step consists of the most rigorous checks in real time such as the PiL and HiL test to ensure that the design meets the customer’s requirements. At this point, there has been time for the hardware team to design and develop the real hardware. It is here, where the control of the machine can be evaluated on a real plant, that is, with an inverter and an electric machine, or in its absence, on an advanced simulation system of the plant. In addition, they also verify that the established standards and guidelines of the models and code comply, use static analysis and formal methods to prove the absence of critical errors at runtime, and produce reports and other artifacts in preparation for standards certification. As the project progresses, the needs of
  • 37. 10 1 Embedded Control System Development Process … customers may change. For example, the customer can request a machine position sensing to make the system more robust in the face of any adversity in the control. Due to the fact that a system model is being used in this project, the team will only have to create a new model for the processing of the rotor position of the machine and compare it with the estimated position to activate the corresponding alarms in case of particular deviation. The remaining models remain unchanged so that the team must re-run simulations for MiL and SiL verification and share them with the client before executing the PiL and the HiL. If it works as expected, it is possible to proceed to perform HiL tests for the final verification of the new functionality. 1.3 Computer Simulations In Engineering, there are three methods to resolve a problem: analytical method, numerical method, and experimental method. The analytical method is the classical approach, with 100% accurate results. However, it is applicable only for simple prob- lems. The numerical method consists of a mathematical representation where some approximation and assumptions are made, and the results cannot be believed in 100%. The last method is the experimental method which consists of actual measurement and only applicable if the physical prototype is available. Computer simulations, in general terms, use numerical methods to mimic the operations of real-world processes according to appropriately developed assumptions taking the form of logical, statistical or mathematical relationships that have been developed and formed in a model (McHaney 2009). These techniques for imitating real-world process operations are generally called systems, and assumptions about their functioning are generally made. These assumptions, which usually take the form of logical or mathematical relationships, constitute the model used to try to understand how the system acts (Law 2006). A system is defined as a collection of entities (such as people or machines), which act and interact together to achieve a logical end. In practice, the definition of “the system” depends on the objectives of a particular study. The collection of entities that comprise a system for a study may be only a subset of the totality of another system. The state of a system is defined as a collection of variables necessary to describe a system at a particular time, relative to the objectives of a study. The systems are categorized into two types, discrete and continuous. A discrete system is one for which state variables change instantaneously at separate points of time. A continuous system is one for which state variables change continuously over time. In practice, few systems are entirely discrete or entirely continuous. But since a type of change predominates in most systems, it is generally possible to classify a system as discrete or continuous. The models can be simulated in a computer either in continuous or discrete time, depending on the system, in increasingly sophisticated simulation environments that facilitate their development and understanding of their behavior. In general, most simulation packages use numerical methods to perform the out- put results following a discrete approach. The discretization of a continuous system
  • 38. 1.3 Computer Simulations 11 with infinite degrees of freedom (DOF) to a finite degree of freedom is known as meshing (nodes and elements). Figure 1.3 illustrates the meshing concept for an AC machine where phase winding is not meshing. As it can be observed, there are a numerous number of nodes and elements, in concrete, 39,669 and 88,582, respectively. The finite element (FE) is a numerical technique used to determine the approximated solution for a partial differential equation on a defined domain (Altair University 2019). FE is more focused to solve problems of engineering and mathe- matical physics as electromechanical phenomena, coupled effects, electromagnetic effects, mechanical structures, etc. The FE has an excellent performance to solve partial differential equations over complex domains that can vary with time. It only makes calculations at a limited (finite) number of points and then interpolates the results for the entire domain (surface or volume). It is possible to define “Finite” as the reduction of the degrees of freedom from infinite to finite with the help of discretization or meshing (nodes and elements), and the “Element” as the entity joining nodes and forming a specific shape such as quadrilateral or triangular as shown in Fig. 1.3b. Hence, all of the calculations are made at a limited number of points known as nodes. To get the value of a variable anywhere in between the calculation points, an interpolation function is used as commented before. On the other hand, simulation packages, which are not based in FE, use solvers. A solver applies a numerical method to solve the set of ordinary differential equations that represent the model [MathWorks]. The continuous solvers use the numerical integration to calculate continuous states of a model at the current time step based on the states at previous time steps and the state derivatives. Continuous solvers depend on individual blocks to calculate the values of the discrete states of the model at each time step. Discrete solvers are mainly for solving purely discrete models. Simulink provides two main types of solvers, fixed-step where it fixes step sizes from the beginning to the end of the simulation, and variable-step solvers, where solvers vary the step size during the simulation. In general, a smaller step size increases the accuracy of the results but increases the time required to simulate the system. The advantage of the variable-step is that it is possible to reduce the simulation time required since the size step is automatically chosen according to the actual results. In power electronics, thanks to the simulation packages, the complicated alge- bra in power circuits is sometimes avoided, such as root mean square (RMS) of the currents, transients, and power losses for example. The precision of the power circuit can be fine-tuned with the knowledge of the layout where stray components such as inductance, resistance, and capacitance can be included in the simulation. It improves the results in such a way it is possible to perform accurate harmonic content simulations which can prevent future hardware modifications. In the market, there are a large number of simulation packages for device-level power electronics which offers accurate and precision results of the behavior of the power stage. These packages can generate the dynamic equations of the system, which can be simplified for a computationally efficient. The device-level model such as power semiconductors device, resistors, capacitors, inductors, voltage, and current sources are used to perform the power circuit where often are solved by using
  • 39. 12 1 Embedded Control System Development Process … Fig. 1.3 Discretization of a continuous model by using nodes and elements. a Three dimensions, b two dimensions
  • 40. 1.3 Computer Simulations 13 non-linear differential-algebraic equations. The high accuracy is, in general, due to the high precision device model and the different numerical integration algorithms such as Newton-Raphson (solver) with a very low step size. The great detail of the waveforms results allows to analyze precisely, for example, the transients. However, the simulation execution speed is relatively slow, which can derive to bottleneck during the project development. For this reason, different simulations areas such as system level as MATLAB/Simulink® and device level such as PSIM® can be used during the development to exploit the modeling strengths for every area. Moreover, analog, digital, and mixed-signal simulations are often used in the same environment. On the other hand, the co-simulation is becoming more prevalent in the power electronic circuits simulations. The co-simulation allows interconnection between several simulation tools such as system level and device level, where the advantages of both systems are emphasized. In this section, the simulation MATLAB/Simulink® , PSIM® , and Altair FluxTM finite element analysis (FEA) are introduced. 1.3.1 MATLAB/Simulink Simulink® developed by MathWorks is a block diagram environment for multi- domain simulation and model-based design. It is compatible with system-level design, simulation, automatic code generation, and continuous testing and verifica- tion of integrated systems. Simulink® provides a graphics editor, customizable block libraries, and solvers for modeling and simulating dynamic systems. It is integrated with MATLAB® , allowing the incorporation of MATLAB® algorithms in models and the export of simulation results to MATLAB® for further analysis. These factors make Simulink® a powerful engineering tool. Simulink® control toolbox allows to design and simulate the behavior of the plant control in the same environment with algebraic differential equations. The control theory is shown graphically as plots such as Bode diagram and root locus, where stability analysis can be performed in a friendly way. Figure 1.4 shows the Simulink® environment. On the other hand, Simscape Electrical Specialized Power Systems library of Simulink® contains blocks that use their own, specialized electrical domain. It pro- vides a unique environment for modeling and simulating physical systems that span mechanical, electrical, and other physical domains. It provides fundamental building blocks of these domains that can be assembled into models of physical components, such as electrical machines, hydraulic valves, and other mechanisms. Simscape mod- els can be used to develop system-level control and performance systems. It is pos- sible to expand the libraries using the Simscape language based on MATLAB® , which enables the text-based creation of components, domains, and physical model- ing libraries. Using the Simscape language, users can control accurately what effects are captured in their models. Figure 1.5 represents an example of a DC machine con- trol with a power stage based in two isolated gate bipolar transistor (IGBT) power semiconductor devices made with Simscape Electrical Specialized Power Systems library.
  • 41. 14 1 Embedded Control System Development Process … Fig. 1.4 Simulink environment software package Fig. 1.5 DC machine control system made with Simscape electrical specialized power sys- tems library With Simscape, users build a system model in the same way that they would assemble a system. Simscape employs a physical network approach, also known as acausal modeling, building models: Components (blocks) corresponding to physical elements, such as pumps, machines, and operational amplifiers are joined by lines corresponding to physical connections that transmit power. This approach allows users to describe the physical structure of a system instead of the underlying math- ematics. From the model, which looks a lot like a scheme, Simscape automatically
  • 42. Other documents randomly have different content
  • 43. took her arm. The general, with his usual levity, told St. Louis, that he came in time to prevent him from running away with his wife. Then twining round her arm a wreath of jessamin he had taken from my hand, said, with such fetters only you should be bound! Does she find those that bind her too heavy? asked her husband. No, replied the general, she seems content. Then casting a look of disappointment at Clara, he mounted his horse and rode off. Major B—— engaged St. Louis in a conversation on the situation of the colony, which made him forget the dangerous one in which he had found his wife. Clara, leaning on my arm, seemed oppressed by a variety of sensations, among which indignation predominated. The security and presumption of the general shocked her, and the recollection of having, at least negatively encouraged him, gave an additional pang to her heart. We returned slowly home. Our meeting with general Rochambeau was thought accidental by St. Louis, and was taken no notice of.
  • 44. LETTER XIV. Cape Francois. Ah, my dear friend, where shall I find expressions to convey to you an idea of the horror that fills my soul; how describe scenes at which I tremble even now with terror? Three negroes were caught setting fire to a plantation near the town. They were sentenced to be burnt alive; and the sentence was actually executed. When they were tied to the stake and the fire kindled, one of them, I understand, held his head over the smoke and was suffocated immediately. The second made horrible contortions, and howled dreadfully. The third, looking at him contemptuously said, Peace! do you not know how to die? and preserved an unalterable firmness till the devouring flames consumed him. This cruel act has been blamed by every body, as giving a bad example to the negroes, who will not fail to retaliate on the first prisoners they take. But it has been succeeded by a deed which has absolutely chilled the hearts of the people. Every one trembles for his own safety, and silent horror reigns throughout the place. A young Creole, who united to the greatest elegance of person the most polished manners and the most undaunted courage, had incurred, I know not how, the displeasure of general Rochambeau, and had received a hint of approaching danger, but neither knew what he had to fear, nor how to avoid it, when he received an order to pay into the treasury, before three o'clock, twenty thousand dollars on pain of death. This was at ten in the morning. He thought at first it was a jest; but when assured that the order was serious, said he would rather die than submit to such injustice, and was
  • 45. conducted by a guard to prison. Some of his friends went to the government-house to intercede for him. Nobody was admitted. His brother exerted himself to raise the sum required; but though their house has a great deal of property, and government is indebted to them more than a hundred thousand dollars, it was difficult, from the scarcity of cash, to raise so large a sum in so short a time, and nobody thought there was any danger to be apprehended. At half after two o'clock he was taken to the fosset, where his grave was already dug. The captain of the guard sent to know if there was no reprieve: and was told that there was none. He sent again, the same answer was returned, with an order to perform his duty, or his life would be the forfeit of his disobedience. He was a Creole, the friend, the companion of the unfortunate Feydon. Ah! how could he submit to be the vile instrument of tyranny? how could he sacrifice his friend? Why did he not resign his commission on the spot, and abide by the consequence? Approaching Feydon, he offered to bind his eyes; but he refused, saying, No, let me witness your horrors to the last moment. He was placed on the brink of his grave. They fired: he fell! but from the bottom of his grave cried, I am not dead—finish me! My heart bleeds: I knew him; and while I live, the impression this dreadful event has made on me will never be effaced. At the moment he was killed his brother, having collected the required sum, carried it to the general, who took the money, and sent the young man, who was frantic when he heard of his brother's fate, to prison. It is said a reprieve had been granted, but had been suppressed by Nero the commandant de la place, who is as cruel, and as much detested as was the tyrant whose name he bears. A few days after, nine of the principal merchants were selected. One hundred thousand dollars was the sum demanded from them; and they were imprisoned till it should be found. It was then the virtuous Leaumont approached, fearless of consequences, the retreat of the tyrant, and obliged him to listen to the voice of truth. He represented the impossibility of finding the sum demanded from these unfortunate men, and entreated to have a tax laid on every individual of the place in proportion to his property, which, after
  • 46. much debate was consented to. The money was soon furnished, and the prisoners released. Since the death of Feydon the general appears no more in public. A settled gloom pervades the place, and every one trembles lest he should be the next victim of a monster from whose power there is no retreat. St. Louis, above all, is in the greatest danger, for he has the reputation of being rich, and, having excited the aversion of general Rochambeau, it is not probable that he will escape without some proof of his animosity. Clara is in the greatest dejection. She repents bitterly the levity of her conduct, and is torn with anxiety for the fate of her husband. She loves him not, it is true, but would be in despair if through her fault the least evil befel him, and feels for the first time the danger of awakening the passions of those who are capable of sacrificing all considerations to gratify their wishes or revenge their disappointment. She requested the general to give her a passport for St. Jago de Cuba. He replied that he could only grant them to the old and ugly, and she, not being of this description, he was obliged to refuse her; however, after much solicitation, she obtained one for herself for me and her servants, and we shall sail in a few days. All the women are suffered to depart, but no man can procure a passport. Some it is true, find means to escape in disguise, and they are fortunate, for it is much feared that those who remain will be sacrificed. Every vessel that sails from hence is seized and plundered by the English; but, as we are Americans, perhaps we may pass. Our intention is to stay at St. Jago till St. Louis joins us. God knows whether we shall ever see him again. With what joy I shall leave this land of oppression! how much that joy would be increased if I was going to the continent; but in all places, and in all countries I shall be affectionately yours,
  • 47. LETTER XV. Barracoa. You will no doubt be surprised at receiving a letter from hence, but here we are my dear friend, deprived of every thing we possessed, in a strange country, of whose language we are ignorant, and where, even with money, it would be impossible to procure what we have been accustomed to consider as the necessaries of life. Yet here we have found an asylum, and met with sympathy; not that of words, but active and effectual sympathy, from strangers, which, perhaps, we should have sought in vain in our own country, and among our own people. We embarked at the Cape, Clara, myself and six servants, in a small schooner, which was full of women, and bound to St. Jago. As soon as we were out of the harbour a boat from a British frigate boarded us, condemned the vessel as French property, and, without further ceremony, sent the passengers on board another vessel which was lying near us, and was going to Barracoa, where we arrived in three days, after having suffered much from want of provisions and water. Every thing belonging to us had been left in the schooner the English made a prize of. St. Louis, having forseen the probability of this event, had made Clara conceal fifty doubloons in her corset. On our arrival at Barracoa, a Frenchman we had known at the Cape came on board. He conducted us ashore, and procured us a room in a miserable hut, where we passed the night on a board laid on the ground, it being impossible to procure a mattrass. The next morning the first consideration was clothes. There was not a pair of shoes to be found in the place, nor any thing which we would have thought of employing for our use if we had not been obliged by the pressure
  • 48. of necessity. Clara had given a corner of our hut to a lady who, with two children, was without a shilling. While we were at breakfast, which we made of chocolate, served in little calabashes, lent us by the people of the house, a priest of most benign aspect entered, and addressing Clara in French, which he speaks fluently, told her that having heard of our arrival and misfortunes, he had come to offer his services, and enquired how we had passed the night? Clara shewed him the boards on which we had slept. He rose instantly, and calling the mistress of the house, spoke to her angrily. I afterwards learned that he reproached her for not having informed him of our distress as soon as we arrived. He took his leave and returned in half an hour with three or four negroes who brought mattrasses, and baskets filled with fowls, and every kind of fruit the island produces. Then, telling Clara that his sister would call on her in the evening, and begging her to consider him as her servant, and every thing he possessed at her disposal, he went away. In the afternoon he returned with his sister. She is a widow. Her manners are interesting, but she speaks no language except her own, of which not one of us understood a word. Father Philip sent for the only shopkeeper in the place, who furnished us with black silk for dresses, and some miserable linen. By the next day we were decently equipped. We were then presented to the governor, whose wife is divinely beautiful. Nothing can equal the lustre of her eyes, or surpass the fascinating power of her graceful and enchanting manners. The changes of her charming countenance express every emotion of her soul, and she seems not to require the aid of words to be understood. She conceived at once a fervent friendship for Clara, and having learned our misfortunes from father Philip, insisted on our living in her house whilst we remained at Barracoa. This point was disputed by Donna Angelica, who said she had provided a chamber for us in her own. But madame la Governadora was not to be thwarted; she seized Clara by the arm, and drawing her playfully into another room, insisted on dressing her a la Espagnole, which is nothing more than a cambric
  • 49. chemise, cut very low in the bosom, an under petticoat of linen, made very stiff with starch, and a muslin one over it, both very short. To this is added, when they go out, a large black silk veil, which covers the head and falls below the waist. By this dress the beauty of the bosom, which is so carefully preserved by the French is lost. Clara looked very well in this costume, but felt uncomfortable. As Donna Jacinta would not hear of our leaving her we consented to stay; and a chamber was prepared for us. In the evening we walked through the town, and were surprised to see such extreme want in this abode of hospitality. The houses are built of twigs, interwoven like basket work, and slightly thatched with the leaves of the palm tree, with no other floor than the earth. The inhabitants sit on the ground, and eat altogether out of the pot in which their food is prepared. Their bed is formed of a dried hide, and they have no clothes but what they wear, nor ever think of procuring any till these are in rags. There are only three decent houses in the place, which belong to the governor, to father Philip, and his sister; yet these good people are happy, for they are contented. Their poverty is not rendered hideous by the contrast of insolent pride or unfeeling luxury. They dose away their lives in a peaceful obscurity, which if I do not envy, I cannot despise. There are many French families here from St. Domingo; some almost without resource; and this place offers none for talents of any kind. It is not uncommon to hear the sound of a harp or piano from beneath a straw built shed, or to be arrested by a celestial voice issuing from a hut which would be supposed uninhabitable. Clara studies with so much application the Spanish language that she can already hold with tolerable ease a conversation, especially with the seignora Jacinta, whose eyes are so eloquent that it would be impossible not to understand her. She is a native of the Havanna, was married very young, and her husband having been appointed governor of Barracoa, was obliged to leave the gaiety and splendour
  • 50. of her native place for this deserted spot, where fashion, taste or elegance had never been known. It has been a little enlivened since the misfortunes of the French have forced them to seek in it a retreat. Jacinta has too much sensibility not to regret the change of situation; but she never repines, and seeks to diffuse around her the cheerfulness by which she is animated. From early prejudice she loves not the French character. Fortunately Clara is an American; and the influence of her enchanting qualities on the heart of her fair friend is strengthened by the charm of novelty. We are waiting for a vessel to carry us to St. Jago, and its arrival, I assure you will fill us with regret.
  • 51. LETTER XVI. St. Jago de Cuba. We have left Barracoa, the good father Philip, his generous sister, and the beautiful Jacinta. Removed from them for ever, the recollection of their goodness will accompany me through life, and a sigh for the peaceful solitude of their retreat will often heave my breast amid the mingled scenes of pleasure and vexation in which I shall be again engaged. Fortunate people! who, instead of rambling about the world, end their lives beneath the roofs where they first drew breath. Fortunate in knowing nothing beyond their horizon; for whom even the next town is a strange country, and who find their happiness in contributing to that of those who surround them! The wife of the governor could not separate herself from us. Taking from her neck a rosary of pearls, she put it round that of Clara, pressed her in her arms, wept on her bosom, and said she never passed a moment so painful. She is young, her soul is all tenderness and ardour, and Clara has filled her breast with feelings to which till now she has been a stranger. Her husband is a good man, but without energy or vivacity, the direct reverse of his charming wife. She can never have awakened an attachment more lively than the calmest friendship. She has no children, nor any being around her, whose soul is in unison with her own. With what devotion she would love! but if a stranger to the exquisite pleasures of that sentiment she is also ignorant of its pains! may no destructive passion ever trouble her repose. She walked with us to the shore and waited on the beach till we embarked. She shrieked with agony when she clasped Clara for the
  • 52. last time to her breast, and leaning against a tree, gave unrestrained course to her tears. The good father Philip accompanied us to the vessel, and staid till the moment of our departure. He had previously sent aboard every thing that he thought would be agreeable to us during the voyage. His friendly soul poured itself forth in wishes for our happiness. May all the blessings of heaven be showered on his head! It is Clara's fate to inspire great passions. Nobody loves her moderately. As soon as she is known she seizes on the soul, and centres every desire in that of pleasing her. The friendship she felt for Jacinta, and the impression father Philip's goodness made on her, rendered her insensible to all around her. The vessel was full of passengers, most of them ladies, who were astonished at beholding such grief. One of them, a native of Jeremie, was the first who attracted the attention of Clara. This lady, who is very handsome, and very young, has three children of the greatest beauty, for whom she has the most impassioned fondness, and seems to view in them her own protracted existence. She has all the bloom of youth, and when surrounded by her children, no picture of Venus with the loves and graces was ever half so interesting. She is going to join her husband at St. Jago, who I hear, is a great libertine, and not sensible of her worth. An air of sadness dwells on her lovely countenance, occasioned, no doubt, by his neglect and the pain of finding a rival in every woman he meets. There is also on board a beautiful widow whose husband was killed by the negroes, and who, without fortune or protection, is going to seek at St. Jago a subsistence, by employing her talents. There is something inconceivably interesting in these ladies. Young, beautiful, and destitute of all resource, supporting with cheerfulness their wayward fortune. But the most captivating trait in their character is their fondness for their children! The Creole ladies, marrying very young, appear more
  • 53. like the sisters than the mothers of their daughters. Unfortunately they grow up too soon, and not unfrequently become the rivals of their mothers. We are still on board, at the entrance of the harbour of St. Jago, which is guarded by a fort, the most picturesque object I ever saw. It is built on a rock that hangs over the sea, and the palm trees which wave their lofty heads over its ramparts, add to its beauty. We are obliged to wait here till to-morrow; for this day being the festival of a saint, all the offices are shut. No business is transacted, and no vessel can approach the town without permission. This delay is painful; I am on the wing to leave the vessel, though it is only four days since we left Barracoa.—I wish to know whether we shall meet as much hospitality here as in that solitary place. Yet why should I expect it? Hearts like those of father Philip and the lovely Jacinta do not abound.—How many are there who, never having witnessed such goodness, doubt its existence? We have letters to several families here, from the governor of Barracoa and father Philip, and St. Louis has friends who have been long established at this place. Therefore, on arriving, we shall feel at home; perhaps too, we may find letters from the Cape;—God grant they may contain satisfactory intelligence.
  • 54. LETTER XVII. St. Jago de Cuba. A month has passed, since our arrival in this place, in such a round of visits and such a variety of amusements, that I am afraid, my dear friend, you will think I have forgotten you. We were received by the gentleman, to whom Clara was directed, with the most cordial friendship. He is an ancient Chevalier de St. Louis, and retains, with much of the formality of the court of France, at which he was raised, all its elegance and urbanity; and having lived a number of years in this island, he is loved and respected by all its inhabitants. The letters which father Philip and the governor of Barracoa gave us to their friends, have procured us great attention. The people here are much the same as at Barracoa; perhaps they are a little more civilized. There is some wealth, with much poverty. The women have made great progress towards improvement since such numbers of French have arrived from St. Domingo.—They are at least a century before the men in refinement, but women are every where more susceptible of polish than the lords of the creation. Those of this town are not generally remarkable for their beauty. There are some, however, who would be admired even in Philadelphia, particularly the wife of the governor; but they are all remarkable for the smallness of their feet, and they dress their hair with a degree of taste in which they could not be excelled by the ladies of Paris. We arrived in the season of gaiety, and have been at several balls; but their balls please me not!—Every body in the room dances a minuet, which you may suppose is tedious enough; then follow the
  • 55. country dances, which resemble the English, except that they are more complicated and more fatiguing. There are in this town eleven churches, all of them splendid, and the number of priests is incredible! Many of them may be ranked among the most worthless members of the community. It is not at all uncommon to see them drunk in the street, or to hear of their having committed the most shocking excesses. Some, however, are excellent men, who do honour to their order and to human nature. But the thickest veil of superstition covers the land, and it is rendered more impervious by the clouds of ignorance in which the people are enveloped! Clara, who speaks the language with the facility of a native, asked some of her Spanish friends for books, but there was not one to be found in the place. She complained some days ago of a head-ache, and a Spanish lady gave her a ribbon, which had been bound round the head of an image of the Virgin, telling her it was a sovereign remedy for all pains of the head. The bishop is a very young man and very handsome. We see him often at church, where we go, attracted by the music. But one abominable custom observed there, destroys our pleasure. The women kneel on carpets, spread on the ground, and when they are fatigued, cross their legs, and sit Turkish fashion; whilst the men loll at their ease on sofas. From whence this subversion of the general order? Why are the women placed in the churches at the feet of their slaves? The lower classes of the people are the greatest thieves in the world, and they steal with so much dexterity, that it is quite a science. The windows are not glazed, but secured by wooden bars, placed very close together. The Spaniards introduce between these bars long poles, which have at one end a hook of iron, and thus steal every thing in the room, even the sheets off the beds. The friars excel in this practice, and conceal their booty in their large sleeves!
  • 56. In the best houses and most wealthy families there is a contrast of splendour and poverty which is shocking. Their beds and furniture are covered with a profusion of gilding and clumsy ornaments, while the slaves, who serve in the family, and even those who are about the persons of the ladies, are in rags and filthy to the most disgusting degree! How different were the customs of St. Domingo! The slaves, who served in the houses, were dressed with the most scrupulous neatness, and nothing ever met the eye that could occasion an unpleasant idea. The Spanish women are sprightly, and devoted to intrigue. Their assignations are usually made at church. The processions at night, and the masses celebrated before daylight, are very favourable to the completion of their wishes, to which also their dress is well adapted. They wear a black silk petticoat; their head is covered with a veil of the same colour, that falls below the waist; and, this costume being universal, and never changed, it is difficult to distinguish one woman from another. A man may pass his own wife in the street without knowing her. Their attachments are merely sensual. They are equally strangers to the delicacy of affection or that refinement of passion which can make any sacrifice the happiness of its object may require. To the licentiousness of the people, more than to their extreme poverty, may be attributed the number of children which are continually exposed to perish in the street. Almost every morning, at the door of one of the churches, and often at more than one, a new- born infant is found. There is an hospital, where they are received, but those who find them, are (if so disposed,) at liberty to keep them. The unfortunate little beings who happen to fall into the hands of the lower classes of the people, increase, during their childhood, the throng of beggars, and augment, as they grow up, the number of thieves.
  • 57. The heart recoils at the barbarity of a mother who can thus abandon her child; but the custom, here, as in China, is sanctioned by habit, and excites no horror!
  • 58. LETTER XVIII. St. Jago de Cuba. We have received no news from the Cape, my dear friend, but it is generally expected that it will be evacuated, as several parts of the island have been already. This place is full of the inhabitants of that unfortunate country, and the story of every family would offer an interesting and pathetic subject to the pen of the novelist. All have been enveloped in the same terrible fate, but with different circumstances; all have suffered, but the sufferings of each individual derive their hue from the disposition of his mind. One catastrophe, which I witnessed, is dreadfully impressive! I saw youth, beauty and affection sink to an untimely grave, without having the power of softening the bitterness of their fate. Madame C——, a native of Jeremie, had been sent by her husband to Philadelphia, at the beginning of the revolution, where she continued several years, devoting all her time to improving the mind and cultivating the talents of her only child, the beautiful Clarissa. Sometime after the arrival of the French fleet, Madame C——, and her daughter returned to Jeremie. She had still all the charms of beauty, all the bloom of youth. She was received by her husband with a want of tenderness which chilled her heart, and she soon learned that he was attached to a woman of colour on whom he lavished all his property. This, you may suppose, was a source of mortification to Madame C——, but she suffered in silence, and sought consolation in the bosom of her daughter.
  • 59. When the troubles of Jeremie encreased, and it was expected every day that it would be evacuated, Monsieur C—— resolved to remove to St. Jago de Cuba. He sent his wife and child in one vessel, and embarked with his mistress in another. Arriving nearly at the same time, he took a house in the country, to which he retired with his superannuated favourite, leaving his family in town, and in such distress that they were often in want of bread. Madame C——, too delicate to expose the conduct of her husband, or to complain, concealed from her friends her wants and her grief. A young Frenchman was deeply in love with her daughter, but his fortune had been lost in the general wreck, and he had nothing to offer to the object of his adoration except a heart glowing with tenderness. He made Madame C—— the confidant of his affection. She was sensible of his worth, and would willingly have made him the protector of her daughter, had she not been struggling herself with all the horrors of poverty and therefore thought it wrong to encourage his passion. He addressed himself to her father, and this father was rich! He lavished on his mistress all the comforts and elegancies of life, yet refused to his family the scantiest pittance! He replied to the proposal that his daughter might marry, but that it was impossible for him to give her a shilling. Clarissa heard the unfeeling sentence with calm despair. She had just reached the age in which the affections of the heart develope themselves. The beauty of her form was unequalled, and innocence, candour, modesty, generosity, and heroism, were expressed with ineffable grace in every attitude and every feature. Clarissa was adored. Her lover was idolatrous. The woods, the dawning day, the starry heavens, witnessed their mutual vows. The grass pressed by her feet, the air she respired, the shade in which she reposed, were consecrated by her presence.
  • 60. Her mother marked, with pity, the progress of their mutual passion, which she could not forbid, for her own heart was formed for tenderness, nor could she sanction it, seeing no probability of its being crowned with success. But the happiness of her daughter was her only wish, and moved by her tears, her sighs, and the ardent prayers of her lover, she at length consented to their union. They were married and they were happy. But alas! a few days after their marriage a fever seized Clarissa. The distracted husband flew to her father who refused to send her the least assistance. She languished, and her mother and her husband hung over her in all the bitterness of anguish. The impossibility of paying a physician prevented their calling one, till it was too late, and, ten days after she had become a wife, she expired. I have held this disconsolate mother to my breast, my tears have mingled with hers: all the ties that bound her to the world are severed, and she wishes only for the moment that will put a period to her existence, when she fondly hopes she may be again united to her daughter. To the husband I have never uttered a word. His sorrow is deep and gloomy. He avoids all conversation, and an attempt to console him would be an insult on the sacredness of his grief. He has tasted celestial joys. He has lost the object of his love, and henceforth the earth is for him a desert. For the brutal father there is no punishment. His conscience itself inflicts none, for he expressed not the least regret when informed of the fate of his daughter. But when the story became known, the detestation his conduct excited was so violent, that the friends of Madame C—— have caused her to be separated from him, and obliged him to allow her a separate maintenance. Unfortunately their interest has been exerted too late. A few weeks sooner it might have saved her daughter. How terrible is the fate of a woman thus dependent on a man who has lost all sense of justice, reason, or humanity; who, regardless of his duties, or the respect he owes society, leaves his wife to contend with all the pains of want, and sees his child sink to an untimely
  • 61. grave, without stretching forth a hand to assist the one or save the other!
  • 63. St. Jago de Cuba. I write continually, my dear friend, though the fate of my letters is very uncertain. If they arrive safe they will prove that I have not forgotten you, and that I suffer no opportunity to pass without informing you that I exist. I understand that, after our departure from the Cape, the tyranny of the general in chief encreased, and that the inhabitants were daily exposed to new vexations. St. Louis, in particular, was the distinguished object of his hatred. Eternally on guard at the most dangerous posts, it was finally whispered that something, more decidedly bad, was intended him, and he thought it was time to try to escape from the threatening danger. Being informed of a vessel, that was on the point of sailing, he prevailed on a fisherman to put him outside of the fort in his boat, and wait till it came out, the captain not daring to take him on board in the harbour. On the day appointed, St. Louis, disguised as a fisherman, went into the boat, and, working at the oar, they were soon beyond the fort. The vessel approached shortly after, and St. Louis, embarking, thought himself out of danger. As soon as they were in reach of the English ships they were boarded, plundered and sent to Barracoa. St. Louis had no trunk, nor any clothes but what were on him, in which however was concealed gold to a great amount. A gentleman, who left the Cape the day after him, informed us of his escape, and of his having been sent to Barracoa, and also that, as soon as the general had heard of his departure, he had sent three barges after the vessel with orders to seize him, take him back, and, as soon as he was landed, shoot him without further ceremony. The whole town was in the greatest consternation. The barges were well manned and gained on the vessel, but a light wind springing up put it soon beyond their reach, and it was even believed that the
  • 64. officer, who commanded the barges, did not use all possible diligence to overtake them. We were rejoiced to hear of the fortunate escape of St. Louis but felt some anxiety at his not arriving, when lo! he appeared and gave us himself an account of his adventures. He is in raptures with the governor of Barracoa, his charming wife and the good father Philip, who, hearing that he was the husband of Clara, shewed him the most friendly attention. He brought us from them letters glowing with affectionate recollection. He talks of buying a plantation and of settling here. If he does I shall endeavour to return to the continent, but poor Clara! she weeps when I speak of leaving her, and when I consider the loneliness to which she will be condemned without me, I have almost heroism enough to sacrifice my happiness to her comfort. Before the arrival of St. Louis we lived in the house of the gentleman to whose care he had recommended us. He is a widower, the most cheerful creature in the world, but he lives in the times that are past; all his stories are at least forty years old. He talks continually of the mystification of Beaumarchais, and of the magic of Cagliostro. He told me, with all the solemnity of truth, that a lady at the court of France, who was past fifty, bought from Cagliostro, at a great price, a liquid, a single drop of which would take off, in appearance, ten years of age. The lady swallowed two drops, and went to the opera with her charms renewed, and her bloom restored to the freshness of thirty.—At her return she called her waiting woman, who had been her nurse and was at least seventy. She was nowhere to be found, but a little girl came skipping in. The lady, enquiring who she was, learned that old Ursula, intending to try the effect of the drops, had taken too large a dose, and was skipping about with all the sprightliness of fifteen. Nothing enrages the old gentleman so much as to doubt the truth of what he relates, or even to question its probability. He assured me