Automatic Control With Experiments PDF
Automatic Control With Experiments PDF
Automatic Control With Experiments PDF
Victor Manuel Hernández-Guzmán
Ramón Silva-Ortigoza
Automatic
Control with
Experiments
Advanced Textbooks in Control and Signal
Processing
Series editors
Michael J. Grimble, Glasgow, UK
Michael A. Johnson, Oxford, UK
Linda Bushnell, Seattle, WA, USA
More information about this series at http://www.springer.com/series/4045
Victor Manuel Hernández-Guzmán
Ramón Silva-Ortigoza
Automatic Control
with Experiments
123
Victor Manuel Hernández-Guzmán Ramón Silva-Ortigoza
Universidad Autonoma de Queretaro, Instituto Politécnico Nacional, CIDETEC
Facultad de Ingenieria Mexico City, Mexico
Querétaro, Querétaro, Mexico
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To Judith, my parents, and my brothers.
To the memory of my grand-parents.
Victor.
To my wonderful children – Ale, Rhomy,
Robert, and Rhena – and to my mother.
Ramón.
Foreword
vii
viii Foreword
is the authors’ experience that the use of scholars’ facilities is restricted in both time
and space. Thus, this proposal of the book is attractive.
The electronic components employed are basic and the authors know that today’s
technology offers more powerful alternatives. However, the subject of the book
is automatic control, not electronics or programming languages. Hence, it is the
intention of the authors not to divert the reader’s attention from automatic control to
electronics or computer programming. Thus, the electronics and programming are
kept as simple as possible. It is the authors’ belief that once the reader understands
automatic control she/he will be capable of translating the simple designs in
the book to sophisticated platforms based on modern advanced electronics and
programming technologies.
Automatic control is one of the disciplines that support the technologically advanced
lifestyle that we know today. Its applications are present in almost all the activities
performed by humans in the twenty-first century. From the Hubble spatial telescope
and spacecrafts, to the fridge at home used for food preservation. From residential
water tanks to large industries producing all the products demanded by people:
automobiles, aircrafts, food, drinks, and medicines, to name but some.
Although it is known that applications of automatic control have existed for
more than 2000 years, the Industrial Revolution motivated its development as
scientific and technological knowledge oriented toward the solution of technological
problems. Since then, automatic control has been instrumental in rendering human
activities more efficient, increasing the quality and repeatability of products.
It is for this reason that courses on automatic control have become common
in academic programs on electrical engineering, electronics, mechanics, chemistry
and, more recently, mechatronics and robotics. However, the fact that conventional
automatic control techniques are based on mathematics has traditionally posed
difficulties for education in this subject: to learn to design automatic control systems
the student is required to understand how to solve ordinary, linear, differential
equations with constant coefficients using Laplace transforms. This is an important
obstacle because this subject is commonly difficult for most undergraduate students.
The problem becomes worse because in automatic control the most important part
of solving a differential equation is the physical interpretation of a solution, which
is difficult for undergraduate students because most do not even understand how to
find the solution.
Another difficulty in automatic control education is how to teach students to
relate abstract mathematical results to the practical issues in a control system. How
do they implement a controller given in terms of the Laplace transform, i.e., as
a transfer function in practice? How do they implement a controller using digital
or analog electronics? How do they take into account sensors and power amplifier
gains? How do they determine the gain of a pulse width modulation-based power
amplifier? What are the effects of these gains in a control system?
ix
x Preface
The problems related to the practice described in the previous paragraph have
been traditionally solved using commercial teaching prototypes. However, this has
two drawbacks: (1) this equipment is excessively expensive and (2) many practical
issues in control systems remain “invisible” for students. This is because this
equipment is designed under the premise that it is not necessary for an automatic
control student to know how to solve practical issues related to electronics and
programming, for instance, that are present in several components of a control
system. This is a case of how do we build a power amplifier? How do we design
and implement a controller using operational amplifiers or a microcontroller? How
do we build our own sensors?
The present textbook offers undergraduate students and professors teaching
material that is intended to solve some of the above-mentioned difficulties. To
render the learning of theoretical aspects easier, a chapter devoted to solving
ordinary, linear, with differential equations with constant coefficients using Laplace
transforms is included. Although this chapter may be seen as a course on differential
equations, the main difference with respect to a mathematics course is that our
book is intended to help students to interpret the solution of differential equations.
Furthermore, effects that the differential equation parameters have on the solution
waveform are highlighted. According to the experience of the authors, automatic
control textbooks in the literature merely present a compendium of solutions of
differential equation and they do not succeed in making students reason what
they are doing. To overcome this problem, in the present textbook, we resort
to explaining differential equations through examples that every undergraduate
student has observed in real life, i.e., we resort to students’ everyday experience
to understand the meaning of mathematical results.
Difficulties related to practical aspects in control systems are overcome through
applications in several experimental control systems. Each one of these examples is
studied using the same procedure. First, tasks performed using the control systems
under study is described. Then, a complete explanation is given to the reader on
how to build each one of components of that control system. After that, it is shown
how to obtain the corresponding mathematical model and it is explained how to
experimentally estimate the numerical values of the system mathematical model
parameters. Automatic control techniques studied in the first chapters of the book
are then used to mathematically design the corresponding controller. It is also
explained in detail how to practically implement the designed controller using either
digital or analog electronics, and, finally, results obtained when testing the designed
control system experimentally are presented.
The present textbook is organized as follows. Chapter 1 presents a general view
of automatic control systems. The aim is to explain to the reader the main ideas
behind designing automatic control systems. This is achieved using several practical
examples whose main tasks are well understood by most people: a position control
system, a steering control system, a video camera recording control system, etc.
A brief history of automatic control is also presented and related to the content of
this book. The idea is to render the reader capable of identifying reasons why each
automatic control tool and concept has been developed. Chapter 2 is devoted to
Preface xi
physical system modeling. This chapter is oriented toward physical systems that are
common in electrical, electronics, mechanics, and mechatronics engineering. One
important reason for including this subject is that the reader realizes that control
systems are described by ordinary, linear, differential equations with constant
coefficients. This motivates the solution of differential equations in Chap. 3, as this is
instrumental to understanding how a control system responds and what the designer
has to modify in a control system to achieve the desired response.
Mathematical tools employed to design classical and modern control systems are
presented in Chaps. 4 to 7: stability criteria and the steady-state error (Chap. 4), the
root locus method (Chap. 5), the frequency response approach (Chap. 6), and the
state variables approach (Chap. 7). Exposition of these subjects is oriented toward
their application to practical examples presented in subsequent chapters of the book.
Hence, several examples in the first chapters of the book deal with the design of
controllers that are practically implemented and experimentally tested in the later
chapters.
Chapter 8 is included to study the theory required to understand some interesting
phenomena appearing during experiments when controlling some of the mecha-
nisms in the last chapters of the book. This is the case of: (a) large overshoots
observed even when all closed-loop poles are real, and (b) limit cycles in the Furuta
pendulum. Furthermore, a methodology useful for selecting controller gains such
that limit cycles are avoided is proposed using ideas in this chapter.
The structure of Chaps. 9 to 16 is the same, as they have the same objective: the
application of control techniques in Chaps. 4 to 8 to analyze and design practical
control systems. The designed controllers and the complete control systems are
practically built, employing low-cost components. Finally, experimental results
obtained when testing the complete control systems are presented.
In Chap. 9, several feedback electronic circuits are studied and designed. Among
them are some sine-wave oscillator circuits based on operational amplifiers (audio-
frequency) and bipolar transistors (radio-frequency), in addition to some power
amplifiers and a regenerative radio-frequency receiver. In Chaps. 10 and 11 velocity
and position are controlled respectively in a permanent magnet brushed DC motor.
Position of a mechanical system with flexibility is controlled in Chap. 12. A
magnetic levitation system is controlled in Chap. 13 whereas a ball and beam
system, a well-known mechanical system in the automatic control literature, is
controlled in Chap. 14. Finally, in Chaps. 15 and 16, two mechanisms including
a pendulum are controlled: the Furuta pendulum and the inertia wheel pendulum.
The authors hope the readers this material find useful.
The first author acknowledges the work of his coauthor; his collaboration has
been inestimable, not only in the elaboration of this book, but also in the diverse
research activities that the authors have performed since they were PhD students.
Special thanks to Dr Hebertt Sira-Ramírez from CINVESTAV-IPN, México City,
my PhD advisor, and to Dr Víctor Santibáñez from Instituto Tecnológico de la
Laguna, Torreón, México, for his collaboration. The first author also thanks his
students: Dr Jorge Orrante Sakanassi, Dr Valentín Carrillo Serrano, Dr Fortino
Mendoza Mondragón, Moises Martínez Hernández, Dr Mayra Antonio Cruz, Dr
Celso Márquez Sánchez, and Dr José Rafael García Sánchez. In particular, Dr
Carrillo Serrano has performed some of experiments in the book and he has helped
with the construction of some experimental prototypes. My deepest thanks to him.
Very special thanks to Dr Luis Furtado, Prof Michael Johnson, and Kiruthika
Kumar, from Springer, whose help throughout the whole publishing process has
been very important for the authors.
Ideas that have motivated this book have arisen during the undergraduate and the
graduate automatic control courses that the first author has taught at Facultad de
Ingeniería of Universidad Autónoma de Querétaro, where he has been based since
1995. He acknowledges this University for supporting him through the years, and
the Mexican Researcher’s National System (SNI-CONACYT) for financial support
since 2005. A special acknowledgment is deserved by my wife Judith, my parents,
Raul and Estela, and my brothers, Raul and Gustavo.
The second author acknowledges and thanks the first author for his invitation
to participate in the creation of this book and for other ambitious academic
and research projects. Special thanks to Drs Gilberto Silva-Ortigoza and Hebertt
Sira-Ramírez, researchers at Benemérita Universidad Autónoma de Puebla and
CINVESTAV-IPN, the former has been his mentor throughout his entire profes-
sional formation and the latter was his mentor during his graduate years. He also
acknowledges the important academic collaboration of Drs Hind Taud (CIDETEC-
IPN), Griselda Saldaña González (Universidad Tecnológica de Puebla) and Mariana
Marcelino Aranda (UPIICSA-IPN). The second author is grateful to CIDETEC of
Instituto Politécnico Nacional, the Research Center where he has been based since
xiii
xiv Acknowledgments
2006, SIP and programs EDI and COFAA from Instituto Politécnico Nacional,
for financial support, and to CONACYT’s Mexican Researcher’s National System
(SNI). A special mention is deserved by my children, Ale, Rhomy, Robert, and
Rhena. They are the inspiration I need to improve myself every day.
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2 Physical System Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3 Ordinary Linear Differential Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
4 Stability Criteria and Steady-State Error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
5 Time Response-Based Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
6 Frequency Response-Based Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
7 The State Variables Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
8 Advanced Topics in Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
9 Feedback Electronic Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547
10 Velocity Control of a Permanent Magnet Brushed Direct
Current Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605
11 Position Control of a PM Brushed DC Motor . . . . . . . . . . . . . . . . . . . . . . . . . . . 645
12 Control of a Servomechanism with Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . . 697
13 Control of a Magnetic Levitation System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
14 Control of a Ball and Beam System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
15 Control of a Furuta Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
16 Control of an Inertia Wheel Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 921
C Decibels, dB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965
xv
xvi Contents
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 989
Chapter 1
Introduction
Everybody has been a part of a control system at some time. Some examples of
this are when driving a car, balancing a broomstick on a hand, walking or standing
up without falling, taking a glass to drink water, and so on. These control systems,
however, are not automatic control systems, as a person is required to perform a role
in it. To explain this idea, in this section some more technical examples of control
systems are described in which a person performs a role.
A boat sailing is depicted in Fig. 1.1. There, the boat is heading in a direction that
is different from the desired course indicated by a compass. A sailor, or a human
pilot, compares these directions to obtain a deviation. Based on this information,
she/he decides what order must be sent to her/his arms to apply a suitable torque
on the rudder wheel. Then, through a mechanical transmission, the rudder angle
is modified, rendering it possible, by action of the water flow hitting the rudder,
to apply a torque to the boat. Finally, by the action of this torque, the boat rotates
toward the desired course. This secession of actions continuously repeats until the
boat is heading on the desired course. A block diagram of this process is shown in
Fig. 1.2.
In this block diagram, the fundamental concept of feedback in control systems
is observed. Feedback means to feed again and refers to the fact that the resulting
action of the control system, i.e., the boat actual course, is measured to be compared
with the desired course and, on the basis of such a comparison, a corrective action
(torque on the rudder wheel) is commanded again, i.e., fed again, trying to render
boat desired
course
water
rudder flow
deviation
boat
force due center torque actual course
to water flow of mass due to
water flow
human being
transmission
mechanical
d e v ia tio n
torque
torque
o rd e r
zero deviation between the desired and actual courses. It is said that the human
being performs as a controller: she/he evaluates the actual deviation and, based on
this information, commands a corrective order until the actual course reaches the
desired course. Although arms act as actuators, notice that the rudder wheel and the
mechanical transmission suitably amplify torque generated by the arms to actuate
the rudder.
This control system is not an automatic control system because a human being
is required to perform the task. Suppose that a large ship is engaged in a long trip,
i.e., traveling between two harbors on two different continents. In such a case, it
is preferable to replace the human brain by a computer. Moreover, as the ship is
very heavy, a powerful motor must be used to actuate the rudder. Thus, a machine
(the computer) must be used to control the ship by controlling another machine (the
rudder motor). In such a case, this control system becomes an automatic control
system.
In some instances, video recording must be performed while a video camera is mov-
ing, for example, when it is placed on a car driving on an irregular terrain, on a boat
on the sea surface, or attached to a cameraman who is running to record a scene that
is moving. The latter situation is depicted in Fig. 1.3. The cameraman must direct
1.2 Feedback Is Omnipresent 3
irregular terrain
irregular terrain
human being
torque disturbance
deviation
desired actual
torque
scene camera
order
-
direction + video direction
comparison decision arms
camera
feedback
the video camera toward the scene. However, because of the irregular terrain and the
natural movement of the cameraman who is running, the arms transmit an undesired
vibration to the video camera. A consequence of this vibration is deterioration of
the image recording. Although the cameraman may try to minimize this effect by
applying a corrective torque to the video camera, as shown in Fig. 1.4, the natural
limitations of the human being render it difficult to record well-defined images.
Thus, it is necessary to replace the human being in this control system by more
precise mechanisms, i.e., design of an automatic control system is required This
requires the use of a computer to perform the comparison and decision tasks, and
the combined use of tracks and a motor to actuate the camera. Because of the high
capability of these machines to perform fast and precise actions, high-quality images
can be recorded because vibration induced on the video camera can be suitably
compensated for [1, 2].
The main feature of control systems introduced in the previous section and the
automatic control systems with which this book is concerned is feedback. This is
the capability of a control system to command corrective actions until the desired
4 1 Introduction
This is a fundamental feedback system in all ecosystems. Predators need to eat prey
to survive. Then, if there are many predators, the number of prey diminishes because
many predators require lots of food. Then, a reduced number of prey ensures that
the number of predators also diminishes because of the lack of food. As the number
of predators diminishes, the number of prey increases, because there are fewer
predators to eat prey. Hence, there will be a point in time where the number of
prey is so large and the number of predators is so small that the number of predators
begins to increase, because of the food abundance. Thus, at some point in the future,
the number of predators will be large and the number of prey will be small, and the
process repeats over and over again.
Feedback exists in this process because the number of predators depends on the
number of prey and vice versa. Notice that, because of this process, the number of
predators and prey are kept within a range that renders possible sustainability of
the ecosystem. Too many predators may result in prey extinction which, eventually,
will also result in predator extinction. On the other hand, too many prey may result
in extinction of other species the prey eat and, hence, prey and predator extinction
results again.
The reader may wonder whether it is possible for the number of predators and
prey to reach constant values instead of oscillating. Although this is not common in
nature, the question is Why? This class of question can be answered using Control
Theory, i.e., the study of (feedback) automatic control systems.
1.2.2 Homeostasis
pancreas delivers more insulin and less glucagon, which has the following effects:
(i) it favors transportation of glucose from blood to cells, (ii) it increases demand
for glucose in cells, (iii) it stimulates the liver for glucose consumption to produce
glycogen, fats, and proteins. The effect of this set of actions is a reduction of glucose
concentration in the blood to safe, healthy levels.
On the other hand, if the glucose concentration in the blood diminishes, the
pancreas delivers more glucagon and less insulin, which has the following effects:
(i) it stimulates the liver cells to produce glucose, which is delivered into the
blood, (ii) it stimulates the degradation of fats into fatty acids and glycerol, which
are delivered into the blood, iii) it stimulates the liver to produce glucose from
glycogen, which is delivered into the blood. The effect of this set of actions is the
incrementation of the glucose concentration in the blood to safe, healthy levels.
The glucose regulation mechanisms described above are important because the
blood glucose level changes several times within a day: it increases after meals and
it decreases between meals because cells use or store glucose during these periods
of time. Thus, it is not difficult to imagine that glucose homeostasis performs as a
perturbed control system equipped with an efficient regulator: the pancreas.
According to this concept, homeostasis regulates internal changes for both physi-
ological and psychological reasons, which are called necessities. Thus, the life of
an organism can be defined as the constant search for and equilibrium between
necessities and their satisfaction. Every action searching for such an equilibrium
is a behavior.
6 1 Introduction
Human beings measure their body temperatures, using temperature sensors in their
brains and bodies.
A body temperature decrement causes a reduction of blood supply to the skin
to avoid heat radiation from the body to the environment, and the metabolic rate is
increased by the body shivering to avoid hypothermia.
When the body temperature increases, the sweat glands in the skin are stimulated
to secrete sweat onto the skin which, when it evaporates, cools the skin and blood
(Fig. 1.6).
On the other hand, fever in a human being is considered when the body’s
temperature is above 38◦ C. Fever, however, is a body’s natural defense mechanism
against infectious diseases, as high temperatures help the human body to overcome
microorganisms that produce diseases. This, however, results in body weakness,
because of the energy employed in this process. Thus, when this is not enough,
medical assistance is required.
v = kp e, (1.1)
• If θ < θd , then v > 0 and the load moves counter-clockwise such that θ
approaches θd .
• If θ > θd , then v < 0 and the load moves clockwise such that θ approaches θd
again.
• If θ = θd , then v = 0 and the load does not move and θ = θd stands forever.
According to this reasoning it is concluded that the law presented in (1.1) to
compute the voltage to be applied at the motor terminals has the potential to work
well in practice.
The expression in (1.1) is known as a control law or, simply, as a controller.
A block diagram showing the component interconnections in the position control
system is presented in Fig. 1.9. Notice that the construction of the controller in (1.1)
requires knowledge of the actual load position θ (also known as the system output
or plant output), which has to be used to compute the voltage v to be applied at
the motor terminals (also known as the plant input). This fact defines the basic
control concepts of feedback and a closed-loop system. This means that the control
system compares the actual load position (θ , the system output) with the desired load
1.3 Real-Life Applications of Automatic Control 9
motor
load
0
0 time
Fig. 1.10 Three possible transient responses in a one-degree-of-freedom position control system
position (θd , system desired output or system reference) and applies, at the motor
terminals, a voltage v, which depends on the difference between these variables
(see (1.1)).
The system error is defined as e = θd − θ . Hence, the steady state error1 is zero
because, as explained above, θd −θ = 0 can stand forever. However, the term steady
state means that this will be achieved once the time is long enough such that the load
stops moving (i.e., when the system steady-state response is reached). Hence, a zero
steady-state error does not describe how the load position θ evolves as it approaches
θd . This evolution is known as the system transient response.2 Some examples of
the possible shapes of the transient response are shown in Fig. 1.10. If kp in (1.1) is
larger, then voltage v applied at the motor terminals is larger and, thus, the torque
applied to the load is also larger, forcing the load to move faster. This means that
less time is required for θ to reach θd . However, because of a faster load movement
combined with load inertia, θ may reach θd with a nonzero load velocity θ̇ = 0. As
1 See Chap. 4.
2 See Chaps. 3, 5 and 6.
10 1 Introduction
a consequence, the load position continues growing and the sign of θd − θ changes.
Thus, the load position θ may perform several oscillations around θd before the
load stops moving. It is concluded that kp has an important effect on the transient
response and it must be computed such that the transient response behaves as desired
(a fast response without oscillations). Moreover, sometimes this requirement cannot
be satisfied just by adjusting kp and the control law in (1.1) must be modified, i.e.,
another controller must be used (see Chaps. 5, 6, 7 and 11). Furthermore, the steady-
state error may be different to zero (θ = θd when the motor stops) because torque
disturbances (static friction at either the motor or the load shafts may make the load
deviate from its desired position). This means that even the search for a zero or, at
least, a small enough steady-state error may be a reason to select a new controller.
Stability is a very important property that all control systems must possess.
Consider the case of a simple pendulum (see Fig. 1.11). If the pendulum desired
position is θd = 0, it suffices to let the pendulum move (under a zero external torque,
T (t) = 0) just to find that the pendulum oscillates until the friction effect forces it to
stop at θ = 0. It is said that the pendulum is stable at θd = 0 because it reaches this
desired position in a steady state when starting from any initial position that is close
enough. On the other hand, if the desired position is θd = π , it is clear that, because
of the effect of gravity, the pendulum always moves far away from that position, no
matter how close to θd = π the initial position selected. It is said that the pendulum
is unstable at θd = π . Notice that, according to this intuitive description, the position
control system described above is unstable if control law in (1.1) employs a constant
negative value for kp : in such a case, the load position θ would move far away from
θd . Thus, kp also determines the stability of the closed-loop control system and it
must be selected such that closed-loop stability is ensured.3 It must be remarked
that in the case of an unstable closed-loop system (when using a negative kp ) a
zero steady-state error will never be accomplished, despite the control law in (1.1),
indicating that the motor stops when θ = θd . The reason for this is that, even if
θ = θd since the beginning, position measurements θ always have a significant
noise content, which would render θ = θd in (1.1) and this would be enough to
move θ far away from θd .
3 See Chaps. 3, 4, 5, 6, 7.
1.3 Real-Life Applications of Automatic Control 11
A robotic arm is shown in Fig. 1.12. A robotic arm can perform several tasks, for
instance:
• Take a piece of some material from one place to another to assemble it together
with other components to complete complex devices such as car components.
• Track a pre-established trajectory in space to solder two pieces of metal
or to paint surfaces. Assume that the pre-established trajectory is given
as six dimensional coordinates parameterized by time, i.e., three for the
robot tip position [xd (t), yd (t), zd (t)] and three for the robot tip orientation
[α1d (t), α2d (t), α3d (t)]. Thus, the control objective is that the actual robot tip
position [x(t), y(t), z(t)] and orientation [α1 (t), α2 (t), α3 (t)] reach their desired
values as time grows, i.e., that:
Fig. 1.13 A
two-degrees-of-freedom
robotic arm
4 Permanent magnet brushed DC motors have been replaced by more efficient permanent magnet
synchronous motors in recent industrial robot models. However, control of permanent magnet
synchronous motors is complex and, hence, they are not suitable for an introductory example of
automatic control systems.
5 The robot base is selected to be the origin of the coordinate frame defining the robot tip position.
14 1 Introduction
One way to define the trajectory to be tracked by the robot tip is as follows.
The robot tip is manually taken through all points defining the desired trajectory.
While this is performed, the corresponding angular positions at the shoulder and
elbow joints are measured and recorded. These data are used as the desired positions
for motors at each joint, i.e., θ1d , θ2d . Then, the robot is made to track the desired
trajectory by using a control scheme similar to that described in Sect. 1.3.1 for each
motor. Two main differences exist between the control law in (1.1) and the control
law used for the motor at the shoulder, with angular position θ1 :
t
v1 = kp1 (θ1d − θ1 ) − kd1 θ̇1 + ki1 (θ1d (r) − θ1 (r))dr, (1.2)
0
These differences are the velocity feedback term, with the general form −kd θ̇ , and
t
the integral term, with the general form ki 0 (θd (r) − θ (r))dr. Notice that the term
−kd θ̇ has the same form as viscous friction, i.e., −bθ̇ with b the viscous friction
coefficient.6 Hence, adding velocity feedback to control laws in (1.2) and (1.3)
is useful to increase the system damping, i.e., in order to reduce the oscillations
pointed out in section (1.3.1), allowing fast robot movements without oscillations.
On the other hand, the integral term ensures that position θ reaches the desired
position θd , despite the presence of gravity effects. This can be seen as follows.
Suppose that:
are used instead of (1.2) and (1.3). If θ1d = θ1 and θ̇1 = 0, then v1 = 0. Hence, if
gravity exerts a torque at the shoulder joint this motor cannot compensate for such a
t v1 = 0) and, thus, θ1d = θ1 results. On the other hand, if θ1d = θ1 ,
torque (because
the term ki1 0 (θ1d (r) − θ1 (r))dr adjusts voltage v1 until θ1d = θ1 again and this
can remain forever because the integral is not zero, despite its integrand being zero.
A similar analysis yields the same results for the joint at the elbow, i.e., the use
of (1.2) and (1.3) is well justified.
The main problem for the use of (1.2) and (1.3) is the selection of the
controller gains kp1 , kp2 , kd1 , kd2 , ki1 , ki2 and the automatic control theory has been
developed to solve this kind of problem. Several ways of selecting these controller
gains are presented in this book and are known as proportional integral derivative
(PID) control tuning methods.
Recall Sect. 1.1.1 where the course of a boat was controlled by a human being.
This situation was depicted in Figs. 1.1 and 1.2. Consider now the automatic control
problem formulated at the end of Sect. 1.1.1: where the course of a large ship is
to be controlled using a computer and a permanent magnet brushed DC motor to
actuate a rudder. The block diagram of this control system is depicted in Fig. 1.14.
Mimicking Sect. 1.3.1, controller 1 is designed to perform the following compu-
tation:
The desired course angle shown in Fig. 1.1 is defined as positive. Thus, if kp1 is
positive θd is also positive. Suppose that the rudder angle θ , defined as positive
when described as in Fig. 1.1, reaches θd > 0. Then, water hitting the rudder will
produce a torque T2 on the ship, which is defined as positive when applied as in
Fig. 1.1. This torque is given as a function δ(θ, s)7 depending on the rudder angle
θ and the water speed s. Torque T2 produces a ship rotation such that the actual
course approaches the desired course.
The reader can verify, following the above sequence of ideas, that in the case
where the desired course is negative, it is reached again by the actual course if
kp1 > 0. This means that a positive kp1 is required to ensure that the control
system is stable. Moreover, for similar reasons to the position control system, as
kp1 > 0 is larger, the ship rotates faster and several oscillations may appear before
7 This function is determined by ship construction, cannot be modified by a controller design and
it is not computed during controller evaluation.
16 1 Introduction
settling at the desired course. On the contrary, as kp1 > 0 is smaller the ship rotates
more slowly and the desired course is reached after a long period of time. Thus,
the transient behavior of the actual course is similar to that shown in Fig. 1.10 as
kp1 > 0 is changed. Finally, it is not difficult to verify that the control system is
unstable if kp1 is negative.
In this system controller 2 is designed to perform the following computation:
whereas the power amplifier just amplifies u by a positive factor to obtain voltage v
to be applied at the motor actuating on the rudder. Following ideas in Sect. 1.3.1, it
is not difficult to realize that θ reaches θd as time grows because kp2 > 0 whereas
instability is produced if kp2 < 0. As explained before, the ship may oscillate if
kp1 > 0 is large. Moreover, for similar reasons, the rudder may also oscillate several
times before θ reaches θd if kp2 > 0 is large. A combination of these oscillatory
behaviors may result in closed-loop system instability despite kp1 > 0 and kp2 > 0.
Thus, additional terms must be included in expressions (1.6) and (1.7) for controller
1 and controller 2. The question is, what terms? Finding an answer to this class of
questions is the reason why control theory has been developed and why this book
has been written. See Chap. 14 for a practical control problem which is analogous
to the control problem in this section.
Recall the problem described at the end of Sect. 1.1.2, i.e., when proposing to use
a computer to perform the comparison and decision tasks, and a combination of
some tracks and a motor to actuate on the camera, to compensate for video camera
vibration when recording a scene that is moving away. To fully solve this problem,
the rotative camera movement must be controlled on its three main orientation axes.
However, as the control for each axis is similar to the other axes and for the sake
of simplicity, the control on only one axis is described next. The block diagram of
such an automatic control system is presented in Fig. 1.15.
A gimbal is used to provide pivoted support to the camera allowing it to rotate in
three orthogonal axes. See Fig. 1.16. A measurement device known as gyroscope, or
gyro for short, measures the inertial angular velocity ω of the camera. This velocity
is not a velocity measured with respect to the cameraman’s arms (or the vehicle to
which the video camera is attached), but it is camera velocity measured with respect
to a coordinate frame that is fixed in space. Thus, this velocity is independent of the
movement of the cameraman (or the movement of the vehicle to which the video
camera is attached). As a simple example, consider the camera orientation control
problem in a single axis. Controller 2 may be designed to perform the following
mathematical operation:
where kp2 is a positive number. Suppose that ωd = 0, then u = −kp2 ω. This means
that in the case where, because of the vibration induced by a negative torque TT < 0,
i.e. −TT > 0, the camera is instantaneously moving with a large positive velocity
ω > 0, then a negative voltage u = −kp2 ω < 0 will be commanded to the motor,
which will result in a negative generated torque T2 < 0 intended to compensate
for −TT > 0, i.e., resulting in a zero camera angular velocity again. The reader
can verify that a similar result is obtained if a negative camera velocity ω < 0 is
produced by a TT > 0. Notice that, according to (1.8), u adjusts until the camera
velocity ω = ωd = 0. Hence, the vibration produced by the disturbance torque TT
is eliminated. Although solving this problem is the main goal of this control system,
the camera must also be able to record the scene when located in another direction
if required. Recall that the scene is moving. This is the main reason for Controller 1
which, for simplicity, is assumed to perform the following mathematical operation:
where kp1 is a positive constant. Hence, Controller 1 determines the angular velocity
that the camera must reach to keep track of the desired scene. Observe that ωd
adjusts until the actual camera direction equals the desired scene direction. However,
according to the above definition, ωd would be zero when the actual camera
direction equals the desired scene direction. Notice that this is not possible when
these variables are equal but not constant, i.e., when the camera must remain moving
at a nonzero velocity. For this reason, the following expression is preferable for
Controller 1:
18 1 Introduction
This allows that ωd = 0, despite the actual camera direction equals the desired scene
direction because an integral is constant, but not necessarily zero, when its integrand
is zero. Moreover, computing u as in (1.8) forces the camera velocity ω to reach ωd
even if the latter is not zero in a similar manner to the actual position reaching the
desired position in Sect. 1.3.1. However, computing u as in (1.8) would result in a
zero voltage to be applied at motor terminals when ωd = ω and, hence, the motor
would tend to stop, i.e., ωd = ω cannot be satisfied when ωd = 0. For this reason,
the following expression is preferable for Controller 2:
t
u = kp2 (ωd − ω) + ki2 (ωd − ω)dt.
0
This allows the voltage commanded to motor u to be different from zero despite
ωd = ω. Thus, this expression for Controller 2 computes a voltage to be commanded
to the motor to force the camera velocity to reach the desired velocity ωd , which is
computed by Controller 1 such that the actual camera direction tracks the direction
of the desired scene. Again, a selection of controller gains kp1 , ki1 , kp2 , ki2 , is one
reason why automatic control theory has been developed.
The reader is referred to Fig. 1.17 for a graphical explanation of the concepts defined
below.
• Plant. The mechanism, device or process to be controlled.
• Output. Variable or property of the plant that must be controlled.
• Input. Variable or signal that, when adjusted, produces important changes in the
plant output.
• Desired output or reference. Signal that represents the behavior that is desired
at the plant output.
• Feedback. Use of plant output measurements to verify whether it behaves as the
desired output or reference.
• Controller. Device that computes the value of the signal to be used as the input
to the plant to force the plant output to behave as the desired output or reference.
• System. Assembly of devices with connections among them. The plant is also
designated as a system.
• Control system. Assembly of devices that includes a plant and a controller.
• Closed-loop system. A system provided with feedback. In a closed-loop system,
the output of every system component is the input of some other system
component. Thus, it is important to specify what input or what output is referred
to.
• Open-loop system. A system that is not provided with feedback. Although the
plant may be naturally provided with some kind of feedback, it is common to
designate it as an open-loop system when not controlled using feedback.
• Measurement system. A system that is devoted to measure the required signals
to implement a closed-loop system. Its main component is a sensor.
• Actuator. A device that applies the input signal to the plant. It is a device that
requires high levels of power to work.
• Power amplifier. A device that receives a weak signal from a controller and
delivers a powerful signal to the actuator.
• External disturbance. A signal that is external to the control system having
deleterious effects on the performance of the closed-loop system. This signal
may appear at the plant input or output or even at any component of the control
system.
The previous sections of this chapter described the objectives pursued when
designing a control system along with some useful ideas on how to achieve them.
In this section, a brief history of automatic control is presented. The reader is
expected to realize that the development of fundamental tools and concepts in
automatic control have been motivated by practical engineering problems arising
when introducing new technologies [10]. In this exposition, the reader is referred to
specific chapters in this book where the corresponding tools and ideas are further
studied. The content of the present section is based on information reported in [6].
The reader is referred to that work for more details on the history of automatic
control.
Automatic control has existed and has been applied for more than 2000 years. It
is known that some water clocks were built by Ktesibios by 270 BC, in addition to
some ingenious mechanisms built at Alexandria and described by Heron. However,
from the engineering point of view, the first important advance in automatic control
20 1 Introduction
was attributed to James Watt in 1789 when introducing a velocity regulator for its
improved steam-engine.8 However, despite its importance Watt’s velocity regulator
had several problems. Sometimes, the velocity oscillated instead of remaining
constant at a desired value or, even worse, sometimes the velocity increased without
a limit.9 Working toward a solution of these problems, between 1826 and 1851, J.V.
Poncelet and G.B. Airy showed that it was possible to use differential equations to
represent the steam-engine and the velocity regulator working together (see Chap. 2
for physical system modeling).
By those years, mathematicians knew that the stability of a differential equation
was determined by the location of the roots of the corresponding characteristic
polynomial equation, and they also knew that instability appeared if some root had
a positive real part (see Chap. 3, Sect. 3.4). However, it was not simple to compute
the roots of a polynomial equation and sometimes this was even not possible. In
1868, J.C. Maxwell showed how to establish the stability of steam-engines equipped
with Watt’s velocity regulator just by analyzing the system’s differential equation
coefficients. Nevertheless, this result was only useful for second-, third-, and fourth-
order differential equations. Later, between 1877 and 1895, and independently, E.J.
Routh and A. Hurwitz conceived a method of determining the stability of arbitrary
order systems, solving the problem that Maxwell had left open. This method is
known now as the Routh criterion or the Routh–Hurwitz criterion (see Chap. 4,
Sect. 4.3).
Many applications related to automatic control were reported throughout the
nineteenth century. Among the most important were temperature control, pressure
control, level control, and the velocity control of rotative machines. On the other
hand, several applications were reported where steam was used to move large guns
and as actuators in steering systems for large ships [9, 11]. It was during this period
when the terms servo-motor and servo-mechanism were introduced in France to
describe a movement generated by a servo or a slave device. However, despite this
success, most controllers were simple on-off. People such as E. Sperry and M.E.
Leeds realized that performance could be improved by smoothly adjusting the power
supplied to the plant as the controlled variable approached its desired value. In 1922,
N. Minorsky presented a clear analysis of position control systems and introduced
what we know now as the PID controller (see Chap. 5, Sect. 5.2.5). This controller
was conceived after observing how a ship’s human pilot controls heading [12].
On the other hand, distortion by amplifiers had posed many problems to
telephony companies since 1920.10 It was then that H.S. Black found that distortion
8 Since flooding in coal and tin mines was a major problem, the first practical steam-engine was
introduced in England by T. Newcomen in 1712 to improve ways of pumping water out of such
mines.
9 This behavior is known now as instability, see Chap. 3, Sect. 3.4.5.
10 As the wired telephony lines expanded because of the growing number of users, signal
attenuation was stronger because of the wires’ electrical resistance. The solution was to use several
signal amplifiers at selected points in the telephony network. These amplifiers, however, produced
significant signal distortion and the sound quality deteriorated.
1.5 History of Automatic Control 21
is reduced if a small quantity of signal at the amplifier output is fed back to its
input. During this work, Black was helped by H. Nyquist who, in 1932, published
these experiences in a report entitled “Regeneration Theory” where he established
the basis of what we know now as Nyquist Analysis (see Chap. 6, Sect. 6.4).
During the period 1935–1940, telephony companies wanted to increase the
bandwidth of their communication systems to increase the number of users. To
accomplish this, it was necessary for the telephonic lines to have a good frequency
response characteristic (see Chap. 6). Motivated by this problem, H. Bode studied
the relationship between a given attenuation characteristic and the minimum
associated phase shift. As a result, he introduced the concepts of gain margin and
phase margin (see Chap. 6, Sect. 6.5) and he began to consider the point (−1, 0) in
the complex plane as a critical point instead of point (+1, 0) introduced by Nyquist.
A detailed description of Bode’s work appeared in 1945 in his book “Network
Analysis and Feedback Amplifier Design.”
During World War II, work on control systems focused on some important
problems [8]. The search for solutions to these problems motivated the development
of new ideas on mechanism control. G.S. Brown from the Massachusetts Institute of
Technology showed that electrical and mechanical systems can be represented and
manipulated using block diagrams (see Chap. 4, Sect. 4.1) and A.C. Hall showed in
1943 that defining blocks as transfer functions (see Chap. 3), it was possible to find
the equivalent transfer function of the complete system. Then, the Nyquist Stability
criterion could be used to determine gain and phase margins.
Researchers at the Massachusetts Institute of Technology employed phase lead
circuits (see Chap. 11, Sect. 11.2.2) at the direct path to improve the performance of
the closed-loop system, whereas several internal loops were employed in the UK to
modify the response of the closed-loop system.
By the end of World War II, the frequency response techniques, based on
the Nyquist methodology and Bode diagrams, were well established, describing
the control system performance in terms of bandwidth, resonant frequency, phase
margin, and gain margin (see Chap. 6). The alternative approach to these techniques
relied on the solution of the corresponding differential equations using Laplace
transform, describing control system performance in terms of rise time, overshoot,
steady-state error, and damping (see Chap. 3, Sect. 3.3). Many engineers preferred
the latter approach because the results were expressed in “real” terms. But this
approach had the drawback that there was no simple technique for designers to use
to relate changes in parameters to changes in the system response. It was precisely
the Root Locus method [7] (see Chap. 5, Sects. 5.1 and 5.2), introduced between
1948 and 1950 by W. Evans, that allowed designers to avoid these obstacles. Hence,
what we know now as the Classical Control Techniques were well established
by that time, and they were orientated to systems represented by ordinary, linear
differential equations with constant coefficients and single-input single-output.
Then, the era of supersonic and space flights arrived. It was necessary to employ
detailed physical models represented by differential equations that could be linear
or nonlinear. Engineers working in the aerospace industries found, following the
ideas of Poincaré, that it was possible to formulate general differential equations
22 1 Introduction
11 Robustness is a property of a control system that indicates that the closed-loop system
performance is not affected or it is just a little affected by external disturbances, parameter
uncertainties, and measurement noise.
1.7 Summary 23
It has been stated in the previous sections that automatic control has developed
to solve important engineering problems. However, teaching automatic control
techniques requires students to experimentally apply their new knowledge of this
subject. It is not possible to accomplish this using either industrial facilities or high-
technology laboratories. This is the reason why teaching automatic control relies
on construction of some experimental prototypes. An experimental prototype is
a device that has two main features: (i) it is simple enough to be built and put
into operation using low-cost components, and (ii) its model is complex enough to
allow some interesting properties to appear such that the application of the control
techniques under study can be demonstrated. A list of experimental prototypes used
in this book is presented in the following and the specific control techniques tested
on them are indicated:
• Electronic oscillators based on operational amplifiers and bipolar junction
transistors (Chap. 9). Frequency response, Nyquist stability criterion, and Routh
stability criterion.
• Permanent magnet brushed DC motors (Chaps. 10 and 11). Several basic
controller designs using time response: proportional, proportional–derivative,
proportional–integral, proportional–integral–derivative, phase lead controllers,
two-degrees-of-freedom controllers.
• Mechanism with flexibility (Chap. 12). Frequency response for experimental
identification and root locus for controller design.
• Magnetic levitation system (Chap. 13). PID controller design using linear
approximation of a nonlinear system and the root locus method.
• Ball and beam system (Chap. 14). Design of a multi-loop control system using
frequency response (Nyquist criterion and Bode diagrams) and the root locus
method.
• Furuta pendulum (Chap. 15). Design of a linear state feedback controller using
the state variable approach. A linear approximation of a nonlinear system is
employed.
• Inertia wheel pendulum (Chap. 16). Design of two state feedback controllers.
One of these controllers is designed on the basis of the complete nonlinear model
of the inertial wheel pendulum and it is employed to introduce the reader to the
control of nonlinear systems.
1.7 Summary
In the present chapter, the main ideas behind closed-loop control have been
explained and the objectives of designing a control system were also described. A
brief history of automatic control has been presented to show the reader that all con-
cepts and tools in control systems have been motivated by solving important tech-
nological problems. This historical review has been related to content of this book.
24 1 Introduction
References
1. M. K. Masten, Inertially stabilized platforms for optical imaging systems, IEEE Control
Systems Magazine, pp. 47–64, February 2008.
2. T. L. Vincent, Stabilization for film broadcast cameras, IEEE Control Systems Magazine,
pp. 20–25, February 2008.
3. Homeostasis (In Spanish), Wikipedia, the free encyclopedia, available at https://es.wikipedia.
org/wiki/Homeostasis, July 2017.
4. A. Adserá-Bertran, The human body. What is homeostasis? (In Spanish), enciclo-
pediasalud.com, available at http://www.enciclopediasalud.com/categorias/cuerpo-humano/
articulos/que-es-la-homeostasis-ejemplos-de-homeostasis, November 2009.
5. Fratermindad Muprespa, The health corner. Fever (In Spanish), available at http://www.
rincondelasalud.com/es/articulos/salud-general_la-fiebre_20.html#prim, 2017.
6. S. Bennett, A brief history of automatic control, IEEE Control Systems Magazine, pp. 17–25,
June 1996.
7. G. W. Evans, The story of Walter R. Evans and his textbook Control-Systems Dynamics, IEEE
Control Systems Magazine, pp. 74–81, December 2004.
8. D. A. Mindell, Anti-aircraft fire control and the development of integrated systems at Sperry,
1925–1940, IEEE Control Systems Magazine, pp. 108–113, April 1995.
9. S. W. Herwald, Recollection of the early development of servomechanism and control systems,
IEEE Control Systems Magazine, pp. 29–32, November 1984.
10. D. S. Bernstein, Feedback control: an invisible thread in the history of technology, IEEE
Control Systems Magazine, pp. 53–68, April 2002.
11. W. Oppelt, On the early growth of conceptual thinking in the control system theory – the
German role up to 1945, IEEE Control Systems Magazine, pp. 16–22, November 1984.
12. S. Bennett, Nicolas Minorsky and the automatic steering of ships, IEEE Control Systems
Magazine, pp. 10–15, November 1984.
Chapter 2
Physical System Modeling
In mechanical systems there are three basic phenomena: bodies, flexibility, and
friction. The main idea is to model each one of these phenomena and then
connect them to obtain the mathematical model of the complete mechanical system.
Furthermore, there are two different classes of mechanical systems: translational
and rotative. In the following, we study both of them.
In Fig. 2.1 a rigid body is shown (without flexibility) with mass m (a positive
quantity), which moves with velocity v under the effect of a force F . It is assumed
that no friction exists between the body and the environment. The directions shown
for force and velocity are defined as positive for this system component. Under these
conditions, the constitutive function is given by Newton’s Second Law [2], pp. 89:
F = ma, (2.1)
F = k x, (2.3)
F = ϕ(v),
where v is the relative velocity between the bodies and F is the applied force. A
very important specific case is viscous friction, which is represented by the linear
constitutive function :
where b is a positive constant known as the viscous friction coefficient. This kind of
friction appears, for instance, when a plate with several holes moves inside a closed
compartment with air, as shown in Fig. 2.3. Because air must flow through the holes
as relative movement exists with velocity v, it is necessary to apply a force F to
maintain the velocity. It is defined v = v1 − v2 where v1 and v2 are velocities of
bodies 1 and 2 respectively. The directions of forces and velocities shown in Fig. 2.3
are defined as positive. Although the device shown in Fig. 2.3 may not be physically
placed between the two bodies, the effect of viscous friction is commonly present
and must be taken into account.
There are other kinds of friction that often appear in practice. Two of them are
static friction and Coulomb friction. The respective constitutive functions are given
as:
2
v2
F F F
Fs Fc
b
v v v
–Fs –Fc
Static friction is represented by a force that prevents movement only just before
this starts. This is the reason why constant Fs is evaluated at v = 0 in (2.5).
Coulomb friction, in contrast, only appears when movement has started (v = 0)
and it is constant for velocities having the same sign. The constitutive functions
in (2.4), (2.5), and (2.6) are depicted in Fig. 2.4.
As the static friction force is not zero as velocity tends to zero, it is responsible
for some of the problems in position control systems: the difference between the
desired position and position actually reached by the mechanism is different from
zero, which is known as “a nonzero steady state error.” On the other hand, static and
Coulomb friction have nonlinear and discontinuous constitutive functions; hence,
they can be handled using control techniques developed for neither linear systems
nor “smooth” nonlinear systems. This is the reason why these kinds of friction are
not often considered when modeling control systems. However, it must be remarked
that the effects of these frictions are always appreciable in experimental situations.
The reader is referred to [4] to know how to measure the parameters of some friction
models.
Once the constitutive functions of each system component have been established,
they must be connected to conform the mathematical model of more complex
systems. The key to connecting components of a mechanical system is to assume
that all of them are connected by means of rigid joints. This means that velocities on
both sides of a joint are equal and that, invoking Newton’s Third Law, each action
produces a reaction that is equal in magnitude but opposite in direction. This is
clarified in the following by means of several examples.
2.1 Mechanical Systems 29
K F (t) b
m
vK vm vb
F (t)
FK Fb
m
FK Fb
Example 2.1 Consider the mass-spring-damper system shown in Fig. 2.5a where
an external force F (t) is applied on mass m. This system is, perhaps, the simplest
mechanical system from the modeling point of view, but it is very important from
the control point of view because it represents the fundamental behavior of position
control systems.
A free-body diagram is shown in Fig. 2.5b. Notice that two forces, equal in
magnitude but with opposite directions, exist at each joint between two components.
This is to satisfy Newton’s Third Law [2], pp. 88, which establishes that for each
action (from A on B) there is one corresponding reaction (from B on A). Wheels
under the mass indicate that no friction exists between the mass and the floor. This
also means that gravity has no effect. From the friction modeling point of view, it is
equivalent to eliminating a damper at the right and replace it by friction between the
mass and the floor. The friction model between the mass and the floor is identical to
the friction model due to a damper as considered in the following.
The nomenclature employed is defined as:
• vm = dx m
dt , where xm is the mass position.
dxb
• vb = dt , where xb is the position of the damper’s mobile side.
• vK = dxdtK , where xK is the position of the spring’s mobile side.
The following expressions are found from Fig. 2.5b, and (2.1), (2.3), (2.4):
dvm
Mass: m = F (t) + FK − Fb . (2.7)
dt
Spring: KxK = FK . (2.8)
Damper: bvb = Fb . (2.9)
Notice that, according to the sign definitions shown in Fig. 2.1, forces actuating
on mass m having the same direction as vm in Fig. 2.5b appear affected by a positive
30 2 Physical System Modeling
sign in (2.7); therefore, Fb appears affected by a negative sign. Signs on both sides
of expressions in (2.8) and (2.9) are given according to the sign definitions shown in
Figs. 2.2 and 2.3 respectively. Also notice that one side of both spring and damper
has no movement and the mobile sides have a velocity and a force applied in the
same direction as in Figs. 2.2 and 2.3. Finally:
dxK
vK = , (2.10)
dt
has been defined. Assuming that all of the system components are connected by
rigid joints and according to Fig. 2.5b, the following can be written:
xK = −xm + c1 = −xb + c2 ,
xK = −xm = −xb .
d 2 xm dxm
m +b + Kxm = F (t). (2.12)
dt 2 dt
This expression is an ordinary, linear, second-order, constant coefficients differ-
ential equation representing the mass-spring-damper system mathematical model.
Thus, assuming that the parameters m, b, and K are known, the initial conditions
xm (0), dx m
dt (0) are given, and the external force F (t) is a known function of time, this
differential equation can be solved to find the mass position xm (t) and the velocity
dxm
dt (t) as functions of time. In other words, the mass position and velocity can be
known at any present or future time, i.e., for all t ≥ 0. Finally, when analyzing
a differential equation, it is usual to express it with an unitary coefficient for the
largest order time derivative, i.e., (2.12) is written as:
b K 1
ẍm + ẋm + xm = F (t), (2.13)
m m m
d 2 xm dxm
where ẍm = dt 2
and ẋm = dt .
2.1 Mechanical Systems 31
m F (t)
v1 v
FK
FK
Fb m F (t)
Fb
v1
sides.
According to Fig. 2.6b and (2.1), (2.3), (2.4), the following can be written:
dv
Mass: m = F (t) + FK + Fb . (2.14)
dt
Spring: KxK = FK .
Damper: bv1 = Fb .
Notice that, according to the sign definition shown in Fig. 2.1, all forces in (2.14)
appear with a positive sign because all of them have the same direction as v in
Fig. 2.6b. On the other hand, as the joint is rigid and according to the sign definition
in Fig. 2.6b:
v = −v1 . (2.15)
xK = xb = −x. (2.16)
32 2 Physical System Modeling
F (t)
K
m1 m2
b1 b2
vm1 vK vm2
vb2
F (t) FK1 K Fb2
F b1
m1 m2
FK2 Fb2
vb1 F b1 FK1 FK2
v1 v2
Notice that combining expressions in (2.14) and using (2.16), (2.15) yield:
b K 1
ẍ + ẋ + x = F (t),
m m m
2
where ẍ = ddt x2 and ẋ = dx
dt . This mathematical model is identical to that shown
in (2.13) if x = xm is assumed.
Example 2.3 Two bodies connected by a spring, with an external force F (t) applied
on the body at the left, are shown in Fig. 2.7a. This situation arises in practice when
body 1 transmits movement to body 2 and they are connected through a piece of
some flexible material. It is remarked that flexibility is not intentionally included,
but it is an undesired problem that appears because of the finite stiffness of the
material in which the piece that connects bodies 1 and 2 is made. It is often very
important to study the effect of this flexibility on the achievable performance of the
control system; hence, it must be considered at the modeling stage. The dampers are
included to take into account the effects of friction between each body and the floor.
The free-body diagram is depicted in Fig. 2.7b. The nomenclature employed is
defined as:
• vm1 = dxdtm1 , where xm1 is the position of body 1.
• vm2 = dxdtm2 , where xm2 is the position of body 2.
• vb1 = dxdtb1 , where xb1 is the position of damper 1’s mobile side.
• vb2 = dxdtb2 , where xb2 is the position of damper 2’s mobile side.
• v1 = dx 1
dt , where x1 is the position of the spring side connected to body 1.
dx2
• v2 = dt , where x2 is the position of the spring side connected to body 2.
2.1 Mechanical Systems 33
Using Fig. 2.7b, as well as (2.1), (2.3), (2.4), the following is obtained:
dvm1
Mass 1: m1 = F (t) + Fb1 − FK1 . (2.17)
dt
dvm2
Mass 2: m2 = FK2 − Fb2 . (2.18)
dt
Spring: KxK = FK1 = FK2 .
Damper 1: b1 vb1 = Fb1 .
Damper 2: b2 vb2 = Fb2 .
Forces having the same direction as vm1 and vm2 , actuating on each one of the
bodies, appear with a positive sign, and a negative sign if this is not the case. Notice
that it is also defined:
dxK
vK = = v1 − v2 .
dt
Assuming that all of the system components are connected by rigid joints then,
according to Fig. 2.7b:
dvm1
Mass 1: m1 = F (t) + b1 vb1 − KxK .
dt
dvm2
Mass 2: m2 = KxK − b2 vb2 .
dt
Use of (2.19), (2.20), yields:
d 2 xm1 dxm1
Mass 1: m1 2
= F (t) − b1 − KxK .
dt dt
34 2 Physical System Modeling
d 2 xm2 dxm2
Mass 2: m2 2
= KxK − b2 .
dt dt
On the other hand, xK = x1 − x2 according to paragraph after (2.2) and, thus:
d 2 xm1 dxm1
Mass 1: m1 = F (t) − b1 − K(x1 − x2 ).
dt 2 dt
d 2 xm2 dxm2
Mass 2: m2 2
= K(x1 − x2 ) − b2 .
dt dt
Finally, using again (2.20), it is found that the mathematical model is given by the
following pair of differential equations, which have to be solved simultaneously:
d 2 xm1 b1 dxm1 K 1
Mass 1: + + (xm1 − xm2 ) = F (t).
dt 2 m1 dt m1 m1
d 2 xm2 b2 dxm2 K
Mass 2: 2
+ − (xm1 − xm2 ) = 0.
dt m2 dt m2
F (t) x1 x2
K2
K1 K3
m1 m2
FK2 FK2
x1 x2
vK1 FK3
FK 1 FK2
FK2
v1 v2 FK3
m1 Fb m2
Fig. 2.8 A mechanical system with two bodies and three springs
Assuming that all of the system components are connected by rigid joints then,
according to Fig. 2.8b:
On the other hand, xK2 = x1 − x2 according to paragraph after (2.2), and hence:
b K1 K2 1
Mass 1: ẍ1 + (ẋ1 − ẋ2 ) + x1 + (x1 − x2 ) = F (t).
m1 m1 m1 m1
b K3 K2
Mass 2: ẍ2 − (ẋ1 − ẋ2 ) + x2 − (x1 − x2 ) = 0.
m2 m2 m2
A rigid body (without flexibility) that rotates with angular velocity ω under the effect
of a torque T is depicted in Fig. 2.9. It is assumed that no friction exists between the
body and the environment. The directions shown for torque and angular velocity are
defined as positive for this system component. According to Newton’s Second Law
[2], pp. 122:
T = I α, (2.25)
2.1 Mechanical Systems 37
1 2
t
θ= ω dt + θ (0), (2.26)
0
where θ = θ1 −θ2 with θ1 , and θ2 are the angular positions of the spring’s sides 1 and
2 respectively, whereas θ (0) = 0 represents deformation when the spring is neither
compressed nor stretched. According to the direction defined for ω in Fig. 2.10, it is
concluded that the net angular deformation θ is positive when θ1 > θ2 . In the case
of a linear rotative spring, the constitutive function is given by Hooke’s Law:
T = k θ, (2.27)
b
K
I
T (t)
Tb Tb θ˙ θ TK TK θK
I
b
!b T (t)
+1, if ω > 0
T = Tc sign(ω), sign(ω) = , Coulomb friction.
−1, if ω < 0
Example 2.5 A rotative body connected to two walls through a spring and a damper
is shown in Fig. 2.12a. An external torque T (t) is applied to this body. The
damper represents friction between the body and the bearings supporting it, whereas
the spring represents the shaft flexibility. The free-body diagram is depicted in
Fig. 2.12b. The employed nomenclature is defined as:
• θ̇ = dθ
dt , where θ is the body’s angular position.
• ωb = dθ b
dt , where θb is the angular position of the damper’s mobile side.
• θK = dθdtK , where θK is the angular position of the spring’s mobile side.
Use of Fig. 2.12b, and (2.25), (2.27), (2.28), yields:
Notice that torques applied to the body with inertia I that have the same direction
as angular velocity θ̇ , appear with a positive sign in (2.29). If this is not the case,
then a negative sign appears (see TK , for instance). Assuming that all the system
components are connected by rigid joints, then, according to Fig. 2.12b:
2.1 Mechanical Systems 39
θ = −θb = θK . (2.31)
b K 1
θ̈ + θ̇ + θ = T (t). (2.32)
I I I
Notice that this model is identical to that presented in (2.13) for a translational mass-
spring-damper system if mass is replaced by inertia, angular position θ replaces
position xm , and external torque T (t) replaces the external force F (t).
Example 2.6 A simple pendulum is depicted in Fig. 2.13a, where θ stands for the
pendulum angular position and θ̇ = dθ dt . It is assumed that the pendulum mass m
is concentrated in a single point and pendulum rod has a length l with no mass (or
it is negligible compared with mass m). The corresponding free-body diagram is
depicted in Fig. 2.13b. The pendulum can be assumed to be a rotative body with
inertia:
I = ml 2 ,
T (t)
Tb Tb θ˙ θ T g
I
b
!b T (t)
Tg = mgd, d = l sin(θ ),
= mgl sin(θ ). (2.33)
Notice that torques applied to I that have the same direction as angular velocity θ̇
appear affected by a positive sign in (2.34), or a negative sign if this is not the case
(see for instance Tg ). Assuming that all the system components are connected by
rigid joints, then, according to Fig. 2.13b, it is found that:
θ̇ = −ωb . (2.35)
θ = −θb . (2.36)
Notice that this is a nonlinear differential equation, because of the function sin(θ ).
In Sect. 7.3, Chap. 7, it is explained how this kind of differential equation can be
studied. Moreover, in Chaps. 13, 15 and 16 it is shown how to design controllers for
systems represented by nonlinear differential equations.
Example 2.7 Two rotative bodies connected by a spring are shown in Fig. 2.14a.
An external torque T (t) is applied to the body on the left. The mechanical system
2.1 Mechanical Systems 41
b1 K b2
I1 I2
T (t)
!1 T1 !2 T3 T3 !4 T4 T6 T6
I1 I2
T1 T (t) !3 T4 !5 !6
in Fig. 2.14a can be interpreted as a motor (body on the left), which moves a load
(body on the right) through the motor shaft, exhibiting flexibility. This flexibility
is not intentionally included, but is undesired shaft behavior arising from the finite
stiffness of the material in which the motor shaft is made. In such a situation, it is
very important to take into account this flexibility to study its effect on the closed-
loop system performance. According to sign definitions shown in Figs. 2.9, 2.10,
and 2.11, the corresponding free-body diagram is depicted in Fig. 2.14b. The
employed nomenclature is defined as:
• ω2 = dθ 2
dt , where θ2 is the body 1 angular position.
dθ5
• ω5 = dt , where θ5 is the body 2 angular position.
• ω1 = dθ 1
dt , where θ1 is the angular position of the mobile side of the damper
connected to body 1.
• ω6 = dθ 6
dt , where θ6 is the angular position of the mobile side of the damper
connected to body 2.
• ω3 = dθ dθ4
dt and ω4 = dt , where θ3 and θ4 are the angular positions of the spring
3
sides.
Use of Fig. 2.14b, and (2.25), (2.27), (2.28), yields:
where the last expression is obtained according to the paragraph after (2.26). Notice
that in equations (2.37) and (2.38), torques that have the same direction as ω2 and
42 2 Physical System Modeling
ω5 appear to be affected by a positive sign and a negative sign if this is not the case.
Assuming that all of the system components are connected by rigid joints then,
according to Fig. 2.14b:
ω2 = −ω1 = ω3 , ω5 = ω6 = ω4 . (2.39)
θ2 = −θ1 = θ3 , θ5 = θ6 = θ4 . (2.40)
Finally, using (2.39) and (2.40), it is found that the mathematical model is given by
the following differential equations, which have to be solved simultaneously:
There are three basic phenomena in electrical systems: inductance, capacitance, and
resistance. An electric current i flowing through an inductor under the effect of
a voltage v that is applied at its terminals is depicted in Fig. 2.15. It is assumed
that there are no parasitic effects, i.e., the inductor has neither internal electrical
resistance nor capacitance. The directions shown for electric current and voltage are
defined as positive for this system component.
v
2.2 Electrical Systems 43
The magnetic flux linkage of the inductor is given as the product of the electric
current i and a positive constant L, known as inductance, depending on the
geometric shape of the conductor:
λ = Li. (2.41)
According to Faraday’s Law, [2], pp. 606, [3], pp. 325, flux linkage determines the
voltage at the inductor terminals:
dλ di
v= =L . (2.42)
dt dt
One capacitor is formed wherever two electrical conductors, with different
electrical potentials and with an insulator material between them, are placed close
enough to generate an electric field between them. These electrical conductors are
called plates. An electric current i flowing through a capacitor under the effect of a
voltage v applied at its terminals is shown in Fig. 2.16. It is assumed that no parasitic
effects exist, i.e., there is no leakage current between the capacitor plates and there
are no inductive effects due to capacitor plates. Because of the difference in potential
between the plates, an electric charge is stored. It is common to use letter q to
designate such an electric charge, which is the same, but has the opposite sign, at
each plate. Capacitance C is a positive constant defined as a means of quantifying
how much electric charge can be stored in a capacitor. The constitutive function of
a capacitor is given as [3], pp. 121:
q
C= . (2.43)
v
Capacitance C depends on the geometric form of plates, the distance between them
and the dielectric properties of the insulator placed between them. Recall that the
electric current is defined as:
dq
i= . (2.44)
dt
+ –
v
44 2 Physical System Modeling
+ –
v = iR, (2.45)
As i = q̇, then Ri = RC dv 0
dt ; hence:
vi = RC v̇0 + v0 .
1 1
v̇0 + v0 = vi .
RC RC
Example 2.9 Consider the series RC circuit shown in Fig. 2.18b. Using KVL:
q
vi = + v0 , v0 = Ri.
C
2.2 Electrical Systems 45
R1
L R2
1
v̇i = i + v̇0 ,
C
1
= v0 + v̇0 ,
RC
where i = q̇ and v0 = Ri have been used. Hence, the dynamic model is given as:
1
v̇0 + v0 = v̇i .
RC
Example 2.10 Consider the series RL circuit shown in Fig. 2.18c. Using KVL:
di
vi = v0 + Ri, v0 = L .
dt
Differentiating once with respect to time:
di
v̇i = v̇0 + R ,
dt
R
= v̇0 + v0 ,
L
46 2 Physical System Modeling
where v0 = L di
dt has been used. Hence, the dynamic model is given as:
R
v̇0 + v0 = v̇i .
L
Example 2.11 Consider the series-parallel RC circuit shown in Fig. 2.18d. Define
i1 , i2 , and i as the electric currents through R1 , C, and R2 respectively. Hence,
Kirchhoff’s current law (KCL) can be used to obtain:
i = i 1 + i2 ,
vc dq
= + ,
R1 dt
q dq
= + , (2.46)
R1 C dt
1
R2 q(0) 1 R1 + R2
Q(s) = Vi (s) + , a= , (2.47)
s+a s+a C R1 R2
where q(0) stands for the initial charge in the capacitor. On the other hand:
v0 = R2 i,
q dq
= R2 + ,
R1 C dt
where (2.46) has been used. Arranging and using the Laplace transform:
1
R2 q(0)
Q(s) = V0 (s) + . (2.48)
s+ 1
R1 C s+ 1
R1 C
+
vi R
—
+ vC — + vL —
C L
+ +
vi i R vR
— —
s+b vc (0) 1
V0 (s) = Vi (s) − , b= , (2.49)
s+a s+a R1 C
q(0)
where vc (0) = C represents the initial voltage at the capacitor. Notice that:
a > b > 0.
vi = vL + vR + vC ,
t
q
vC = , q = i(r)dr, if q(0) = 0, (2.50)
C 0
dλ
vL = , λ = Li, (2.51)
dt
dq
vR = iR, i= . (2.52)
dt
Notice that the electric current flowing through all of the circuit components is the
same. Hence:
48 2 Physical System Modeling
d 2q dq 1
vi = L 2
+R + q, (2.53)
dt dt C
or, differentiating once with respect to time:
dvi d 2i di 1
= L 2 + R + i. (2.54)
dt dt dt C
The corresponding mathematical model is represented by either (2.53) or (2.54).
It is observed from (2.52) that there exists a (linear) algebraic relation between
voltage and current in a resistance, i.e., Ohm’s Law vR = iR. Also notice that the
electric resistance R is the constant relating electric current and voltage viR = R.
Because of this fact, it is natural to wonder whether similar relations might exist for
electric current and voltage in an inductor and in a capacitor. However, from (2.50)
and (2.51) it is clear that some mathematical artifice has to be employed, because
such relations involve differentiation and integration. The mathematical artifice is
the Laplace transform as it possesses the following properties:
t
dx 1
L = sX(s), L x(r)dr = X(s), if x(0)=0, (2.55)
dt 0 s
where X(s) stands for the Laplace transform of x(t), i.e., L{x(t)} = X(s). Thus,
using (2.50), (2.51), and the Laplace transform, and assuming that all of the initial
conditions are zero, yield:
1
VC (s) = I (s),
sC
VL (s) = sLI (s),
where L{vC (t)} = VC (s), L{vL (t)} = VL (s) and L{i(t)} = I (s). The above
expressions represent the algebraic relations between electric current and voltage in
an inductor and a capacitor. The factors relating these variables are called impedance
which is represented as:
V (s)
Z(s) = . (2.56)
I (s)
VL (s)
ZL (s) = = sL, (2.57)
I (s)
VC (s) 1
ZC (s) = = . (2.58)
I (s) sC
2.2 Electrical Systems 49
Then, using the Laplace transform and the respective impedances, it is possible to
write the mathematical model in (2.54) as:
1
Vi (s) = sLI (s) + RI (s) + I (s),
sC
Vi (s) = ZL (s)I (s) + RI (s) + ZC (s)I (s),
Vi (s) = (ZL (s) + R + ZC (s))I (s),
which motivates the definition of the series circuit equivalent impedance as:
ii L C R
ii L C R v
iL iC iR
–
ii = iL + iR + iC ,
t
dv
q = vC, q = iC (r)dr, if q(0) = 0 ⇒ iC = C , (2.60)
0 dt
t
1 diL
iL = v(r)dr, v = L , (2.61)
L 0 dt
v
iR = . (2.62)
R
Notice that the voltage is the same in all the circuit components. Hence, the
mathematical model is given as:
t
1 v dv
ii = v(r)dr + +C (2.63)
L 0 R dt
Using the Laplace transform in (2.60), (2.61), (see (2.55)) and assuming that all of
the initial conditions are zero, yields:
where L{iC (t)} = IC (s), L{iL (t)} = IL (s) and L{v(t)} = V (s). The factor relating
the Laplace transforms of electric current and voltage in a circuit element is called
admittance and is represented as:
I (s)
Y (s) = . (2.64)
V (s)
IC (s)
YC (s) = = sC. (2.66)
V (s)
Then, using the Laplace transform and the definition of admittance, the mathemati-
cal model in (2.63) can be written as:
1 1
Ii (s) = V (s) + V (s) + sCV (s),
sL R
2.2 Electrical Systems 51
1
Ii (s) = YL (s)V (s) + V (s) + YC (s)V (s),
R
1
Ii (s) = (YL (s) + + YC (s))V (s),
R
which motivates the definition of the parallel circuit equivalent admittance as:
1
YT (s) = YL (s) + + YC (s),
R
1 1 Ii (s)
YT (s) = + + sC, YT (s) = . (2.67)
sL R V (s)
This proves the following important property of parallel connected electric circuits:
Property 2.4 The parallel circuit equivalent admittance is the addition of admit-
tances of all of the parallel connected circuit components.
The admittance concept is very important as a tool to model and to analyze
electric circuits in electrical engineering. This means that expressions in (2.67) also
represent the mathematical model of the circuit in Fig. 2.20a. From definitions of
impedance and admittance in (2.56) and (2.64), it is clear that admittance is the
inverse of impedance, i.e.:
1
Y (s) = (2.68)
Z(s)
1 1 1 1 1
= + + , YT (s) = ,
ZT (s) ZL (s) R ZC (s) ZT (s)
where ZT (s) stands for the equivalent impedance of the parallel connected circuit
shown in Fig. 2.20a. It is stressed that no relation exists between ZT (s) and Zt (s)
defined in (2.59) as the equivalent impedance of the series connected circuit shown
in Fig. 2.19a. In the case when n circuit elements are connected in parallel, it is
possible to write:
1 1 1 1
= + + ··· + . (2.69)
ZT (s) Z1 (s) Z2 (s) Zn (s)
When only two circuit elements are connected in parallel, it is easy to verify that the
previous expression reduces to:
Z1 (s)Z2 (s)
ZT (s) = . (2.70)
Z1 (s) + Z2 (s)
52 2 Physical System Modeling
Vi(s) C R Vo(s)
– –
Example 2.14 Consider the electric circuit shown in Fig. 2.21. If Vo (s) is the
voltage at the terminals of the parallel connected circuit elements and Zp (s) is the
total impedance of these parallel connected circuit elements, it can be written as
follows:
Vo (s)
Zp (s) = , (2.71)
I (s)
1
R sC R
Zp (s) = = ,
R+ 1
sC
RCs + 1
where (2.70) has been used to compute equivalent impedance of the parallel
connected circuit elements. Notice that I (s) is the total electric current flowing
through the parallel connected circuit elements. On the other hand, if Zsp (s) is
the equivalent impedance of the series-parallel circuit, i.e., impedance measured
at terminals where the voltage Vi (s) is applied, then it can be written as follows:
Vi (s)
Zsp (s) = , (2.72)
I (s)
1 R
Zsp (s) = R + + ,
sC RCs + 1
The fact that the equivalent impedance of series connected circuit elements is
computed by adding the impedances of all of the series connected elements whereas
impedance of the two parallel connected elements is given in (2.71) has been taken
into account. Use of (2.71) and (2.72) yields:
R
Vo (s) Zp (s) RCs+1
= GT (s) = = ,
Vi (s) Zsp (s) R+ sC + RCs+1
1 R
and, thus:
Vo (s) Ts
= GT (s) = 2 2 , T = RC. (2.73)
Vi (s) T s + 3T s + 1
Notice that GT (s) is not an impedance as it is given as the ratio of two impedances
or the ratio of two voltages.
2.2 Electrical Systems 53
+ +
V1(s) I1 R I2 R I3 R V2(s)
– –
Example 2.15 Consider the electric circuit depicted in Fig. 2.22. Ratio F (s) =
V2 (s)
V1 (s) is computed in the following. Define three closed paths (or meshes) as shown
in Fig. 2.22. It is assumed that the electric currents I1 (s), I2 (s) and I3 (s) flow around
each mesh. The KVL can be used using the following criterion:
Criterion 2.1 Consider the i−th mesh. The algebraic sum of voltages at the circuit
elements in the i−th mesh equals zero. Voltage at each circuit element is computed
as the product of its impedance and the algebraic sum of the electric currents I1 (s),
I2 (s) or I3 (s), flowing through that circuit element. Let Ii (s) be the electric current
defining the i−th mesh. If I1 (s), I2 (s) or I3 (s) has the same direction as Ii (s) in
that circuit element then I1 (s), I2 (s) or I3 (s), is affected by a “+” whereas a “−”
affects those electric currents with the opposite direction. A coefficient equal to zero
affects the electric currents not flowing through that circuit element. The value of a
voltage source is affected by a “+” if Ii (s) flows through that voltage source from
terminal “+” to terminal “−”. A “−” is used if this is not the case.
This criterion constitutes the basis of the so-called mesh analysis method
employed for circuit analysis in electrical engineering. The reader is referred to
[9] and [8] for a deeper explanation of this method. The use of this criterion in each
one of the meshes shown in Fig. 2.22 yields:
1
I1 (s) + (I1 (s) − I2 (s))R = V1 (s), (2.74)
sC
1
(I2 (s) − I1 (s))R + I2 (s) + (I2 (s) − I3 (s))R = 0,
sC
1
(I3 (s) − I2 (s))R + I3 (s) + V2 (s) = 0, V2 (s) = RI3 (s).
sC
From the third expression in (2.74) the following is obtained:
1 1
I2 (s)R = R+ V2 (s) + V2 (s). (2.75)
R sC
Replacing this and I3 (s) = V2R(s) in the second expression in (2.74), a new
expression is obtained which allows I1 (s) to be computed as a function of V2 (s).
Replacing this value of I1 (s) and I2 (s) given in (2.75) in the first expression
54 2 Physical System Modeling
V2 (s) R3C 3s 3
= 3 3 3 = F (s). (2.76)
V1 (s) R C s + 6R 2 C 2 s 2 + 5RCs + 1
2.3 Transformers
In this book, the term transformers is used to designate those components that
manipulate the system variables in such a way that energy is conserved, i.e., they
neither store nor dissipate energy; energy simply flows through them.
i1
+ n1
v1
–
2.3 Transformers 55
λ1 = L1 i1 + M12 i2 , (2.77)
λ2 = M21 i1 + L2 i2 , (2.78)
where L1 , L2 , are the inductances of inductors 1 and 2, whereas M12 and M21 are the
mutual inductances between the two circuits. It is always true that M12 = M21 = M.
The positive signs in terms with factors M12 and M21 in the previous expressions
are due to the fact that the direction of electric currents defined as positives enter
wounds through its sides labeled with a dot (see Sect. D.2 in Appendix D). Solving
for i2 in (2.77) and replacing it in (2.78) yield:
L2 L 1 L2
λ2 = λ1 + M − i1 . (2.79)
M M
M
k=√ .
L1 L2
If both circuits are not coupled at all, then k = 0, but k = 1 if both circuits
are completely coupled such that flux linkage in inductor 1 equals flux linkage in
inductor 2. This case is well approximated in practice if the core of both inductors
is the same and it is made in a ferromagnetic material with √ a large magnetic
permeability μ. Assuming that this is the case, i.e., M = L1 L2 , then (2.79)
becomes:
L2
λ2 = λ1 . (2.80)
L1
On the other hand, from (2.78) and (2.77), using M12 = M21 = M, and (2.80), it is
found that:
λ2 Mi1 + L2 i2 L2
= = .
λ1 L1 i1 + Mi2 L1
n21 A
L1 = μ ,
l
n22 A
L2 = μ ,
l
where A, l, and μ are the core area, the core mean length, and the core magnetic
permeability respectively. Hence:
L1 n1
= . (2.82)
L2 n2
This means that the power at both ports is the same, because:
n2 n1
w2 = v2 i2 = v1 i1 = v1 i1 = w1 .
n1 n2
Two gear wheels with radii r1 and r2 are depicted in Fig. 2.24. Wheel 1 has radius
r1 , n1 teeth, and it rotates at an angular velocity ω1 under the effect of an applied
T1 T2
θ1 s θ2
r1 r2 !2
!1
n1
n2
F
2.3 Transformers 57
s = θ1 r1 , s = θ2 r2 , (2.83)
θ1 r1 = θ2 r2 . (2.84)
It is also known that the tooth width α is the same in both wheels, which is
necessary for teeth to engage. This implies that:
p1 = αn1 , p2 = αn2 ,
p1 = 2π r1 , p2 = 2π r2 .
On the other hand, force F applied at the point where the wheels are in contact is
the same for both wheels. This force satisfies:
T1 = F r1 , T2 = F r 2 ,
Using (2.87) and (2.86), it is found that the mechanical power, w, is the same on
both ports, i.e.:
n1 n2
w1 = T1 ω1 = T2 ω2 = T2 ω2 = w2 .
n2 n1
Consider the rack and pinion system depicted in Fig. 2.25. Port 1 is defined in terms
of rotative variables, angular velocity ω1 and torque T1 , whereas port 2 is defined in
terms of translational variables, velocity v2 and force F2 . By definition, torque T1
and force F2 are related as:
T1 = rF2 , (2.88)
where r is the pinion radius, whereas angular velocity ω1 and velocity v2 are related
as (see (2.83)):
v2 = rω1 . (2.89)
1
w1 = T1 ω1 = rF2 v2 = F2 v2 = w2 .
r
The directions of variables shown in Fig. 2.25 are defined as positive.
!1
r
T1
F2 v2
2.4 Converters
F̄ = il ū × B̄, (2.90)
– v+
L
i
– +
E
F
B
θ
N S
F
60 2 Physical System Modeling
where ū is a unitary vector defined in the same direction as the electric current. A
bar is used on the top of variables to indicate that they represent vectors. Symbol
“×” stands for the standard vector product. Hence, under the conditions depicted in
Fig. 2.26b, i.e., when θ = 90◦ , the force exerted by the magnetic field on the left
and right sides of the loop is given as:
F = ilB.
This means that the following torque is produced on the loop axis:
l
T = 2 F = iBl 2 = iBA.
2
Notice that lF /2 is torque because of the force exerted on each loop side and there
are two applied forces on the loop with the same magnitude: one is applied on the
left side and another on the right side. The reader can verify that, according to (2.90),
forces on the rear and the front sides of the loop do not produce any torque. This
means that the loop rotates at an angular velocity ω = −θ̇ , i.e., in the opposite
direction defined for θ in Fig. 2.26b where θ is the angle between the direction of
the magnetic field and a line orthogonal to the plane defined by the loop. According
to Faraday’s Law [3], pp. 325, this induces a voltage v at the loop terminals that is
given according to (2.42), i.e.:
dλ
v= ,
dt
where λ is the flux linkage in the loop and is given as:
λ = BA cos(θ ).
Notice that, according to Lenz’s Law [3], pp. 327, the induced voltage v has a
polarity (see Fig. 2.26a) that is opposite to the change in electric current i. Now,
assume that several loops are employed, each one of them having a different
tilt angle, such that a mechanical commutator connects only that loop for which
θ = 90◦ . Then, the voltage at the commutator terminals is given as:
v = BAω.
This is a description of a permanent magnet brushed direct current (DC) motor. Port
1 is represented by electrical variables, i.e., voltage v and electric current i, whereas
port 2 is represented by mechanical variables, i.e., angular velocity ω and torque T .
The relationship among these port variables is given as:
2.4 Converters 61
v = BAω, (2.91)
1
i= T.
BA
If it is assumed that a torque T is applied at port 2 at an angular velocity ω, producing
a voltage v and an electric current i at port 1, then a DC generator is obtained and
both expressions in (2.91) are still valid. Notice that in both cases power at both
ports is the same:
1
w1 = vi = T BAω = T ω = w2 .
BA
The expressions in (2.91) can be written in a more general manner as:
v = ke ω, (2.92)
T = km i, (2.93)
where ke > 0 and km > 0 are known as the counter-electromotive force constant and
the torque constant respectively. These constants are introduced to take into account
the fact that several loops are usually series connected and some other variants in
the construction of practical DC motors and generators. The fact that power at both
ports is the same:
1
w1 = vi = ke ω T = T ω = w2 ,
km
2.4.2 Electromagnet
M = Ni. (2.94)
M = Rλ, (2.95)
62 2 Physical System Modeling
where λ represents the magnetic flux in the magnetic circuit and the reluctance is
given as:
l 2x 2x
R= + ≈ , μi
μa , (2.96)
μi A μa A μa A
where μi and μa stand for the magnetic permeability of iron and air respectively,
whereas l and x represent the magnetic circuit length and the air gap respectively.
The flux linkage is defined as ψ = Nλ. According to Faraday’s Law v = d(N λ)
dt .
Using this and (2.94), the power w supplied by the electric circuit is given as:
M
w = iv = N λ̇ = M λ̇ = Ė,
N
where E is the energy supplied by the electric circuit, which is stored in the magnetic
circuit as:
t λ(t)
dλ
E= M dt = Mdλ.
0 dt λ(0)
if λ(0) = 0. Notice that this represents the energy stored in the reluctance, i.e.,
reluctance stores energy. This must be stressed, as the common belief is that
reluctance is the magnetic analog of electric resistance, which is not true because
electric resistance dissipates energy and reluctance stores energy.
The stored energy E also represents the mechanical work performed by an
external force F to create a gap of width x. This means that F is applied in the
opposite direction to the magnetic force f , i.e., F = −f and:
2.4 Converters 63
x x ∂E
E= F ds = − f ds, f =− .
0 0 ∂x
Using (2.97):
1 ∂R
f = − λ2 .
2 ∂x
This and (2.96) imply that the magnetic force is produced by the reluctance and it is
applied in the sense where the reluctance, energy, and gap width decrease.
On the other hand, the inductance L(x) depends on the bar position x, as
explained in the following. According to (2.41), the flux linkage in the inductor is
given as the product of inductance and the electric current, i.e., ψ = L(x)i = N λ.
Moreover, according to (2.96) and (2.95), if x decreases, flux λ increases if the
electric current is kept constant. According to Nλ = L(x)i, an increase in flux λ
only can be produced by an increase in inductance L(x), i.e., inductance increases
if x decreases.
From (2.97) and (2.95), it follows that:
1 1 ψ 1 1
E= Mλ = Ni = iψ = L(x)i 2 .
2 2 N 2 2
Finally, according to f = − ∂E
∂x :
1 ∂L(x) 2
f =− i . (2.98)
2 ∂x
It is stressed that f in (2.98) is applied in the sense where the air gap x decreases.
The above-mentioned ideas are based on [10].
Example 2.16 Two rotative bodies connected by a rack are shown in Fig. 2.28a.
An external torque T (t) is applied to the body at the left. Hence, it may be
assumed that the body at the left is a motor that transmits movement to the body
at the right. Following the sign definitions shown in Figs. 2.1, 2.9, 2.3, and 2.25,
the free-body diagrams shown in Figs. 2.28b and c are obtained. Figure 2.28b
shows the connection of both rotative bodies by means of two rack and pinion
systems, whereas Fig. 2.28c shows the free-body diagram of each rotative body.1
The employed nomenclature is defined as follows:
dxm
• vm = dt , where xm is the position of the rack with the mass m.
dθ1
• ω1 = dt , where θ1 is the angular position of the rotative body 1.
1 Ina rack and pinion system, Newton’s Third Law stating that to every action (force or torque),
there is a corresponding reaction (force or torque) must be applied at only one port, as force
or torque in the other port is simply a consequence of what happens in the first port. Also, see
Example 2.17.
64 2 Physical System Modeling
rack
T2
!1
r r
T1
F1 F2 F2
F1 w2
m
v1 vm v2
Fb
vb
Fb
b1 T b1 T1 !1
I1
! b1 T b1 T(t)
T2 !2 T b2
b2
I2
T b2 ! b2
• ω2 = dθ 2
dt , where θ2 is the angular position of the rotative body 2.
• v1 is the rack translational velocity produced as a consequence that body 1 rotates
with angular velocity ω1 .
• v2 is the rack translational velocity produced as a consequence that body 2 rotates
at angular velocity ω2 .
• ωb1 = dθdtb1 , where θb1 is the angular position of the mobile side of the damper
connected to body 1 (friction between body 1 and its supports).
2.4 Converters 65
• ωb2 = dθdtb2 , where θb2 is the angular position of the mobile side of the damper
connected to body 2 (friction between body 2 and its supports).
• vb = dx b
dt , where xb is the position of the mobile side of the damper connected to
rack m. This damper represents the friction between rack and floor.
Using Figs. 2.28b, c, and (2.1), (2.25), (2.4), (2.28), (2.88), (2.89), the following is
obtained:
dω1
Inertia 1: I1 = T (t) + T1 − Tb1 , (2.99)
dt
dω2
Inertia 2: I2 = T2 − Tb2 , (2.100)
dt
dvm
Mass: m = F1 − F2 + Fb , (2.101)
dt
Left damper: b1 ωb1 = Tb1 ,
Right damper: b2 ωb2 = Tb2 ,
Central damper: bvb = Fb ,
Rack and pinion at the left: T1 = rF1 , v1 = rω1 , (2.102)
Rack and pinion at the right: T2 = rF2 , v2 = rω2 . (2.103)
Notice that forces with the same direction as ω1 , ω2 and vm are affected by a positive
sign in (2.99), (2.100), (2.101), or a negative sign if this is not the case. Assuming
that all of the system components are connected by rigid joints then, according to
Figs. 2.28b and c, it is found that:
xm = −xb , (2.106)
θ1 = θb1 , θ2 = θb2 .
dω1
Inertia 1: I1 = T (t) + rF1 − b1 ωb1 , (2.107)
dt
66 2 Physical System Modeling
dω2
Inertia 2: I2 = rF2 − b2 ωb2 , (2.108)
dt
dvm
Mass: m = F1 − F2 + bvb . (2.109)
dt
Recall that v1 = −v2 . Then, (2.102) and (2.103) can be used to find that ω1 = −ω2 .
Using this result, (2.105), and subtracting (2.108) to (2.107):
dω1
(I1 + I2 ) = T (t) + r(F1 − F2 ) − (b1 + b2 )ω1 . (2.110)
dt
On the other hand, employing −vm = v1 = rω1 = vb , (2.109) can be written as:
dω1
−mr = F1 − F2 − bvm .
dt
Solving for F1 − F2 in this expression and replacing it in (2.110), the following is
finally found:
dω1
(I1 + I2 + mr 2 ) = T (t) − (b1 + b2 + r 2 b)ω1 .
dt
This differential equation represents the mathematical model of the system in
Fig. 2.28a. Contrary to several previous examples, in this case it is possible to
combine three differential equations in a single differential equation. This is because
the three variables ω1 , ω2 are vm are linearly dependent as they are related through
the algebraic equation −vm = rω1 = −rω2 . Also notice how the radii of the pinions
modify (i) the rack mass to express its effect on the equivalent inertia on the axis of
body 1, and (ii) friction between the rack and floor to express the equivalent friction
on the axis of body 1.
Example 2.17 Two rotative bodies connected through a gear reducer are shown in
Fig. 2.29a. The external torque T (t) is applied t the body at the left. This mechanical
system can be seen as an electric motor (body at the left) transmitting movement
to a mechanical load (body at the right) through a gear reducer. According to the
sign definitions shown in Figs. 2.9, 2.11, and 2.24, the free-body diagram shown in
Fig. 2.29b is obtained.2 The employed nomenclature is defined as follows:
• ω = dθ
dt , where θ is the angular position of body 1.
• ω4 = dθ 4
dt , where θ4 is the angular position of body 2.
dθb1
• ωb1 = dt , where θb1 is the angular position of the mobile side of the damper
connected to body 1.
2 Ina gear reducer, Newton’s Third Law, stating that to every action (torque) there is a correspond-
ing reaction (torque), must be applied only at one port, as the torque at one port is a consequence
of the torque at the other port. Also see Example 2.16.
2.4 Converters 67
b 1 T(t) n1
I1 b2
I2
n2
T b1 T b1 ! T n1 ! n1
I1 T n2 T3 !4 T b2 T b2
! b1 T(t) I2
! n2 ! b2
• ωb2 = dθdtb2 , where θb2 is the angular position of the mobile side of the damper
connected to body 2.
• ωn1 and ωn2 are the angular velocities of the gear wheels that result from the
movement of bodies 1 and 2.
• Tn1 and Tn2 are the torques appearing on gear wheels as consequences of the
movement of bodies 1 and 2.
Using Fig. 2.29b, and (2.25), (2.28), (2.86), (2.87), the following expressions are
obtained:
Last expression is due to the fact that, according to Newton’s Third Law, an action
of A on B produces a reaction from B on A. Notice that in (2.111) and (2.112)
torques that have the same direction as ω and ω4 appear with a positive sign and a
negative sign if this is not the case. Assuming that all of the system elements are
connected by rigid joints, then from Fig. 2.29b, it is found that:
Thus, using (2.114), (2.115), (2.111), and (2.112), the following can be written:
n1
Body 1: I1 ω̇ = T (t) − b1 ω − T3 , (2.116)
n2
Body 2: I2 ω̇4 = T3 − b2 θ̇4 . (2.117)
On the other hand, from (2.113) and (2.114) it is found that ω = nn21 ω4 . Using this,
solving for T3 in (2.117), replacing it in (2.116), and rearranging terms:
2
2
n2 n2 n2
I2 + I1 θ̈4 + b2 + b1 θ̇4 = T (t). (2.118)
n1 n1 n1
Notice that both differential equations in (2.116) and (2.117) have been combined
in a single differential equation. This is possible because variables ω and ω4 are
linearly dependent, i.e., they are related by the algebraic equation ω = nn21 ω4 . The
above-mentioned differential equation represents the mathematical model of the
system: if T (t) is known, then θ4 , i.e., the position of body 2, can be computed
solving this differential equation.
Example 2.18 In Fig. 2.30a, the mechanism in Fig. 2.28a (in Example 2.16) is
shown again, but now it is assumed that the rack is flexible. This flexibility is not
intentional, but it is an undesired problem that appears because of the finite stiffness
of the steel of which the rack is made. The mathematical model in this case can
be obtained taking advantage of the procedure in Example 2.16, i.e., to continue
from (2.107), (2.108), (2.109), which are rewritten here for ease of reference:
dω1
Inertia 1: I1 = T (t) + rF1 − b1 ωb1 ,
dt
dω2
Inertia 2: I2 = rF2 − b2 ωb2 ,
dt
dvm
Mass: m = F1 − F2 + bvb .
dt
However, it must be considered now that, according to Fig. 2.30b and the sign
definitions shown in Fig. 2.2 and (2.3):
F1 = K1 (xA − xB ), F2 = K2 (xC − xD ),
2.4 Converters 69
xm
I1 K1 K2 I2
m
A B C D
v AB
F1 F1
vA K1 vB
v CD
F2 F2
vC K2 vD
with:
• vA = dxdt and vB =
A dxB
dt , where xA and xB are the positions of the sides of the
spring on the left.
• vC = dxdt and vD =
C dxD
dt , where xC and xD are the positions of the sides of the
spring on the right.
Using this and (2.104), (2.105), the following is found:
dω1
Inertia 1: I1 = T (t) + rK1 (xA − xB ) − b1 ω1 , (2.119)
dt
dω2
Inertia 2: I2 = rK2 (xC − xD ) − b2 ω2 . (2.120)
dt
Mass: mẍm = K1 (xA − xB ) − K2 (xC − xD ) − bẋm . (2.121)
On the other hand, according to (2.102), (2.103), (2.104), (2.106) and assuming
that all the system components are connected by rigid joints:
where θ1 and θ2 are angular positions of gear wheels 1 and 2 defined according to
Fig. 2.28b. Replacing (2.122) in (2.119), (2.120), and (2.121):
b1 n1
I1 K b2
I2
T(t)
n2
T n2 !B
K
!A T n2
The mathematical model is given by these three differential equations, which must
be solved simultaneously. In this case, it is not possible to combine these three
differential equations in a single differential equation because variables θ1 , θ2 , and
xm are not linearly dependent. This means that there is no algebraic expression
relating these three variables. Notice that, from the modeling point of view, this
is the effect introduced by the springs considered in this example. Compare this
mathematical model with that obtained in Example 2.16.
Example 2.19 Two rotative bodies connected through a gear reducer and a spring
are depicted in Fig. 2.31a. The external torque T (t) is applied to the body on the
left. This example can be seen as a motor (body on the left) that transmits movement
to a mechanical load (body on the right) through a gear reducer that exhibits teeth
flexibility. This flexibility is an undesired behavior that, however, appears in practice
because of the finite stiffness of steel, the material in which the gear reducer is
made. This modeling problem can be solved taking advantage of the procedure in
Example 2.17 which has been used to model the mechanical system in Fig. 2.29a.
We can go back to expressions in (2.116) and (2.117), which are rewritten here for
ease of reference:
n1
Body 1: I1 ω̇ = T (t) − b1 ω − Tn2 , (2.123)
n2
Body 2: I2 ω̇4 = Tn2 − b2 θ̇4 , (2.124)
Tn2 = K(θA − θB ),
2.4 Converters 71
where ωA = θ̇A and ωB = θ̇B with θA and θB , the angular position of both sides
of the spring. On the other hand, according to (2.113), it is found that θ = nn21 θA ,
because ωA = −ωn2 and ωn1 = −θ , where θ and θA are the angular positions
of body 1 and the side of the spring connected to gear wheel 2 (see Fig. 2.31b).
Also notice that θB = θ4 . Replacing the above-mentioned expressions in (2.123)
and (2.124), it is found that:
n1 n1
Body 1: I1 θ̈ + b1 θ̇ + K θ − θ4 = T (t),
n2 n2
n1
Body 2: I2 θ̈4 + b2 θ̇4 − K θ − θ4 = 0.
n2
Example 2.20 (Taken from [6], pp. 122) An electro-mechanical system is shown in
Fig. 2.32. There is a permanent magnet brushed DC motor that is used to actuate on
a body with the mass M through a gear reducer and a rack and pinion system. The
body M moves on a horizontal plane; hence, it is not necessary to consider the effect
of gravity. According to the sign definitions shown in Figs. 2.9, 2.1, 2.11, 2.3, 2.24,
2.25, 2.26, the free-body diagrams in Fig. 2.33 are obtained. The electrical DC motor
rack
72 2 Physical System Modeling
n2 b2
M
b3
b1 T b1 T T1 !1 n 1
Im T2 !2
T b1 ! b1 θm
n2
!P !P
T b2 T b2
r
IP
! b2 TP
T2 v
F
M x˙
F b3
v b3
F b3
2.4 Converters 73
components are analyzed in Fig. 2.33a. The mechanical DC motor components and
the gear reducer are analyzed in Fig. 2.33b. The rack and pinion system components
are analyzed in Fig. 2.33c.3 Notice that friction at motor bearings, friction at pinion
bearings, and friction between body M and its supports (or the floor) are considered.
The nomenclature employed is defined as follows:
• θ̇m = dθdtm , where θm is the motor angular position.
• ωP = dθdtP , where θP is the pinion angular position.
• ẋ = dx
dt , where x is the body M position.
• ωb1 = dθdtb1 , where θb1 is the angular position of the mobile side of the damper
connected to the motor.
• ωb2 = dθdtb2 , where θb2 is the angular position of the mobile side of the damper
connected to the pinion.
• vb3 = dxdtb3 , where xb3 is the position of the mobile side of the damper connected
to body M.
• ω1 and ω2 are the angular velocities of the gear wheels that result from the
movement of the motor and the pinion.
• u is the voltage applied at the motor terminals and i is the electric current flowing
through the motor.
• F , TP , and v are the force, torque, and translational velocity produced at the rack
and pinion system as a result of movement of the pinion and mass M.
Using Fig. 2.33, and (2.1), (2.25), (2.4), (2.28), (2.86), (2.87), (2.88), (2.89), the
following expressions are obtained:
Notice that, in (2.125), (2.126), and (2.127), forces that have the same direction as
θ̇m , ωP and ẋ appear affected by a positive sign and a negative sign if this is not the
case. Assuming that all the system components are connected by rigid joints, then,
according to Fig. 2.33, it is found that:
v = ẋ = vb3 , (2.130)
θ̇m = ωb1 = −ω1 , ω2 = ωb2 = −ωP , (2.131)
x = xb3 , (2.132)
θm = θb1 . (2.133)
On the other hand, according to (2.128), (2.129), (2.130), and (2.131), it is found
that θ̇m = nn12r ẋ. Using this, solving for T2 from (2.135) and replacing it in (2.134):
n2 n2 n1
Im ẍ + b1 ẋ = T − [IP ω̇P + b2 ωP − rF ] . (2.137)
n1 r n1 r n2
From (2.129) and (2.130), it is obtained that ẋ = rωP . Using this in (2.137) and
replacing F from (2.136):
n2 n2 n1 n1 n1 n1
Im ẍ + b1 ẋ = T − IP + rM ẍ − b2 + rb3 ẋ.
n1 r n1 r n2 r n2 n2 r n2
On the other hand, applying KVL (see Example 2.12) to the electric circuit shown
in Fig. 2.33a yields:
di
L + Ri + eb = u. (2.139)
dt
n2
From (2.92), (2.93) and θ̇m = n1 r ẋ, it is found that the induced voltage and the
generated torque are given as:
n2
eb = ke θ̇m = ke ẋ, T = km i.
n1 r
Using this result, (2.139) and (2.138), it is finally found that the mathematical
model is given by the following two differential equations, which have to be solved
simultaneously:
di n2
+ Ri + ke ẋ = u, (2.140)
L
dt n1 r
n2 2 1 n2 2 1 n2
Im + IP 2 + M ẍ + b1 + b2 2 + b3 ẋ = km i.
n1 r r n1 r r n1 r
(2.141)
Rectifier Low-pass
filter
Low-pass
filter
Fig. 2.34 DC-to-DC resonant power electronic converters . (a) Series. (b) Parallel
2.5 Case Study 77
L C
Q1 Q4 i +v–
+ D1 D4 +
E R v0
– Q3 C0
Q2 –
D2 D3
Fig. 2.35 A DC-to-DC series resonant power electronic converter showing devices comprising
the inverter
+
converter v
i
+
E(t)
- Co
v0
which is rectified and filtered by the circuit on the right in Fig. 2.34a. Hence, the
circuit load, represented by the resistance R, receives the DC voltage v0 .
In Fig. 2.36, the electric diagram of a DC-to-DC series resonant power electronic
converter is shown, representing the inverter as a square AC voltage source E(t)
taking the values ±E. Notice that, because of the presence of the rectifying diodes,
the circuit operation can be divided in two cases: 1) when i > 0, Fig. 2.37a, and
2) when i < 0, Fig. 2.37b. The equations for i > 0 are obtained from Fig. 2.37a.
Applying KVL to the closed path on the left, the following is obtained:
di
E(t) = L + v + v0 , i > 0.
dt
It is important to stress that the direction of i and the polarity of v0 have been taken
into account. On the other hand, according to (2.50), the voltage and electric current
at the resonant capacitor are related by:
dv
C = i, i > 0.
dt
Finally, applying KCL to the node that is common to both capacitors, it is found
that:
78 2 Physical System Modeling
+
i v
+
E(t) - C0 R v0
-
L C
i + - -
v
+
E(t) - C0 R v0
+
dv0 v0
i = C0 + , i > 0.
dt R
On the other hand, the equations for i < 0 are obtained from Fig. 2.37b. Applying
KVL to the closed path on the left, the following is obtained:
di
E(t) = L + v − v0 , i < 0.
dt
Notice that v0 is affected by a “−” because its polarity is opposite to the direction
of electric current i. However, voltage and electric current at the resonant capacitor
satisfy again:
dv
C = i, i < 0.
dt
Finally, applying KCL to the node that is common to both capacitors yields:
v0 dv0
i=− − C0 , i < 0.
R dt
Notice that the correct direction of the electric current through the capacitor C0 and
resistance is from “+” to “−”, i.e., it is opposite to the direction indicated for i.
Analyzing these two sets of equations, it is possible to use a unique set of
equations representing both cases i > 0 and i < 0:
2.7 Review Questions 79
di
E(t) = L + v + v0 sign(i), (2.142)
dt
dv
C = i, (2.143)
dt
dv0 v0
abs(i) = C0 + , (2.144)
dt R
where:
+1, i > 0
sign(i) = , (2.145)
−1, i < 0
whereas abs(i) stands for the absolute value of i, i.e., abs(i) = i if i > 0 and
abs(i) = −i if i < 0. The equations in (2.142)–(2.144) constitute the DC-to-DC
high-frequency series resonant power electronic converter mathematical model. The
study of this class of power electronic converters is continued in Sect. 3.9, Ch. 3.
Analyzing (2.142)–(2.144) will explain how this circuit works and why it receives
the name high-frequency. For more information on modeling this class of power
electronic converter, the reader is referred to [11].
2.6 Summary
1. What are the fundamental laws of physics that are useful for connecting
components in mechanical and electrical systems?
2. Why is the mathematical model in Example 2.16 given by a single first-order
differential equation, whereas the mathematical model in Example 2.7 is given
by two second-order differential equations? Notice that there are three bodies
in Example 2.16 and two bodies are involved in Example 2.7.
80 2 Physical System Modeling
3. Why is the term corresponding to θ4 , i.e., the position term, absent in the
mathematical model in (2.118)?
4. Why are first-order differential equations the mathematical models of RL and
RC circuits, whereas the mathematical model of a RLC circuit is a second-
order differential equation?
5. It is often said that an inductor (and in general any electric circuit that is long
enough) has properties that are analogous to the properties of momentum in
mechanical systems. Can you explain what this statement refers to? Have you
observed that a spark appears when a highly inductive circuit is disconnected?
Do you remember what Newton’s First Law states?
6. It has been shown that ke = km in a permanent magnet brushed DC motor. On
the other hand, it is clear that the electrical subsystem must deliver energy to
the mechanical subsystem to render motion possible. Can you give an example
of a situation in a DC motor where the mechanical subsystem delivers energy
to the electrical subsystem? What is the role of the fact that ke = km in this
case?
7. It has been shown that a gear box is the mechanical analog of an electric
transformer. Can you list the relationship between electric currents and voltages
at both windings of an electric transformer? Is it possible to establish some
similar relationship between velocities and torques on both sides of a gear box?
Can you list the advantages, disadvantages, and applications of these features
in gear boxes and electric transformers?
8. According to the previous question, why does an automobile run slower when
climbing a hill, but it runs faster on flat surfaces?
9. If an electric transformer can increase voltage just by choosing a suitable rate
n1 /n2 , why are transistor-based electronic circuits employed to amplify signals
in communication systems instead of electric transformers?
10. If the power is the same at both ports in electric transformers and gear boxes,
where are the power losses?
2.8 Exercises
1. Consider the mass-spring-damper system shown in Fig. 2.6a which was studied
in Example 2.2. Suppose that this mechanism is rotated clockwise 90◦ . This
means that, now, the effect of gravity appears to be on the direction in which
both the spring and the damper move, i.e., it can be assumed that the mass
hangs from the roof through a spring and a damper. Show that the corresponding
mathematical model is given as:
b K 1
ÿ + ẏ + y = F (t),
m m m
where y = x − x0 with x0 = mg/K and g the gravity constant. What does this
mean?
2.8 Exercises 81
–
v1 + v + v2
–
1
v= (v1 − v2 ).
2
6. Consider the electric circuits shown in Fig. 2.39. Show that the mathematical
models are given as:
For the circuit in Fig. 2.39a:
R R
v̇0 + v0 = vi .
L L
For the circuit in Fig. 2.39b:
R2 s + R21C R1 1
V0 (s) = Vi (s) + vc (0),
R1 + R2 s + (R +R
1
)C
R 1 + R2 s +
1
(R1 +R2 )C
1 2
(2.146)
R 1 1
v̈0 + v̇0 + v0 = vi .
L LC LC
82 2 Physical System Modeling
L R1
R2
L L
L
u=1 i
E v C R
u=0
R 1 R
v̈0 + v̇0 + v0 = v̇i .
L LC L
7. An analog DC voltmeter is basically a permanent magnet brushed DC motor
with a spring fixed between the rotor and a point at the stator. This means that
such a DC motor is constrained to rotate no more than 180◦ . Based on this
description, find the mathematical model of an analog DC voltmeter.
8. Consider the system shown in Fig. 2.40, which represents a DC-to-DC buck
power converter. This converter is also known as step-down converter, because
2.8 Exercises 83
the DC output voltage υ is less than or equal to the supplied voltage E, i.e.,
υ ≤ E. Show that the mathematical model is given as:
di
L = −υ + uE,
dt
dυ υ
C =i− , (2.147)
dt R
where i, υ stand for electric current through the inductor L and voltage at the
terminals of capacitor C respectively. Constant E is the voltage of the power
supply and R is the load resistance. Finally, u stands for the switch position,
which is the control variable, taking only two discrete values: 0 or 1.
9. A buck power converter DC motor system, is shown in Fig. 2.41. It represents
a suitable way of supplying power to a permanent magnet brushed DC motor.
Given the following mathematical model for a permanent magnet brushed DC
motor:
dia
La = υ − Ra ia − ke ω,
dt
Fig. 2.41 Electric diagram of the buck power converter-DC Motor system. (a) Construction of the
buck power converter DC motor system using a transistor and a diode. (b) Ideal representation of
the buck power converter DC motor system
84 2 Physical System Modeling
dω
J = km ia − Bω,
dt
show that the complete mathematical model of the system Buck power
converter-DC Motor, ideally represented in Fig. 2.41b, is given as:
di
L = −υ + Eu,
dt
dυ υ
C = i − ia − ,
dt R
dia
La = υ − Ra ia − ke ω,
dt
dω
J = km ia − Bω,
dt
where:
• i is the electric current through the Buck power converter inductor.
• υ is the converter output voltage, which also is the voltage applied at the
motor terminals.
• u stands for the switch position, i.e., the control variable, taking only two
discrete values 0 or 1.
• L represents the converter inductance.
• C represents the converter capacitance.
• E is the DC power supply voltage.
• R is the converter load resistance.
• ia stands for the electric current through the DC motor.
• ω stands for the angular velocity of the DC motor.
• La represents the armature inductance of the DC motor.
• Ra represents the armature resistance of the DC motor.
• J is the inertia of the DC motor.
• ke is the counter-electromotive force constant.
• km is the torque constant.
• B stands for the viscous friction coefficient.
10. Consider the series RLC circuit in Example 2.12, whose mathematical model
is given in (2.53). The energy stored in the circuit is given as the magnetic
energy stored in the inductor plus the electric energy stored in the capacitor,
i.e., E = 12 Li 2 + 2C
1 2
q . Show that Ė = ivi − Ri 2 . What does each term of this
expression mean?
11. Consider the inertia-spring-damper system in Example 2.5 whose mathematical
model is given in (2.32). The energy stored in the system is given as the kinetic
energy plus the potential energy in the spring, i.e., E = 12 I θ̇ 2 + 12 Kθ 2 . Show
that Ė = T θ̇ − bθ̇ 2 . What does each one of the terms in this expression mean?
References 85
12. Consider the mathematical model in (2.140), (2.141), for the electro-
mechanical system in Example 2.20. The energy stored in this system is given
as the magnetic energy stored in the armature inductor plus the kinetic energy
of the mechanism. Is it possible to proceed as in the two previous examples to
find a similar expression for dE
dt ? What does each one of terms appearing in
dE
dt mean? Can the reader identify the terms representing the energy exchange
between the electrical and the mechanical subsystems?
References
where the exponent in parenthesis indicates the order of the derivative with respect
to time. The following property is also useful [2], pp. 193,[3], pp. 293:
t
F (s)
L f (τ )dτ = . (3.3)
0 s
Other important properties of the Laplace transform are the final value theorem [1],
pp. 25, [3], pp. 304:
which is only valid if the indicated limits exist, and the initial value theorem [3],
pp. 304:
Consider the following linear, ordinary, first-order, differential equation with con-
stant coefficients:
ẏ + a y = k u, y(0) = y0 , (3.6)
where k and a are real constants, y0 is a real constant known as the initial condition
or initial value of y(t) and ẏ = dy dt . The solution of this differential equation is
a function of time y(t), which satisfies (3.6) when replaced. With this aim, it is
required that constants a, k, y0 , and the function of time u be known. Use of (3.2)
in (3.6) yields:
k 1
Y (s) = U (s) + y0 . (3.8)
s+a s+a
kA 1
Y (s) = + y0 . (3.10)
s(s + a) s + a
According to the partial fraction expansion method [2], Ch. 4, [3], pp. 319, if a = 0,
then it is possible to write:
kA B C
= + , (3.11)
s(s + a) s+a s
i.e.,
kA kA
B= =− . (3.12)
s s=−a a
The value of C is computed multiplying both sides of (3.11) by the factor s and then
evaluating the resulting expressions at s = 0:
kA B C
s = s + s ,
s(s + a) s=0 s + a s=0 s s=0
i.e.,
kA kA
C= = . (3.13)
s + a s=0 a
kA 1 kA 1 y0
Y (s) = − + + . (3.14)
a s+a a s s+a
From tabulated Laplace transform formulas [4], Ch. 32, it is known that:
1
L{eβt } = , (3.15)
s−β
where β is any real constant. Using (3.15) it is found that the inverse Laplace
transform of (3.14) is given as:
90 3 Ordinary Linear Differential Equations
kA −at kA
y(t) = − e + + y0 e−at , (3.16)
a a
which is the solution of (3.6).
Example 3.1 To verify that (3.16) is the solution of (3.6) proceed as follows. First,
compute the first time derivative of y(t) = − kA −at + kA + y e−at , i.e.,
a e a 0
because u = A has been defined in (3.9). This means that the expression for y(t)
given in (3.16) satisfies (3.6); thus, it has been verified that (3.16) is the solution
of (3.6). This procedure must be followed to verify the solution of any differential
equation.
The solution given in (3.16) can be decomposed into two parts:
where yn (t) and yf (t) are called the natural response and the forced response
respectively. The forced response yf (t) receives this name because it is caused by
the presence of the function of time u. On the other hand, the natural response yn (t)
receives this name because it is produced by the structure (i.e., the nature) of the
differential equation, i.e., by terms ẏ + ay on the left hand of (3.6). Let us explain
this in more detail. Follow the solution procedure presented above, but assume for
a moment that y0 = 0. The partial fraction expansion presented in (3.11) and the
subsequent application of the inverse Laplace transform show that y(t) is given as
the sum of several functions of time that result from the fractions 1s and s+a 1
. Notice
that the presence of s in (3.11) is due to the fact that U (s) = s appears in (3.10),
1 A
determined by the differential equation structure (i.e., its nature). One important
consequence of this fact is that yn (t) is always given by the function e−at no matter
what the value of u is. The reader can review the procedure presented above to
solve this differential equation, thereby realizing that the initial condition y0 always
appears as a part of the natural response yn (t).
In control systems, y and u are known as the output and the input respectively.
The polynomial resulting from the application of the Laplace transform in the
differential equation, i.e., s + a, which arises from L{ẏ + ay} = (s + a)Y (s),
is known as the characteristic polynomial. The solution in (3.16), or equivalently
in (3.17), can evolve according to one of the following cases.
1. If a > 0, i.e., if the only root of the characteristic polynomial s = −a is real and
negative, then limt→∞ yn (t) = 0 and limt→∞ y(t) = yf (t).
2. If a < 0, i.e., if the only root of the characteristic polynomial s = −a is positive,
then yn (t) and y(t) grow without limit as time increases.
3. The case when a = 0, i.e., when the only root of the characteristic polynomial
is zero s = 0, cannot be studied from results that have been obtained so far and
it is studied as a special case in the next section. However, to include all the
cases, let us talk about what is to be found in the next section. When the only
root of the characteristic polynomial is at s = −a = 0, the natural response is
constant yn(t) = y0 , ∀t ≥ 0 and the forced response is the integral of the input
t
yf (t) = k 0 u(t)dt.
According to the previous section, if a > 0, then the natural response goes to zero
over time: limt→∞ yn (t) = 0; hence, when time is large enough the solution of the
differential equation is equal to the forced response: limt→∞ y(t) = yf (t) = kA a .
This means that the faster the natural response yn (t) tends toward zero (which occurs
as a > 0 is larger), the faster the complete solution y(t) reaches the forced response
yf (t). Hence, the natural response can be seen as a means of transport, allowing the
complete solution y(t) to go from the initial value y(0) = y0 to the forced response
yf (t). Existence of such a means of transport is justified recalling that the solution
of the differential equation in (3.6), i.e., y(t), is a continuous function of time. This
means that the solution cannot go from y(t) = y0 to y(t) = yf (t) = y0 in a zero
time interval.
The graphical representation of the solution in (3.17), when y0 = 0 and a > 0,
i.e.,
kA
y(t) = 1 − e−at , (3.20)
a
is depicted in Fig. 3.1. An important parameter in first-order differential equations
is time constant τ , which is defined as:
92 3 Ordinary Linear Differential Equations
time
Fig. 3.1 Graphical representation of y(t) in (3.20)
1
τ= . (3.21)
a
This is indicative of how fast the natural response vanishes, i.e., how fast y(t)
approaches the forced response yf (t). Replacing (3.21) into (3.20), it is easy to
verify that:
kA
y(τ ) = 0.632 . (3.22)
a
Consider a zero initial condition, i.e., y0 = 0, then (3.8) can be written as:
k
Y (s) = U (s),
s+a
or, equivalently:
Y (s) k
= G(s) = . (3.23)
U (s) s+a
3.1 First-Order Differential Equation 93
The function G(s) is known as the transfer function of the differential equation
in (3.6). The polynomial in the denominator of G(s), i.e., s + a, is known as the
characteristic polynomial and its roots are known as the poles of G(s). In this case,
there is only one pole at s = −a. According to the discussion above, the following
can be stated with respect to y(t), i.e., the output of the transfer function G(s):
• If pole located at s = −a is negative, i.e., if a > 0, then the natural response
yn (t) vanishes and the complete solution y(t) approaches the forced response
yf (t) as time increases. If u(t) = A is a constant, then yf (t) = kA
a .
• The faster y(t) approaches yf (t), the farther to the left of the origin s = 0 is
placed the pole at s = −a. This can be quantified using the time constant τ = a1 .
A large time constant implies a slow response whereas a small time constant
implies a fast response.
• If k = a > 0, then it is said that the transfer function G(s) has a unitary gain in
a steady state because, according to the final value theorem (3.4), if u(t) = A is
a constant then:
k A k
lim y(t) = lim sY (s) = lim s = A = A. (3.24)
t→∞ s→0 s→0 s+a s a
Im (s)
–a 0 –a Re (s)
a>0 a<0
Fig. 3.2 Location of the poles of the transfer function in (3.23). It is usual to represent a pole on
the s plane using a cross “×”
94 3 Ordinary Linear Differential Equations
R qo
Example 3.2 Consider the tank containing water depicted in Fig. 3.3. Assume that
the tank section C is constant. Water enters the tank at a rate given by the input flow
qi (m3 /s). Water leaves the tank at a rate given by the output flow qo (m3 /s) through
a valve with hydraulic resistance R. The water level in the tank is represented
by h. The mathematical model describing this system is obtained using the mass
conservation law. As water is not compressible, this law can be stated in terms of
mass or volume.
Let ΔVi and ΔVo be the water volumes entering and leaving the tank respectively
during a time interval Δt. During this time interval, the water volume ΔV increases
inside the tank at a rate given as:
ΔV ΔVi ΔVo
= − . (3.25)
Δt Δt Δt
On the other hand:
ΔV = CΔh,
ΔVi = qi Δt,
ΔVo = qo Δt.
Replacing this in (3.25) and considering small increments of time such that Δt →
dt and Δh → dh:
dh
C = qi − qo . (3.26)
dt
Assuming that the water flow is laminar through the output valve [1], pp. 155, then:
h
qo = . (3.27)
R
To understand the reason for this expression, consider the following situations.
3.1 First-Order Differential Equation 95
a) Suppose that the opening of the output valve is kept without change, i.e., R
remains constant, and the water level h increases. Everyday experience and the
expression in (3.27) corroborate that the output flow qo increases under this
situation.
b) Suppose that the water level h is kept constant, because there is water entering
the tank to exactly compensate for water leaving the tank. Then, slowly close
the output valve, i.e., slowly increase R. Everyday experience and the expression
in (3.27) corroborate that the output flow qo decreases in this situation.
Substituting (3.27) in (3.26), it is found that:
dh h
C = qi − .
dt R
Hence, the mathematical model of the water level system depicted in Fig. 3.3 is
given as:
dh 1
C + h = qi .
dt R
Dividing by C, the following linear, ordinary, first-order differential equation with
constant coefficients is finally obtained:
dh
+ ah = kqi ,
dt
1 1
a= , k= . (3.28)
RC C
The reason why this differential equation is the mathematical model of the water
level system is because, solving it, the evolution over time of the water level h(t)
can be known if the input flow qi (t), the tank section C, the hydraulic resistance R,
and the initial water level are known.
Example 3.3 Consider the water level system depicted in Fig. 3.3. It was found in
Example 3.2 that the mathematical model is given as:
dh
+ ah = kqi ,
dt
1 1
a= > 0, k = . (3.29)
RC C
This differential equation can be written as in (3.6) if it is assumed that y = h,
u = qi and y0 = h0 . Hence, if qi = A, the solution h(t) is similar to that in (3.16),
i.e.,:
kA −at kA
h(t) = − e + + h0 e−at , h0 = h(0). (3.30)
a a
Let us analyze (3.30).
96 3 Ordinary Linear Differential Equations
1. Assume that the tank is initially empty, i.e., h0 = 0, and water enters the tank
with a constant rate qi = A > 0. Under these conditions, the water level h(t)
evolves as depicted in Fig. 3.1 by assuming that h(t) = y(t). Notice that a =
1
RC > 0. From this figure, the solution in (3.30), and using everyday experience,
several cases can be studied.
• If A is chosen to be larger, then the final water level limt→∞ h(t) = kA a = RA
is also larger.
• If the output valve is slowly closed, i.e., R is slowly increased, then the final
water level limt→∞ h(t) = kA a = RA slowly increases.
• The tank cross-section has no effect on the final water level, i.e., the final water
level is the same in a thin tank and a thick tank.
• If the product RC is larger, then a is smaller; hence, the system response is
slower, i.e., more time is required for the level to reach the value h(τ ) =
0.632 kAa = 0.632RA and, as consequence, also to reach the final water level
limt→∞ h(t) = kA −at tends toward
a = RA. This is because the function e
zero more slowly when a = RC > 0 is smaller. Notice that a larger value of
1
time
Fig. 3.4 Water level evolution when h0 > 0 and qi (t) = A = 0 (R1 C1 < R2 C2 )
3.2 An Integrator 97
3. The case when a < 0 is not possible in an open-loop water level system because
C and R cannot be negative. However, a < 0 may occur in closed-loop systems
as a consequence of the interconnection of diverse components.
4. The case when a = 0 is studied in the next section.
3.2 An Integrator
ẏ = ku, (3.31)
where k is a real constant different from zero. Notice that this equation is obtained
as a particular case of (3.6) when a = 0. By direct integration:
y(t) t
dy = ku dt,
y(0) 0
t
y(t) = k u(t) dt + y(0), (3.32)
0
y(t) = yn (t) + yf (t),
t
yn (t) = y(0), yf (t) = k u(t) dt.
0
because a = RC 1
→ 0 when R → ∞. Then, the level evolution over time is
described by (3.32), i.e.,:
t
h(t) = h(0) + k qi (t) dt.
0
98 3 Ordinary Linear Differential Equations
time
time
Hence, the water level system behaves in this case as an integrator. If qi = A > 0,
then:
Figure 3.5 can be employed, assuming h(t) = y(t) and qi (t) = u, to graphically
depict the solution in (3.33) for the cases i) h(0) > 0 and qi = A > 0 is a constant,
and ii) h(0) > 0 and qi = A = 0. Notice that the water level remains constant if no
water enters the tank, i.e., when A = 0, and the level increases without a limit when
A > 0 is constant. The reader can resort to everyday experience to verify that these
two situations actually occur in a practical water level system.
3.2 An Integrator 99
Example 3.5 The differential equation in (3.31) can also be solved using partial
fraction expansion, i.e., using the method employed in Sect. 3.1. From (3.2)
and (3.31) it is found that:
sY (s) − y0 = k U (s).
k 1
Y (s) = U (s) + y0 . (3.34)
s s
Assume that:
A
u = A, U (s) = ,
s
where A is a constant. Hence, (3.34) can now be written as:
kA 1
Y (s) = + y0 . (3.35)
s2 s
According to the partial fraction expansion method [2], Ch. 4, [3], Ch. 7, it must be
written:
kA B C
= + 2, (3.36)
s2 s s
where B and C are two constants. C is computed multiplying both sides of (3.36)
by s 2 and evaluating at s = 0, i.e.,:
kA B 2 C 2
s 2 2 = s + 2s .
s s=0 s s=0 s s=0
Hence, B = 0 is found. Thus, using these values and (3.36), the expression in (3.35)
can be written as:
kA 1
Y (s) = + y0 . (3.37)
s2 s
100 3 Ordinary Linear Differential Equations
1
L{t} = . (3.38)
s2
Using (3.38), it is found that the inverse Laplace transform of (3.37) is given as:
which is the solution of (3.31). This solution can be decomposed into two parts:
where yn (t) and yf (t) are the natural and the forced responses respectively. As
explained Sect. 3.1, the natural response is given by the Laplace transform of term
ẏ on the left-hand side of (3.31). As a consequence of this, the term 1s y0 appears
in (3.37), i.e., yn (t) = y0 in (3.40). The forced response yf (t) is produced by u = A.
However, in this case, the forced response also receives the effect of the Laplace
transform of the term ẏ on the left-hand side of (3.31), as the combination of both
of them results in kA s2
and, hence, yf (t) = kAt.
The characteristic polynomial of the differential equation in (3.31) is s; hence, it
only has one root at s = 0. Thus, the corresponding transfer function G(s), when
y0 = 0:
Y (s) k
= G(s) = , (3.41)
U (s) s
only has one pole at s = 0. Notice that the input U (s) = As also has one pole at s =
0. The combination of these repeated poles in (3.35) produces the forced response
yf (t) = kAt, i.e., a first-degree polynomial of time, whereas the input u = A is a
zero-degree polynomial of time. Notice that the forced response corresponding to
the differential equation in (3.6) is yf (t) = kA a , i.e., a zero-degree polynomial of
time, whereas the input is u = A, i.e., a zero-degree polynomial of time. From these
examples we arrive at the following important conclusion:
“The forced response of a first-order differential equation with a constant input,
is also a constant if its characteristic polynomial has no root at s = 0.”
In Fig. 3.2 the location, on the s plane of the pole of the transfer function in (3.41)
is depicted, i.e., the pole at s = 0. The reader must learn to relate the pole location
on the s plane to the corresponding time response y(t). See the cases listed before
Example 3.2.
Example 3.6 Consider the electric circuit depicted in Fig. 3.6. According to the
Example 2.9, the mathematical model of this circuit is given as:
3.2 An Integrator 101
1
v̇0 + v0 = v̇i .
RC
Suppose that vi (t) is a step signal with amplitude A, i.e., Vi (s) = As . The
solution v0 (t) can be found to proceed as follows. Using the Laplace transform
in the previous expression:
1
V0 (s) s + = sVi (s) − vi (0) + v0 (0),
RC
s v0 (0) − vi (0)
V0 (s) = Vi (s) + .
s+ 1
RC s+ 1
RC
Replacing Vi (s) = A
s and using the inverse Laplace transform:
s A v0 (0) − vi (0)
V0 (s) = + ,
s+ 1
RC
s s + RC
1
A v0 (0) − vi (0)
V0 (s) = + ,
s+ 1
RC s+ 1
RC
1
v0 (t) = (A + v0 (0) − vi (0))e− RC t .
where vc (0) represents the initial voltage at the capacitor. Then, we have:
1
v0 (t) = (A − vc (0))e− RC t . (3.42)
In Fig. 3.7 this time response, when vi (t) is the square wave represented by the
dashed line and the time constant is RC = 0.1[s], is represented. At t = 0 we have
vc (0) = 0 and A = 1. Thus:
1.5
1
Amplitude [V]
0.5
−0.5
−1
−1.5
−2
0 1 2 3 4 5 6 7 8 9 10
time [s]
Fig. 3.7 Time response of the circuit in Fig. 3.6. Continuous: v0 (t). Dashed: vi (t)
as vc (t1 ) = 1[V] (see (3.44)) and A = −1[V] at t = t1 [s]. In Fig. 3.7, it is observed
that v0 = −2[V], at t = t1 , is correctly predicted by (3.45). Also notice that, again,
the time interval length 1[s] represents ten times the time constant, i.e., RC = 0.1[s].
Hence, v0 (t − t1 ) is very close to zero at t = 2[s]. The above procedure can be
repeated to explain the results in Fig. 3.7 for any 0 ≤ t ≤ 10.
Figure 3.7 has been obtained using the MATLAB/Simulink diagram presented in
Fig. 3.8. The signal generator block is programmed to have a square wave form,
3.2 An Integrator 103
Scope
s
-1
s+10
InputOutput
Signal Gain
Generator
unit amplitude, and 0.5[Hz] as the frequency. The negative unitary gain block is
included because the signal delivered by the signal generator block starts with a
negative semicircle. Once the simulation stops, the following MATLAB code is
executed in an m-file to draw Fig. 3.7:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=10/n;
t=0:Ts:10;
plot(t,InputOutput(:,1),’k--’,t,InputOutput(:,2),’k-’)
axis([-0.5 10 -2.5 2.5])
Notice that the transfer function of the circuit in Fig. 3.6 is:
V0 (s) s
= G(s) = , (3.46)
Vi (s) s + RC
1
s A
= lim s = A.
s→∞ s+ 1
RC
s
The roots of the polynomial at the numerator of a transfer function are called the
transfer function zeros. Thus, it is concluded that the discontinuity in the time
response, when a step input is applied, is due to the fact that the transfer function has
104 3 Ordinary Linear Differential Equations
R2
the same number of poles and zeros. In the next example, it is shown that a different
location of a zero of a transfer function has different effects on the time response.
Example 3.7 Consider the electric circuit shown in Fig. 3.9. This circuit is also
known as a phase-lead network. The mathematical model of this circuit was
obtained in (2.49) and it is rewritten here for ease of reference:
s+b vc (0) 1 1 R1 + R2
V0 (s) = Vi (s) − , b= , a= ,
s+a s+a R1 C C R1 R2
where vc (0) represents the initial voltage at the capacitor and a > b > 0. The
solution v0 (t) is computed in the following. Substituting vi (t) = A, i.e., Vi (s) = As :
(s + b)A vc (0)
V0 (s) = − . (3.47)
s(s + a) s+a
(s + b)A B C
= + . (3.48)
s(s + a) s s+a
1.5
0.5
−0.5
−1
−1.5
Fig. 3.10 Time response of the circuit in Fig. 3.9. Continuous: v0 (t). Dashed: vi (t)
bA 1 (b − a)A 1 vc (0)
V0 (s) = + − .
a s −a s+a s+a
This time response is depicted in Fig. 3.10 when vi (t) is the square wave shown
with a dashed line, b = 5, a = 10 and vc (0) = 0. At t = 0, A = 1[V]. Then, (3.51)
becomes:
1 1 −10t
v0 (t) = + e .
2 2
Thus, v0 (0) = 1[V] and v0 (t1 ) ≈ 12 [V], for t1 = 1[s], are correctly predicted. Notice
that a time interval of 1[s], between t = 0 and t = t1 , is ten times the time constant
of a1 = 0.1[s]; hence, 12 e−10t ≈ 0 when t = t1 = 1[s]. On the other hand, applying
the KVL to the circuit in Fig. 3.9 it is found that;
R2
vi (t1 ) = A = 1, v0 (t1 ) = A,
R1 + R2
1 R1
vc (t1 ) = vi (t1 ) − v0 (t1 ) = = .
2 R1 + R2
since R1R+R
1
2
= 12 . Thus, Fig. 3.10 corroborates that v0 (t1 ) = −1.5[V], t1 = 1[s],
and v0 ≈ − 12 [V] at t = 2[s], because −e−10(t−t1 ) ≈ 0 at t = 2[s], are correctly
predicted again.
Figure 3.10 has been obtained using the MATLAB/Simulink simulation diagram
presented in Fig. 3.11. The signal generator block is programmed to have a square
wave form, unit amplitude, and 0.5[Hz] as the frequency. The negative, unit gain
block is included because the signal delivered by the signal generator block starts
with a negative semicircle. Once the simulation stops, the following MATLAB code
is executed in an m-file to draw Fig. 3.10:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=5/n;
t=0:Ts:5;
plot(t,InputOutput(:,1),’k--’,t,InputOutput(:,2),’k-’)
axis([-0.25 5 -2 2])
Notice that the transfer function of the circuit in Fig. 3.9, given as:
Scope
s+5
-1
s+10
Gain InputOutput
Signal
Generator
V0 (s) s+b
= G(s) = , (3.52)
Vi (s) s+a
when vc (0) = 0, has a zero at s = −b < 0, whereas the transfer function of the
circuit in Fig. 3.6 has a zero at s = 0. The main difference produced by this fact is
that the time response of the circuit in Fig. 3.6 reaches a zero value in a steady state
whereas the steady-state response of the circuit in Fig. 3.9 is given as ab A = 0.
Finally, we can use (3.52), the initial value theorem in (3.5), and Vi (s) = As to
find:
s+bA
= lim s = A.
s→∞ s+a s
Thus, it is concluded again that the discontinuity in time response when a step input
is applied is due to the fact that the transfer function has the same number of poles
and zeros.
where ωn > 0 and k are real nonzero constants. Assume that u = A is a real
constant. Using (3.2) and U (s) = A/s, the following can be written:
to obtain:
ωn2 A y0 (s + 2ζ ωn ) + ẏ0
Y (s) = k + 2 . (3.54)
(s 2 + 2ζ ωn s + ωn2 )s s + 2ζ ωn s + ωn2
First, suppose that all of the initial conditions are zero ẏ0 = 0, y0 = 0. Then:
A ωn2
Y (s) = k .
(s 2 + 2ζ ωn s + ωn2 )s
108 3 Ordinary Linear Differential Equations
Notice that:
According to the partial fraction expansion method [2], Ch. 4, [3], Ch. 7, in this case
the following can be written:
Aωn2 Aωn2 Bs + C D
Y (s) = k = k = + ,
(s + 2ζ ωn s + ωn )s
2 2 [(s − σ ) + ωd ]s
2 2 (s − σ ) + ωd
2 2 s
(3.56)
This expression constitutes the solution of (3.53) when all of the initial conditions
are zero, i.e., when ẏ0 = 0, y0 = 0. The detailed procedure to find (3.57) from (3.56)
is presented in the following. Readers who are not interested in these technical
details may continue from (3.62) onward.
Multiplying both sides of (3.56) by the factor (s − σ )2 + ωd2 and evaluating at
s = a (see (3.55)) yields:
Aωn2 +
Bs C 2
k [(s − σ ) 2
+ ω 2
] = [(s − σ ) 2
+ ω ]
[(s − σ )2 + ωd2 ]s
d (s − σ )2 + ωd2
d
s=a s=a
D
+ [(s − σ )2 + ωd2 ] ,
s s=a
to obtain:
3.3 Second-Order Differential Equation 109
Aωn2
k = B(σ + j ωd ) + C.
σ + j ωd
(σ − j ωd )
kAωn2 = Bσ + C + j Bωd .
σ 2 + ωd2
kAωn2
B=− . (3.58)
σ 2 + ωd2
kAωn2 σ
Bσ + C = .
σ 2 + ωd2
Replacing (3.58):
2kAωn2 σ
C= . (3.59)
σ 2 + ωd2
kAω2 2kAω2 σ
Bs + C − 2 n2 s + 2 n2
σ +ωd σ +ωd
= ,
(s − σ )2 + ωd2 (s − σ )2 + ωd2
kAωn2 (s − σ ) kAωn2 σ 1
=− + .
(σ + ωd ) [(s − σ ) + ωd ] (σ + ωd ) [(s − σ )2 + ωd2 ]
2 2 2 2 2 2
σ=!d
CA β
–1 (–)
2
+1 CO
σ
!d (–)
Fig. 3.12 Some important relations for the procedure in Sect. 3.3
kAωn2 σ t σ
= e [− cos(ωd t) + sin(ωd t)],
σ 2 + ωd2 ωd
2
kAωn2 σ t σ
= e [sin β cos(ωd t) + cos β sin(ωd t)] + 1.
σ 2 + ωd2 ωd
Notice that some relations in Fig. 3.12a have been employed in the last step. On the
other hand, it is possible to continue writing:
1
sin β cos(ωd t) + cos β sin(ωd t) = [sin(β − ωd t) + sin(β + ωd t)] +
2
1
+ [sin(ωd t − β) + sin(ωd t + β)],
2
= sin(ωd t + β),
−1 −1 −1
tan β = = = −ζ ,
σ/ωd (−ζ ωn )/(ωn 1 − ζ )
2 √
2 1−ζ
1 − ζ2
β = π + arctan ,
ζ
3.3 Second-Order Differential Equation 111
where signs of the adjacent and the opposite sides have been taken into account to
conclude that β is an angle on the third quadrant (see Fig. 3.12b). This allows the
following simplification [4], Ch. 5:
and thus:
2
σ
+1
Bs + C ωd
L−1 = −kAωn2 eσ t sin (ωd t + φ) ,
(s − σ )2 + ωd2 σ 2 + ωd2
σ 2 + ωd2
= −kAωn2 eσ t sin (ωd t + φ) ,
ωd (σ 2 + ωd2 )
1
= −kAωn2 eσ t sin (ωd t + φ) ,
ωd σ 2 + ωd
2
Bs + C 1
L−1 = −kA eσ t sin (ωd t + φ) , (3.60)
(s − σ )2 + ωd2 1 − ζ2
where σ = −ζ ωn and ωd = ωn 1 − ζ 2 have been employed. On the other hand,
D in (3.56) is easily computed multiplying both sides of that expression by factor s
and evaluating at s = 0:
kA ωn2
D= 2 = kA. (3.61)
s + 2ζ ωn s + ωn2 s=0
If it is assumed now that the initial conditions are not zero, then:
e−ζ ωn t
y(t) = kA 1 − sin (ωd t + φ) + p(t), (3.62)
1 − ζ2
112 3 Ordinary Linear Differential Equations
where:
−1 y0 (s + 2ζ ωn ) + ẏ0
p(t) = L . (3.63)
s 2 + 2ζ ωn s + ωn2
The inverse Laplace transform defining p(t) may be computed using a similar
procedure to that presented above. Moreover, the reader should realize that p(t)
is given by a function as that in (3.60) with coefficients depending on both y0 and
ẏ0 .
The solution given in (3.57) can be decomposed into two parts:
where yn (t) and yf (t) are the natural and the forced responses respectively. Notice
that, according to (3.56) and (3.60), the natural response in (3.65) is due only to
the characteristic polynomial s 2 + 2ζ ωn s + ωn2 = (s − σ )2 + ωd2 , which results
from applying the Laplace transform to terms ÿ + 2ζ ωn ẏ + ωn2 y. Hence, no matter
what the input u is, the natural response yn (t) is given as in (3.65). On the other
hand, notice that the forced response in (3.66) is due to term D/s in (3.56), which
is introduced by the constant input u = A, as U (s) = A/s. Also notice that,
according to the paragraph after (3.63), when the initial conditions are different from
zero they only affect the natural response in the sense that its coefficient depends
on the initial conditions y0 and ẏ0 , but the function of time is always given as
e−ζ ωn t sin (ωd t + φ) or its time derivative. Furthermore, p(t) belongs to the natural
response when the initial conditions are different from zero.
The reader may review the procedure presented above after (3.57) to corroborate
that, in the case when −1 < ζ < 0 with k > 0 and ωn > 0, the solution in (3.64) or
in (3.57) becomes:
when the initial conditions are zero, i.e., yn (t) is an oscillatory function whose
amplitude neither increases nor decreases. This means that although y(t) does
not grow without a limit, it will not reach the forced response yf (t) in a steady
state.
4. The behavior obtained when ζ is out of the range −1 < ζ < 1 is studied in the
subsequent sections as the cases when the roots of the characteristic polynomial
are real and repeated or real and different.
Finally, notice that, according to the above discussion and (3.62), (3.63), the solution
of a second-order differential equation may present sustained oscillations (ζ = 0)
even if the input is zero (u = 0) if the initial conditions are different from zero.
This explains the oscillations in the electronic circuits studied in Chap. 9 (see last
paragraph in Sect. 9.3.1).
The graphical form of solution presented in (3.64) for the differential equation
in (3.53) is studied in the following. Recall that it is assumed that 0 ≤ ζ < 1,
ωn > 0, k > 0 and that the initial conditions are zero y0 = 0, ẏ0 = 0. Notice that
the natural response tends toward zero as time increases if 0 < ζ < 1:
e−ζ ωn t
lim yn (t) = lim −kA sin (ωd t + φ) = 0, (3.69)
t→∞ t→∞ 1 − ζ2
because ζ ωn > 0. Also recall that, in the case when the initial conditions are not
zero, the natural response also tends toward zero as time increases. Hence, when
time is large, the solution of the differential equation is equal to the forced response:
t time
This means that the faster the natural response vanishes yn (t), i.e., as ζ ωn > 0
is larger, the faster the complete solution y(t) reaches the forced response yf (t).
As was noted for first-order differential equations, the natural response allows the
complete solution y(t) to go from the initial conditions (zero in this case) to the
forced response yf (t).
Two important parameters of the response in (3.64) are the rise time tr and
overshoot Mp , which are shown in Fig. 3.13. Overshoot can be measured as:
yp − yf
Mp (%) = × 100,
yf
where yf = kA stands for the forced response. Recall that it is assumed that y0 =
ẏ0 = 0. Carefully analyzing (3.64), it can be shown that [1], pp. 232:
1 1 − ζ2
tr = π − arctan , (3.71)
ωd ζ
−√ ζ
π
Mp (%) = 100 × e 1−ζ 2 .
Figures 3.14 and 3.15 show how the solution in (3.64) is affected when the
parameters ζ and ωn change. Notice that overshoot Mp is affected only by ζ ,
whereas rise time tr is mainly affected by ωn , although ζ also has a small effect
on tr .
3.3 Second-Order Differential Equation 115
time
Fig. 3.14 The solution in (3.64) when different values for ζ are used and ωn is kept constant
time
Fig. 3.15 The solution in (3.64) when different values of ωn are used: ωn2 = 2ωn1 , ωn3 = 3ωn1 .
Parameter ζ is kept constant
Finally, it is important to point out that, in the case when u = A = 0 but some
of the initial conditions ẏ0 or y0 are different from zero, y(t) behaves as the time
function in (3.65) and is graphically represented as the oscillatory part without the
116 3 Ordinary Linear Differential Equations
constant component, i.e., it oscillates around y = 0, in any of the Figs. 3.13, 3.14
or 3.15. This is because of function p(t) appearing in (3.62).
If the initial conditions are zero y0 = 0, ẏ0 = 0, then (3.54) can be written as:
kωn2
Y (s) = U (s),
s 2 + 2ζ ωn s + ωn2
or:
Y (s) kωn2
= G(s) = 2 , (3.72)
U (s) s + 2ζ ωn s + ωn2
where G(s) is the transfer function of the differential equation in (3.53). Notice that
G(s), defined in (3.72), has a second-degree characteristic polynomial, i.e., G(s)
has two poles. Hence, G(s) is a second-order transfer function. According to (3.55)
these poles are located at s = a and s = ā, where:
a = σ + j ωd , ā = σ − j ωd .
It is important to stress that these poles are complex conjugate only under the
condition −1 < ζ < 1. The reader can verify that these poles are real if ζ does
not satisfy this condition. Such a case is studied in the subsequent sections.
According to the study in the previous sections, the following can be stated for
the output of the transfer function y(t):
• If both poles have a negative real part σ = −ζ ωn < 0, i.e., ζ > 0, then
the natural response yn (t) vanishes and the complete response y(t) reaches the
forced response yf (t) as time increases. When the input is a constant u(t) = A,
then the forced response is yf (t) = kA.
• The natural response yn (t) vanishes faster as ζ ωn is larger. As is depicted in
Fig. 3.16, the system response remains enveloped by two exponential functions
whose vanishing rate is determined by ζ ωn .
• The rise time tr decreases if ωn increases. This is corroborated by observing
that, according to (3.55), if ωn increases then ωd also increases and, according
to (3.71), tr decreases.
• Overshoot Mp decreases if ζ increases.
• According to Fig. 3.17: i) the rise time tr decreases as the complex conjugate
farther to the left of s = 0 because ωn increases (see (3.71)
poles are located
and ωd = ωn 1 − ζ 2 ), ii) the parameter ζ increases and, hence, overshoot Mp
decreases, as the angle θ is larger because ζ = sin(θ ), iii) yn (t) vanishes faster
as the complex conjugate poles are located farther to the left of s = 0 because
ζ ωn is larger.
3.3 Second-Order Differential Equation 117
time
Fig. 3.16 The response of a second-order system is enveloped by two exponential functions when
the input is constant and the initial conditions are zero
j!d
!n
– ζ!n Re (s)
• If k = 1 then the transfer function G(s) is said to have unitary gain in a steady
state because, when u = A is a constant, the final value theorem (3.4) can be
used to find that:
kωn2 A kωn2
lim y(t) = lim sY (s) = lim s = A = A.
t→∞ s→0 s→0 s 2 + 2ζ ωn s + ωn2 s ωn2
The constant k represents the steady-state gain of the transfer function in (3.72).
• If −1 < ζ < 0, then the real part of the poles σ = −ζ ωn is positive; hence,
the complete response y(t) grows without limit as time increases. Notice that
this implies that the complex conjugate poles are located on the right half of the
plane s.
118 3 Ordinary Linear Differential Equations
Fig. 3.18 A x
mass-spring-damper system
K
m f
where x is the output y, whereas f is the input u. Hence, x(t) is given as y(t)
in (3.64) if 0 ≤ ζ < 1 when the initial conditions are zero. Notice that all
constants in (3.73) are positive: the mass m, the viscous friction coefficient b, and the
spring stiffness coefficient K only can be positive. According to (3.74), the damping
coefficient is given as:
b
ζ = √ . (3.75)
2 mK
3.4 Arbitrary-Order Differential Equations 119
If a constant force f = A is applied, the results in Figs. 3.13, 3.14, and 3.15 can be
employed to conclude the following.
• If there is no friction, i.e., if b = 0, then ζ = 0 and the mass will oscillate forever
around the position xf = kA = K1 A. In the case when the external force is zero
f = 0 but some of the initial conditions ẋ0 or x0 are different from zero, then the
mass will oscillate again, though now around the position x = 0, as described by
p(t) appearing in (3.62).
• If the friction coefficient b > 0 increases, then ζ > 0 also increases and the
mass oscillations will disappear because the system will have more damping. It is
shown in the subsequent sections that the poles are real and repeated when ζ = 1.
In all of these cases, the mass will stop moving at x = xf = kA = K1 A. In the
case when the external force is zero f = 0 but some initial conditions, ẋ0 or x0 ,
are different from zero, the mass will stop at x = 0. This is again described by the
function p(t) appearing in (3.62). Notice that, according to (3.75), the damping
ζ also increases if the mass m or the spring stiffness constant K decreases. To
understand the reason for this, consider the opposite case: larger values of both
m and K produce larger forces (mẍ for the mass and Kx for the spring), which,
hence, are less affected by the friction force (bẋ) and thus, the mass can remain
in movement for a longer period of time.
the rise time tr inversely depends on the undamped natural frequency ωn =
• As
K
m , then a more rigid spring (with a larger K) or a smaller mass produces faster
responses (tr smaller). On the other hand, advantage can be taken of the fact that
the oscillation frequency is given by ωd = ωn 1 − ζ 2 with ωn = K m to adjust
the rate of a mechanical clock based on a mass-spring-damper system: if the
clock “lags,” it is necessary to increase its oscillation frequency, or rate, which is
achieved by applying tension to the spring to increase K.
The case when −1 < ζ < 0 is not possible in this example because all of the
constants b, m, and K are positive. However, the situation when −1 < ζ < 0
commonly occurs in feedback systems as a result of the interconnection of diverse
components.
In Exercise 3.6, it was shown that some differential equations can be written in terms
of time derivatives of both the unknown function y(t) and the excitation function
u(t). Moreover, the initial conditions of both variables can be combined to obtain
the initial conditions in other circuit components. According to this reasoning, a
linear ordinary differential equation with arbitrary order n and constant coefficients
can always be written as:
where n ≥ m. If n < m the differential equation has no physical meaning, i.e., there
is no physical system in practice whose mathematical model can be represented
by such a differential equation and, thus, it is not of any interest for engineers.
Notice that all of the derivatives are related to time. Because of this feature, these
differential equations are also called dynamical systems. The variable y is the
unknown variable of the differential equation, whereas u is a function of time that
is also called the excitation. The objective of solving a differential equation is to
find a function y(t) that satisfies the equality defined by the differential equation.
To find y(t), it is necessary to know u(t), the real constants ai , i = 0, . . . , n − 1,
bj , j = 0, . . . , m, and the set of n + m constants y(0), ẏ(0) . . . y (n−1) (0), u(0),
u̇(0),. . .,u(m−1) (0), which are known as the initial conditions of the problem,
representing values that the unknown and the excitation, in addition to their time
derivatives, have at t = 0.
Applying the Laplace transform (3.2) to (3.76), the following is found:
b0 + b1 s + · · · + bm s m P (s)
Y (s) = U (s)− n .
s n + an−1 s n−1 + · · · + a1 s + a0 s + an−1 s n−1 + · · · + a1 s + a0
B(s) A P (s)
Y (s) = − ,
N(s) s N(s)
N(s) = s n + an−1 s n−1 + · · · + a1 s + a0 ,
B(s) = b0 + b1 s + · · · + bm s m .
Also suppose for the moment that all of the initial conditions are zero. This means
that P (s) = 0 and it is possible to write:
B(s) A
Y (s) = .
N(s) s
According to the partial fraction expansion method [2], Ch. 4, [3], Ch. 7, the solution
in time y(t) depends on the roots of the characteristic polynomial N (s), i.e., on poles
of the following transfer function:
Y (s) B(s)
= G(s) = (3.77)
U (s) N(s)
3.4 Arbitrary-Order Differential Equations 121
and factor 1s introduced by U (s) = A/s. The variable y(t) is known as the output
and u(t) is known as the input of the transfer function G(s). The order of G(s)
is defined as the degree of the characteristic polynomial N (s). As a n degree
polynomial has n roots, then a n order transfer function has n poles (see paragraph
after (3.23)). On the other hand, the roots of the polynomial B(s) are known as the
zeros of the transfer function G(s). If B(s) has the degree m then G(s) has m zeros.
Recall the condition n ≥ m imposed at the beginning of this section. It is assumed
that B(s) and N (s) do not have common roots.
The solution for all of the possible cases for the roots of the polynomial N (s) are
studied in the next sections, i.e., all of the possible cases for the poles of G(s). This
provides the necessary information to understand how a system of arbitrary order n
responds.
Suppose that N (s) has k ≤ n real and different roots, which are different from
s = 0, i.e.,:
B(s) A c1 c2 ck f
Y (s) = = Q(s) + + + ··· + + , (3.78)
N (s) s s − p1 s − p2 s − pk s
where q(t) = L−1 {Q(s)}. Notice that the following can be written:
where the natural response yn (t) only depends on the roots of the characteristic
polynomial N (s), whereas the forced response yf (t) only depends on the fraction
1
s introduced by U (s). Consider the following possibilities.
1. If pi < 0 for all i = 1, . . . , k, then limt→∞ (c1 ep1 t +c2 ep2 t +· · ·+ck epk t ) = 0
and limt→∞ y(t) = q(t) + yf (t).
2. If pi > 0 for at least one i = 1, . . . , k, then (c1 ep1 t + c2 ep2 t + · · · + ck epk t ) →
∞, as t → ∞ and limt→∞ y(t) = ∞.
Example 3.9 Consider the following second-order differential equation also given
in (3.53):
If ζ > 1, then the only two roots, p1 and p2 , of the characteristic polynomial N (s) =
s 2 + 2ζ ωn s + ωn2 are real and different:
p1 = −ζ ωn + ωn ζ 2 − 1,
p2 = −ζ ωn − ωn ζ 2 − 1,
p1 = p2 .
p1 < 0, p2 < 0.
time
Im(s)
p2 –ζωn p1 Re(s)
Fig. 3.19 Solution of the second-order differential equation in (3.80), when ζ > 1, and in (3.85),
when ζ = 1, with u = A and zero initial conditions . (a) Time response. (b) Location of poles
when ζ > 1
ζ > 1, there is no oscillation, because the imaginary part of both roots is zero; thus,
the oscillation frequency is also zero.
Example 3.10 Consider again the mass-spring-damper system in Example 3.8.
Recall that (3.74) describes the mass movement. Assume that:
b
ζ = √ > 1.
2 mK
124 3 Ordinary Linear Differential Equations
Then, according to the previous example, the roots p1 and p2 of the characteristic
polynomial s 2 + 2ζ ωn s + ωn2 are real, different, and negative. Notice that this case
stands when the viscous friction coefficient b > 0 is very large or when the spring
stiffness constant
K > 0 or mass m is very small. Also notice that one root (p1 =
−ζ ωn +ωn ζ 2 − 1 < 0) approaches the origin as ζ > 1 becomes larger. According
to the discussion above in the present section, this means that the movement of the
mass is slower as ζ grows, because it takes more time to function e p1 t to vanish
moves farther to the left of the origin). This explains why slower responses are
depicted in Fig. 3.19, as ζ > 1 is larger.
Example 3.11 Consider the following differential equation:
with c, d and e some real constants. The roots p1 and p2 of the characteristic
polynomial N (s) = s 2 + cs + d are given as:
√
c c2 − 4d
p1 = − + ,
2 2
√
c c2 − 4d
p2 = − − .
2 2
The following cases have to be considered:
• If d < 0, then:
c c2 + 4 abs(d)
p1 = − + ,
2 2
c c2 + 4 abs(d)
p2 = − − ,
2 2
and both roots are real and different, with one positive and the other negative,
no matter what the value of c. It is shown, in Example 7.5 of Chap. 7, that this
case corresponds to a mass-spring-damper system with a negative spring stiffness
constant and that this is obtained in practice when a simple pendulum works
around its inverted configuration (also called unstable).
• If c > 0 and d > 0, the case studied in Sect. 3.3is retrieved when 1 > ζ > 0,
and the case studied in the present section is retrieved when ζ > 1.
• If c < 0 and d > 0, with abs(c) small and d large, the case studied in Sect. 3.3 is
retrieved when −1 < ζ < 0. The situation when ζ < −1 is also obtained in this
case when abs(c) is large and d is small, but both roots are positive and different:
p1 = −ζ ωn + ωn ζ 2 − 1 > 0,
3.4 Arbitrary-Order Differential Equations 125
p2 = −ζ ωn − ωn ζ 2 − 1 > 0,
p1 = p2 .
Suppose that N (s) has one root that is repeated k times and it is different from zero,
i.e.,:
with p = 0 and N0 (s) a polynomial that contains the remaining n − k roots in N (s),
and none of them is located at s = 0. According to the partial fraction expansion
method [2], Ch. 4, [3], Ch. 7, the following must be written:
B(s) A ck ck−1 c2 c1 f
Y (s)= = Q(s)+ k
+ k−1
+···+ 2
+ + ,
N (s) s (s−p) (s−p) (s−p) s−p s
(3.81)
Finally, the constant f is computed by multiplying both sides of (3.81) by the factor
s and evaluating at s = 0 to find:
B(s)A
f = .
N(s) s=0
126 3 Ordinary Linear Differential Equations
t k−1 t k−2
y(t) = q(t) + ck ept + ck−1 ept + · · ·
(k − 1)! (k − 2)!
+ c2 t ept + c1 ept + f,
where q(t) = L−1 {Q(s)}. Notice that the following can be written:
It is remarked again that yn (t) only depends on the roots of the characteristic
polynomial N (s) and yf (t) only depends on the fraction 1s , introduced by U (s).
Consider the following possibilities:
1. If p < 0, it is useful to compute the following limit, where j is any positive
integer number:
tj
lim t j ept = lim ,
t→∞ t→∞ e−pt
dt j
tj j t j −1
lim t e j pt
= lim = lim dt = lim .
t→∞ t→∞ e−pt t→∞ de−pt t→∞ −p e−pt
dt
j (j − 1) t j −2 j!
= lim = · · · = lim = 0.
t→∞ (−p)2 e−pt t→∞ (−p)j e−pt
and limt→∞ y(t) = q(t) + yf (t) for any p < 0, no matter how close to zero p
is.
2. If p > 0, it is clear that:
t k−1 t k−2
lim ck e + ck−1
pt
e + · · · + c2 t e + c1 e
pt pt pt
→ ∞,
t→∞ (k − 1)! (k − 2)!
yields:
tk t k−1
y(t) = q(t) + ck+1 + ck + · · · + c2 t + c1 , (3.84)
k! (k − 1)!
t k−1
yn (t) = q(t) + ck + · · · + c2 t + c1 ,
(k − 1)!
tk
yf (t) = ck+1 ,
k!
128 3 Ordinary Linear Differential Equations
since the natural response only depends on the k real and repeated roots at s =
0 that N (s) has, which, according to (3.83), only introduces terms included in
yn (t). It is clear that yn (t) → ∞ and y(t) → ∞ when t → ∞ for k ≥ 2 and
that yn (t) is a constant if k = 1. On the other hand, the forced response yf (t)
represents the integral of u(t) iterated k times.
Example 3.12 Consider the following second-order differential equation, also given
in (3.53):
p1 = p2 = −ζ ωn .
The solution y(t) of the differential equation in (3.85) is depicted in Fig. 3.19, when
ζ = 1, u = A and the initial conditions are zero. Notice that y(t) does not exhibit
oscillations in this case because both roots have a zero imaginary part. This case,
ζ = 1, is at the edge between an oscillatory response ζ < 1 and a response without
oscillations ζ > 1. In fact, the case ζ = 1 represents the fastest response without
oscillations because, when ζ > 1, the response is slower as ζ increases.
Example 3.13 Consider again the mass-spring-damper system in Example 3.8.
Recall that (3.74) describes the movement of mass. Assume that:
b
ζ = √ = 1.
2 mK
Then, in this case, the characteristic polynomial s 2 + 2ζ ωn s + ωn2 only has a real
and negative root:
p = −ζ ωn ,
which is repeated twice. The mass position x(t) evolves exactly as y(t) in Fig. 3.19.
This class of response may be very useful if a fast mass movement is required, but
without oscillations.
Example 3.14 Suppose that there is neither a spring nor a damper in Fig. 3.18, i.e.,
assuming that b = 0 and K = 0, the differential equation in (3.73) becomes:
mẍ = f. (3.86)
Notice that in this case the characteristic polynomial is s 2 , which only has a real
root at p = 0 repeated twice. Now suppose that all of the initial conditions are zero
and that the mass receives a small disturbance force described by:
3.4 Arbitrary-Order Differential Equations 129
ε0 , 0 ≤ t ≤ t1
f = , (3.87)
0, otherwise
where ε0 > 0 and t1 > 0 are small constant numbers. By direct integration of (3.86),
it is found:
1 t
ẋ(t) = f (τ )dτ + ẋ(0).
m 0
Notice that x(t) → ∞ as t → ∞ (see Fig. 3.20) despite f = 0 for t > t1 , i.e.,
despite the forced response being zero for all t > t1 . This means that the natural
response xn (t) → ∞ when t → ∞, which corroborates results obtained in the
present section for real roots at zero, which are repeated at least twice. The reader
may resort to everyday experience to verify that a slight hit (f in (3.87)) on the mass
m is enough for the mass to begin moving to never stop (x(t) → ∞) if no friction
exists between the mass and the floor.
"0 2
2m
t
t1 t [s]
130 3 Ordinary Linear Differential Equations
p1 = p2 = −ζ ωn > 0.
s 2 + bs + a = (s − p1 )(s − p2 ), p1 = c1 + j d1 , p2 = c2 + j d2 ,
where p1 and p2 are the complex, but not conjugate roots, i.e., c1 , c2 , d1 , d2 , are real
numbers such that c1 = c2 if d1 = −d2 or d1 = −d2 if c1 = c2 . We have that:
(s − p1 )(s − p2 ) = s 2 − (p1 + p2 )s + p1 p2 ,
b = p1 + p2 = c1 + c2 + j (d1 + d2 ),
a = p1 p2 = c1 c2 − d1 d2 + j (c2 d1 + c1 d2 ).
i=k
N(s) = N0 (s) [(s − σi )2 + ωdi
2
],
i=1
B(s) A i=k
F i s + Ci f
Y (s) = = Q(s) + + ,
N(s) s [(s − σi ) + ωdi ]
i=1
2 2 s
F(t) x1 x2
K2
K1 K3
m1 m2
b K2 1
ẍ1 + (ẋ1 − ẋ2 ) + (x1 − x2 ) = F (t),
m1 m1 m1
b K3 K2
ẍ2 − (ẋ1 − ẋ2 ) + x2 − (x1 − x2 ) = 0.
m2 m2 m2
Applying the Laplace transform (3.2) to each one of these differential equations and
assuming that all of the initial conditions are zero, the following is found:
K2
m1 F (s) + +
1 b
m1 s m1 X2 (s)
X1 (s) = ,
s 2 + mb1 s +K2
m1
K2
b
m2 s + m2 X1 (s)
X2 (s) = K2 +K3
.
s2 + b
m2 s + m2
Replacing the second of these equations in the first one, and rearranging, it is found
that:
1
s 2 + b s + K2 +K3 F (s)
m1 m2 m2
X1 (s) = .
K +K
s 2 + m1 s + m12 s 2 + m2 s + 2m2 3 − mb1 s + K
b K b
m1
2 b K2
m2 s + m2
or:
K2 +K3
1
m1 s2 + m2
X1 (s) = F (s). (3.89)
K2 K2 +K3 K2 K3
s4 + m1 + m2 s2 + m1 m2
3.4 Arbitrary-Order Differential Equations 133
i.e.,:
2
K2 K2 +K3 K2 K2 +K3 4K22
m1 + m2 + m1 − m2 + m1 m2
c= > 0,
2
2
K2 K2 +K3 K2 K2 +K3 4K22
m1 + m2 − m1 − m2 + m1 m2
e= > 0.
2
Then, the following can be written:
K2 +K3
1
m1 s2 + m2
X1 (s) = F (s). (3.90)
(s 2 + c)(s 2 + e)
As e and c are positive and different, it is ensured that the characteristic polynomial
in (3.90) has two pairs of complex conjugate and different roots (in fact, the roots are
imaginary conjugate and different). Hence, mass m1 , whose position is represented
by x1 (t), moves by oscillating and it never stops. However, the amplitude of
this oscillatory movement does not grow without a limit. These √ oscillations are
performed
√ at two angular frequencies defined by ω d1 = ω n1 = c and ωd2 =
ωn2 = e. Recall that the damping of these oscillations is zero.
Assume that the characteristic polynomial N(s) has a pair of complex conjugate
roots that are repeated k > 1 times, i.e.,:
B(s) A F 1 s + C1 F 2 s + C2
Y (s) = = Q(s) + + + ···
N (s) s [(s − σ )2 + ωd2 ]k [(s − σ )2 + ωd2 ]k−1
Fk−1 s + Ck−1 F k s + Ck f
+ + + ,
[(s − σ )2 + ωd2 ]2 (s − σ )2 + ωd2 s
where Q(s) contains fractions corresponding to the roots of N0 (s). In the case of
real roots, it was found that when roots are not repeated, they introduce functions
such as ept , where p is the corresponding root. When such a root is repeated j
times, it was found that the functions introduced become t j −1 ept . In the case of
complex conjugate and repeated roots, a similar situation occurs. In this case, any
formal proof is not presented because of cumbersome notation, and only intuitive
ideas are given to understand the reason for the resulting functions.
Using the inverse Laplace transform in (3.60), it was found that a complex
conjugate nonrepeated root introduces the time function:
−1 Bs + C
L = βeσ t sin(ωd t + φ),
(s − σ )2 + ωd2
for some constants β and φ. Then, in the case of complex conjugated and repeated
roots, y(t) is given as:
where q(t) = L−1 {Q(s)}. The solution in (3.91) has one of the following
behaviors.
1. If the complex conjugate root has a positive real part σ = −ζ ωn > 0, i.e., if
−1 < ζ < 0, it is easy to see that yn (t) → ∞ and y(t) → ∞ as t → ∞.
2. If the complex conjugate root has a negative real part σ = −ζ ωn < 0, i.e., if
0 < ζ < 1, it is possible to proceed as in Sect. 3.4.2 to compute the following
limit:
lim t j eσ t sin(ωd t + φ) = 0,
t→∞
for any positive integer j and any real negative σ . Then, for complex conjugate
and repeated roots with a negative real part:
lim βk t k−1 eσ t sin(ωd t + φk ) + βk−1 t k−2 eσ t sin(ωd t + φk−1 )
t→∞
+ · · · + β2 teσ t sin(ωd t + φ2 ) + β1 eσ t sin(ωd t + φ1 ) = 0, (3.92)
as time increases in the case when the root is repeated at least twice, i.e., if k > 1.
But if this root is not repeated, i.e., if k = 1, then:
3.4.5 Conclusions
In the previous sections it has been assumed that all of the initial conditions are zero,
i.e., that:
P (s)
− = 0.
N(s)
If some of the initial conditions are not zero, then the previous expression is not
valid and the solutions y(t) found in the previous sections have to be completed
adding the function:
P (s)
w(t) = L−1 − .
N(s)
is still the characteristic polynomial N(s), then, according to the partial fraction
expansion method, w(t) contains the same functions of time contained in the natural
response yn (t) found in every case studied in the previous sections. This means
that the complete natural response in every one of the cases studied in the previous
sections must also include w(t).
It is said that the differential equation in (3.76) or, equivalently, that transfer
B(s)
function G(s) = N (s) , is:
• Stable if the natural response tends toward zero as time increases.
• Unstable if the natural response grows without a limit as time increases.
• Marginally stable if the natural response neither grows without limit nor tends
toward zero as time increases.
Assume that all of the cases studied in the previous sections, i.e., regarding the roots
of N (s), appear simultaneously. Recall that the roots of N (s) represent the poles of
G(s). The following can be concluded:
Conditions for the Stability of a Transfer Function
1. If all poles of G(s) have negative real parts then G(s) is stable.
2. If all poles of G(s) have negative real parts, except for some nonrepeated poles
having zero real parts then the transfer function G(s) is marginally stable.
3. If at least one pole of G(s) has a positive real part, then the transfer function G(s)
is unstable.
4. If there is at least one pole of G(s) with a zero real part which is repeated at least
twice, then G(s) is unstable.
On the other hand, it has also been seen that yf (t) depends on the input u(t)
and that, in fact, both of them are represented by “similar” time functions if the
characteristic polynomial has no root at s = 0, i.e., if G(s) has no pole at s = 0.
This means that in a control system, the input variable u(t) can be used as the value
it is desired that the output y(t) reaches, i.e., u(t) can be used to specify the desired
value for y(t). This is accomplished as follows. If the transfer function is stable, i.e.,
if yn (t) → 0, then y(t) → yf (t); hence, the only thing that remains is to ensure that
yf (t) = u. The conditions to achieve this when u = A is a constant are established
in the following.
Conditions to Ensure limt→∞ y(t) = A
The complete response y(t) reaches the desired output u = A as time increases,
i.e., yf (t) = A and yn (t) → 0, if G(s) is stable and the coefficients of the
independent terms of the polynomials B(s) and N(s) are equal, i.e., if B(0) = N (0).
This can be verified using the final value theorem (3.4):
B(s) A B(0)
lim y(t) = lim sY (s) = lim s = A = A. (3.95)
t→∞ s→0 s→0 N(s) s N (0)
Under these conditions, it is said that G(s) is a transfer function with unitary gain
in a steady state. When u is not a constant and it is desired that limt→∞ y(t) = u(t),
3.4 Arbitrary-Order Differential Equations 137
G(s) is also required to be stable, i.e., that yn (t) → 0, but some additional
conditions must be satisfied. The determination of these conditions and how to
satisfy them is the subject of the study presented in the subsequent chapters of this
book (see Sect. 4.4).
Example 3.17 Consider the situation presented in Example 3.14. From this exam-
ple, an experiment can be designed that allows us to know whether a system, a
differential equation or a transfer function is stable or unstable:
If the system is originally at “rest,” apply a pulse disturbance to it and observe
its evolution:
• If the system is stable then it “moves” and after a while it comes back to the
configuration where it was originally at “rest.”
• If the system is unstable, then it “moves” more and more such that it goes far
away from the configuration where it was originally at “rest.”
Example 3.18 Consider the mass-spring-damper system studied in Example 3.8,
but now assume that the spring is not present. Replacing K = 0 in (3.73) yields:
mẍ + bẋ = f.
and rearranging:
b kp kp
ẍ + ẋ + x = xd .
m m m
Using the Laplace transform and assuming that all of the initial conditions are zero,
the following is found:
kp
X(s)
G(s) = = m
kp
.
Xd (s) s2 + b
+
ms m
Then, using (3.95), it is found that the position reached in a steady state:
138 3 Ordinary Linear Differential Equations
kp kp
xd
lim x(t) = lim sX(s) = lim s m
kp
= m
kp
xd = xd ,
t→∞ s→0 s→0 s2 + b
+ s
ms m m
equals the desired position xd . The reason for this result can be explained using,
again, everyday experience: when x = xd , the force produced according to (3.96) is
f = 0; hence, the mass can stop and remain at that position. Moreover, if x < xd ,
then f > 0 and the mass increases its position x approaching xd (see Fig. 3.18 to
recall that x increases in the same direction where f is positive). If x > xd , then
f < 0 and the mass position x decreases, approaching xd again.
As an exercise, the reader is to verify that, in the case where a spring is present,
i.e., when K > 0, then limt→∞ x(t) = xd if xd = 0. Notice, however, that again
this can be explained using everyday experience:
If x = xd then, according to (3.96), the external force applied to the mass is zero
f = 0 and the friction force is also zero −bẋ = 0, if it is assumed that the mass
is at rest. However, if x = xd = 0 then the force of the spring on the mass −Kx
is different from zero; hence, the mass will abandon the position x = xd = 0. The
mass will reach a position x such that the force of spring and the force f in (3.96)
exactly cancel each other out, i.e., where kp (xd − x) = Kx.
Systems of orders greater than two are known as higher-order systems. Contrary to
first and second order systems, in higher-order systems it is not possible to perform
a detailed graphical study of the solution y(t). The main reason for this is the
complexity of the expressions arising when the transfer function has three or more
poles. Hence, it is important to approximate a higher-order system using a system
with a smaller order. There are two ways of accomplishing this: i) The approximate
cancellation of some poles with some zeros of the corresponding transfer function,
and ii) Neglecting the effect of “fast” poles. Some examples are presented in the
following.
k(s − d)
Y (s) = U (s). (3.97)
(s − p1 )(s − p2 )
3.5 Poles and Zeros in Higher-Order Systems 139
k(s − d) A B C D
Y (s) = = + + . (3.98)
(s − p1 )(s − p2 ) s s − p1 s − p2 s
B ≈ 0,
k(p2 − d)A kA
C≈ = ,
(p2 − d)p2 p2
kA
D≈− ,
p2
to finally obtain:
kA p2 t kA
y(t) ≈ e − .
p2 p2
kA p2 t kA
y(t) = e − ,
p2 p2
with U (s) = A/s and k = −p2 . Thus, the following is concluded. If one pole
and one zero of a transfer function are very close, then they approximately cancel
each other out to obtain a reduced order transfer function. This means that (3.99)
can be used instead of (3.97) to obtain very similar results. The advantages of using
the model in (3.99) are: i) it is a model with a smaller order than (3.97), and ii) it
has no zero. The advantage of using a reduced order model, which approximately
describes a higher-order system is that the response of a reduced order system can
often be handled as that of a first- or a second-order system. On the other hand, a
zero in a transfer function modifies the time response in a manner that is not easy to
quantify; hence, a transfer function that has no zeros is preferable.
It is important to say that the simplification obtained by the cancellation of one
pole and one zero is useful only if the pole and the zero have negative real parts.
This is because one pole with a positive real part, which is not exactly cancelled
because of parameter uncertainty, has a dangerous effect that becomes larger as
time increases.
k d
Y (s) = U (s), (3.100)
s+ 1
RC
s+a
where U (s) = A/s. Using partial fraction expansion, the following is found:
k d A B C D
Y (s) = = + + . (3.101)
s+ 1
RC
s+a s s + RC
1 s+a s
If a
1
RC > 0, then:
d A
B ≈ −k 1
,
a RC
dA
C≈k
D.
a2
Hence, using (3.101) and neglecting C, the following is found:
d A − 1 t d A
y(t) ≈ −k 1
e RC + k 1 .
a RC RC
a
with U (s) = A/s. Thus, (3.102) can be used instead of (3.100). The condition
a
RC 1
is interpreted as “the pole at s = −a is very fast compared with the pole at
s = − RC 1
”. The pole at s = − RC1
is known as the dominant pole because its effect
is more important in the system response. The following is concluded. If one pole is
much faster than the others, then a reduced order transfer function can be obtained
by neglecting the fastest pole to only maintain the dominant (the slowest) poles. An
accepted criterion is that the fastest poles (those to be neglected) have a real part that
is five times the real parts of the dominant poles (those to be kept). Notice, however,
that it is not just a matter of simply eliminating the factor s + a at the denominator
of the transfer function: the constant a still appears at the denominator of (3.102)
because a is necessary to keep without change the steady-state gain of the transfer
function in (3.100).
A simple way of obtaining (3.102) from (3.100) is the following:
k d k d
Y (s) = U (s) = U (s). (3.103)
s+ 1
RC
s+a s + RC a( a s + 1)
1 1
kd
Y (s) ≈ U (s),
a(s + 1
RC )
dia
La = υ − Ra ia − ke ω,
dt
dω
J = km ia − Bω, (3.104)
dt
where ω is the motor velocity (also see (10.9) and (10.10) in Chap. 10). Suppose
that this motor actuates on a hydraulic mechanism, which, by centrifugal effect,
produces a water flow, qi , which is proportional to the motor velocity, i.e., qi = γ ω,
where γ is a positive constant. Finally, this water flow enters the tank in Example 3.2
in the present chapter, whose mathematical model is given in (3.28), rewritten here
for ease of reference:
dh
+ ah = kqi
dt
1 1
a= , k= .
RC C
Using the Laplace transform (3.2) and assuming that all the initial conditions are
zero, it is not difficult to verify that the corresponding equations become:
1/La
I (s) = Ra
(V (s) − ke ω(s)), (3.105)
s+ La
km /J
ω(s) = I (s), (3.106)
s+ B
J
1/C
H (s) = Qi (s). (3.107)
s+ 1
RC
km /J 1/La
ω(s) = (V (s) − ke ω(s)).
s+ B
J s+ Ra
La
km /J 1/La
ω(s) =
J (V (s) − ke ω(s)).
Bs +1
B Ra La
J La Ra s + 1
3.5 Poles and Zeros in Higher-Order Systems 143
In small motors, the inductance La and the viscous friction coefficient B are small;
La La
hence, R a
BJ . Thus, it can be assumed that R a
s
1 and the following can be
written:
1 km
ω(s) = (V (s) − ke ω(s)).
s+ B
J
J Ra
km
ω(s) = JR V (s).
km ke
s+ B
J + J Ra
1 km
H (s) = C
γ JR V (s).
s+ 1
s+ km ke
J + J Ra
B
RC
If the tank cross-section is large enough, the motor will reach its nominal velocity
a long time before the water level in tank increases significantly. This can be stated
by saying that “the tank time constant is very large compared with the motor time
constant,” i.e., RC
B 1km ke . Then, it is possible to say that B 1km ke s
1; hence,
J + J Ra J + J Ra
the following approximation is valid:
γ km
H (s) = C JR V (s),
1
RC (RCs + 1) B
+ km ke
J J Ra
or:
1 km
JR γ
H (s) = C
V (s).
s+ 1
RC
B
+ km ke
J J Ra
Then, defining:
km
JR γ
k1 = km ke
,
J + J Ra
B
144 3 Ordinary Linear Differential Equations
and comparing with (3.107), the expression in (3.139) is justified, i.e., that the
water flow is proportional to the voltage applied to the motor through a constant
k1 . This is possible if: 1) the motor electrical time constant is smaller than the motor
La
mechanical time constant, i.e., if R a
BJ , and 2) if the tank time constant is very
large compared with the complete motor time constant, i.e., if RC
B 1km ke .
J + J Ra
km ke
Finally, it is important to say that this procedure is valid because B
J + J Ra > 0 and
Ra
La > 0, i.e., the neglected poles are negative.
The simplicity of first- and second-order systems allows us to compute their exact
solutions. However, in the case of systems represented by differential equations
of an order greater than 2, also called higher-order systems, the complexity of
the problem prohibits us from obtaining their exact solutions for control purposes.
The traditional treatment of higher-order systems in classical control has been to
approximate their response as a kind of extrapolation of responses obtained in first-
and second-order systems.
According to the studies presented in Sects. 3.1 and 3.3, the poles of first-
and second-order systems can be located on the s complex plane, as depicted in
Fig. 3.22. Then, the distance of a pole to the origin, s = 0, is representative of
the response time: the larger this distance, the shorter the response time. The angle
between the imaginary axis and the location vector of the pole is representative of
how damped the response is: the closer this angle is to zero, the more oscillatory the
response; conversely, the closer this angle is to 90◦ , the less oscillatory the response.
a
c
ζ2
e d
c Re (s)
a !n1
!n2
b
!n3
3.6 The Case of Sinusoidal Excitations 145
1.5
1
y(t)
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time [s]
Fig. 3.23 Relative response of two systems with real poles (see Fig. 3.22). Dashed: pole at s = d.
Continuous: pole at s = e
The responses of two first-order systems are compared in Fig. 3.23. The location
of the respective real poles is depicted in Fig. 3.22. It is observed that a faster
response if obtained, as the pole is located farther to the left of the origin.
The responses of three second-order systems are compared in Fig. 3.24. The
location of the respective pair of complex conjugate poles is depicted in Fig. 3.22. It
is observed that (i) a shorter response time is achieved as poles are located farther
from the origin, and (ii) a less oscillatory response is achieved as the poles are
located closer to the real axis.
The above results are applied to higher-order systems by considering the worst
case, i.e., by observing the “slowest” pole (the closest pole to the origin) and the
“least damped” pole (the closest pole to the imaginary axis).
Y (s) E(s)
= G(s) = , (3.108)
U (s) N(s)
N(s) = s n + an−1 s n−1 + · · · + a1 s + a0 ,
E(s) = b0 + b1 s + · · · + bm s m ,
146 3 Ordinary Linear Differential Equations
1.6
1.4
1.2
1
y(t)
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
time [s]
Fig. 3.24 Relative response of three systems with complex conjugate poles (see Fig. 3.22).
Continuous: poles at s = b and s = b̄. Dash–dot: poles at s = a and s = ā. Dashed: poles at
s = c and s = c̄
ω Cs + D
Y (s) = G(s)A = Yn (s) + 2 , (3.109)
s2 +ω 2 s + ω2
where Yn (s) = L{yn (t)} is the natural response, i.e., those terms arising from the
roots of N (s). Recall that limt→∞ yn (t) = 0 if G(s) is stable. As N (s) has been
assumed not to have any roots on the imaginary axis, then G(s) has no poles at
s = ±j ω. Multiplying both sides of (3.109) by the factor s 2 + ω2 and evaluating at
s = j ω, it is found:
ωAG(j ω) = j ωC + D.
Cs + D s ω
= AIm(G(j ω)) 2 + ARe(G(j ω)) 2 .
s +ω
2 2 s +ω 2 s + ω2
3.6 The Case of Sinusoidal Excitations 147
) )
(j!
2 (G
Im
) )+
(j! Im (G ( j!) )
2 (G
√ Re
Re (G ( j!) )
Cs + D
L−1 = A[Im(G(j ω)) cos(ωt) + Re(G(j ω)) sin(ωt)].
s 2 + ω2
Using Fig. 3.25 and the trigonometric identity, sin(α) cos(β) + cos(α) sin(β) =
sin(α + β), the following is obtained:
Cs + D
L−1 = A|G(j ω)| [sin(φ) cos(ωt) + cos(φ) sin(ωt)], (3.110)
s 2 + ω2
= B sin(ωt + φ),
B = A|G(j ω)|,
Im(G(j ω))
φ = arctan ,
Re(G(j ω))
|G(j ω)| = Re2 (G(j ω)) + Im2 (G(j ω)).
K 1
s 2 X(s) + X(s) = F (s).
m m
Notice that this expression has the form:
F0 ω
F (s) = ,
s2+ ω2
3.6 The Case of Sinusoidal Excitations 149
then:
γ ω 3 F0
X(s) = .
(s 2 + ω2 )2
As + B Cs + D
X(s) = + 2 .
(s 2 + ω2 )2 s + ω2
where β1 , β2
, φ1 , φ2 are some real constants. The solution x(t) is shown in Fig. 3.26
when ω = K m = 10[rad/s], m = 1[Kg] and F0 = 1[N]. This phenomenon is
known as resonance and it means that the output reaches very large values despite
the input being a bounded sine function of time. Notice that this may happen even
if the characteristic polynomial has no roots with positive real parts nor located at
s = 0. Thus, this is a different phenomenon to that described in Example 3.14. Also
notice that resonance appears when a system is poorly damped (ζ ≈ 0) and the
input is an oscillatory signal whose frequency is the same as (or very close to) the
system natural frequency. As the mass position grows without a limit, resonance is
a phenomenon that is considered to be dangerous.
0.8
0.6
0.4
0.2
x [m]
−0.2
−0.4
−0.6
−0.8
−1
0 2 4 6 8 10 12 14 16 18 20
t [s]
Scope
1
2
Signal InputOutput
Generator
Figure 3.26 has been obtained using the MATLAB/Simulink simulation diagram
presented in Fig. 3.27. The signal generator block is programmed to have a sine
wave form, unit amplitude and 10[rad/s] as frequency. Once the simulation stops,
the following MATLAB code is executed in an m-file to draw Fig. 3.26:
nn=length(InputOutput(:,2));
n=nn-1;
Ts=20/n;
t=0:Ts:20;
plot(t,InputOutput(:,2),’k-’);
axis([0 20 -1 1])
xlabel(’t [s]’)
ylabel(’x [m]’)
Example 3.21 Consider a linear system with transfer function:
Y (s) 10
= G(s) = , y(0) = 0.
U (s) s+5
Suppose that u(t) = A sin(5t + 90◦ ), with A = 1. As G(s) only has one pole at
s = −5 and ω = 5 in this case, according to (3.109), Yn (s) = s+5
h
where:
10 ω 10 × 5
h = (s + 5) = 2 = 1.
s + 5 s + ω s=−5
2 2 5 + 52
i.e.,:
3.6 The Case of Sinusoidal Excitations 151
10 −j ω + 5
G(j ω) = ,
jω + 5 −j ω + 5
10(−j ω + 5)
= ,
25 + ω2
√
10 25 + ω2 −ω
= √ 2
arctan ,
25 + ω2 5
10 −ω
|G(j ω)| = √ , φ = arctan .
25 + ω2 5
10 2 √
|G(j ω)| = √ = √ = 2, φ = −45◦ .
25 + 25 2
Thus:
√
y(t) = e−5t + 2 sin(5t + 45◦ ).
This response is depicted in Fig. 3.28. Notice that the difference between y(t) and
yf (t) at t = 0.2 = 1/5[s] is equal to 1.38 − 1.015 = 0.3650 ≈ e−5(0.2) , i.e., the
natural response yn (t) = e−5t evaluated at t = 0.2[s]. This fact corroborates the
above results.
Figure 3.28 has been obtained using the MATLAB/Simulink diagram presented
in Fig. 3.29. The sine wave block is programmed to be a time-based block, with
unit amplitude, zero bias, 5[rad/s] as the frequency, and 1.57[rad], i.e., 90◦ , as the
phase. The sine wave 1 block is programmed to be a time-based block, with 1.4142
as amplitude, zero bias, 5[rad/s] as the frequency, and 1.57/2[rad], i.e., 45◦ , as the
phase. Once the simulation stops, the following MATLAB code is executed in an
m-file to draw Fig. 3.28:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=2/n;
t=0:Ts:2;
plot(t,InputOutput(:,1),’k-.’,t,InputOutput(:,2),
’k-’);
hold on
plot(t,InputOutput(:,3),’k--’);
axis([0 2 -1.5 1.5])
xlabel(’time [s]’)
hold off
152 3 Ordinary Linear Differential Equations
10
Scope
s+5
InputOutput
where n ≥ m. Assume that all of the initial conditions are zero. Also assume that
y1 (t) is the solution of (3.116) when u1 (t) is applied at the input and y2 (t) is the
solution of (3.116) when u2 (t) is applied at the input. Then, α1 y1 (t)+α2 y2 (t), where
α1 and α2 are arbitrary constants, is the solution of (3.116) when α1 u1 (t) + α2 u2 (t)
is applied at the input.
One way of verifying this result is presented in the following. As the differential
equation in (3.116) is linear and all the initial conditions are zero, then it can be
expressed in terms of the corresponding transfer function:
This is possible because α1 and α2 are constants. This expression corroborates that
α1 y1 (t) + α2 y2 (t) is the solution of (3.117); hence, the solution of (3.116) when
α1 u1 (t) + α2 u2 (t) is the input.
Example 3.22 Obtain the indicated voltage at impedance Z4 (s) in Fig. 3.30a. This
circuit can be simplified using the so-called source transformation theorem.
Theorem 3.1 (Source Transformation [5, 11], Chap. 9, pp. 61)
• When an impedance, Z(s), and a voltage source, Vf v (s), are series-connected
between two terminals a and b, they can be replaced by a current source, If c (s),
parallel-connected to the same impedance, Z(s). The magnitude of the current
source is given as If c (s) = Vf v (s)/Z(s).
• When an impedance, Z(s), and a current source, If c (s), are parallel-connected
between two terminals a and b, they can be replaced by a voltage source, Vf v (s),
series-connected to the same impedance, Z(s). The magnitude of the voltage
source is given as Vf v (s) = Z(s)If c (s).
Applying the first part of this theorem to voltage sources V1 (s) and V2 (s), circuit in
Fig. 3.30b is obtained where:
154 3 Ordinary Linear Differential Equations
Z 1(s) Z 5(s)
Z 3(s)
Z 3(s)
I 3(s)
I a (s)
Z 3(s)
V1 (s) V2 (s)
I1 (s) = , I2 (s) = . (3.118)
Z1 (s) Z5 (s)
It is clear that Z1 (s), Z2 (s) and Z5 (s) are parallel-connected and its equivalent
impedance is given as (see (2.69)):
1
Za (s) = .
1
Z1 (s) + 1
Z2 (s) + 1
Z5 (s)
Using this and combining the current sources, the circuit in Fig. 3.30c is obtained.
Now, another important result in network analysis is employed: the current divider.
3.7 The Superposition Principle 155
Fact 3.1 (Current Divider [5], pp. 38) When two parallel-connected impedances
are parallel-connected to a current source, the current flowing through any of the
impedances is given by the value of the current source multiplied by the opposite
impedance to impedance where the current is to be computed and divided by the
addition of the two impedances.
Applying this result in addition to Ohm’s Law to the circuit in Fig. 3.30c, the
following expressions are found:
Za (s)
I3 (s) = (I1 (s) + I2 (s)),
Za (s) + Z3 (s) + Z4 (s)
Vz4 (s) = Z4 (s)I3 (s),
where Vz4 (s) is voltage at impedance Z4 (s). Combining these expressions yields:
Za (s)Z4 (s)
Vz4 (s) = (I1 (s) + I2 (s)).
Za (s) + Z3 (s) + Z4 (s)
It is concluded that the voltage at Z4 (s) can be obtained, as the addition of the
voltages at Z4 (s) due to each one of the voltage sources, i.e., V1 (s) or V2 (s), when
the other source is put in short circuit (i.e., a zero value is assigned) and adding both
results. This is exactly what the superposition principle establishes. It is interesting
to say that the superposition principle has been established above in the present
section, assuming that the different applied inputs are directly added, and, after that,
they are applied to the system. However, this example shows that the superposition
principle is valid in linear systems, even when the voltage sources, V1 (s) and V2 (s),
cannot be added directly (see Fig. 3.30a).
Example 3.2 Computing of the voltage at impedance Z3 (s) in the circuit shown in
Fig. 3.31a is required. First, this circuit is simplified to obtain circuit in Fig. 3.31b.
Then, the source transformation theorem can be employed (see the previous
example) to obtain the circuit in Fig. 3.31c, where:
V1 (s)
I1 (s) = . (3.119)
Z1 (s)
Z 1(s)
+
Z 3(s)
+ –
V 1(s) Z 2(s) Z 4(s)
–
+ V 2(s)
–
Z 1(s) Z 3(s)
+ –
Z 3(s)
+ –
+ –
V 3(s) + + V 2(s)
– –
1
Za (s) = .
1
Z1 (s) + 1
Z2 (s) + 1
Z4 (s)
The equivalent impedance Za (s) is parallel connected to the current source I1 (s);
hence, the second part of the source transformation theorem can be used (see the
previous example) to obtain the circuit in Fig. 3.31d, where:
with Vz3 (s) voltage at the impedance Z3 (s). Combining these expressions and
using (3.119) yields:
Z3 (s)
Vz3 (s) = (V3 (s) − V2 (s)),
Za (s) + Z3 (s)
Z3 (s)
= (Za (s)I1 (s) − V2 (s)),
Za (s) + Z3 (s)
Z3 (s) Za (s)
= V1 (s) − V2 (s) .
Za (s) + Z3 (s) Z1 (s)
It is concluded, again, that the voltage at the impedance Z3 (s) can be obtained as
the addition of the voltages in Z3 (s) because of each one of the voltage sources, i.e.,
V1 (s) or V2 (s), when the other source is put in a short circuit (i.e., its value is set
to zero) and adding the two results. This example also shows that the superposition
principle is valid in linear systems, even when the voltage sources V1 (s) y V2 (s)
cannot be added directly (see Fig. 3.31a).
The simplicity of the first- and second-order systems allows us to design feedback
controllers whose effects can be explained relying on the exact solution of the
closed-loop system. This is shown in the present section by applying this methodol-
ogy to some physical systems.
158 3 Ordinary Linear Differential Equations
di
L = u − R i − n ke ω,
dt
J ω̇ = −b ω + n km i − Tp . (3.120)
u − n ke ω
0 = u − R i − n ke ω ⇒ i= . (3.121)
R
Replacing the electric current in (3.120) and rearranging:
n2 km ke n km
J ω̇ + b + ω= u − Tp . (3.122)
R R
where kp is a constant known as the proportional gain, and ωd represents the desired
velocity given as a step signal of magnitude A, i.e., ωd (s) = As . The closed-
loop system is obtained by replacing u, given by the proportional controller, in the
previous equation, i.e.,:
n2 km ke n km
J ω̇ + b + ω= kp (ωd − ω) − Tp . (3.124)
R R
This is a first-order system with two inputs. Then, we can apply superposition, i.e.,
define two signals ω1 and ω2 such that:
3.8 Controlling First- and Second-Order Systems 159
First, analyze the equation for ω1 , applying the Laplace transform with zero initial
conditions:
if we define:
b n2 km ke n km kp n km kp
b1 = + + = 0, b2 = = 0.
J JR JR JR
Notice that this expression has the same structure as the transfer function in (3.23).
Hence, if the parameters and variables b1 , b2 , ω1 and ωd are suitably associated with
those in (3.23), the solution ω1 (t) is the same as in (3.16), i.e.,:
b2 A −b1 t b2 A
ω1 (t) = − e + + ω1 (0)e−b1 t ,
b1 b1
Stability is ensured if, and only if, the only pole of G1 (s), located at s = −b1 , is
negative, i.e., −b1 < 0, which implies that:
JR b n2 km ke
kp > − + . (3.127)
n km J JR
If this is the case, then the final value of the velocity can be computed using the final
value theorem as:
Recall that A represents the magnitude of the desired velocity. As it is desirable for
the final value of the velocity to be close to A, it also desirable for bb21A to have the
same sign as A, i.e., b2 /b1 > 0. As b1 > 0, because of the stability requirement,
then b2 > 0 must also be true. This is ensured if kp > 0, which is in complete
agreement with (3.127). Hence, we can conclude that:
n km kp
b2 A
lim ω1 (t) = = JR
A < A, (3.128)
b1 n2 km ke nk k
t→∞ b
J + JR + JmR p
which means that the final velocity remains below the desired velocity. This result
may also be explained using everyday experience as follows. Assume for a moment
that limt→∞ ω1 (t) = A. Then, according to (3.123):
u = kp (A − ω) = 0,
the voltage applied at the motor terminals is zero. Hence, the motor tends to stop
moving, i.e., ω1 decreases to zero and cannot stay at the desired value A. This means
that ω1 < A will be obtained again. Hence, it is not possible to keep ω1 = A forever,
which justifies the result in (3.128).
The difference between the final velocity and A is known as the steady-state error
ess . We remark that, according to (3.128), the steady-state error can be arbitrarily
reduced by increasing kp > 0, although a zero steady-state error will never be
accomplished. On the other hand, if a specific steady-state error ess is required, the
corresponding value for kp can be computed as:
n km kp
ess = A − JR
A,
n2 km ke nk k
b
J + JR + JmR p
n2 km ke
J +
b
= JR
A,nk k
n2 km ke
+b
J JR + JmR p
b n2 km ke A b n2 km ke JR
kp = + − + .
J JR ess J JR n km
Notice that to ensure kp > 0, the steady-state error is required to be a fraction of the
desired velocity, i.e., ess = ρA with 0 < ρ < 1.
Now, consider the expression for ω2 . Using the Laplace transform:
b3
Notice that G2 (s) can be written as G2 (s) = s+b 1
, with b3 = − J1 , i.e., a transfer
function such as that in (3.126). Thus, we may proceed as before to conclude that:
− J1 d
lim ω2 (t) = d, Tp (s) = .
n2 km ke n km kp s
t→∞ b
J + JR + JR
The important observation in this expression is that the final value of ω2 can be
reduced by increasing kp > 0. This is good news, as ω2 is the velocity deviation
due to external disturbance Tp ; hence, it is desirable to keep ω2 close or equal to
zero, if possible. In this case, the deviation can be rendered arbitrarily small by
increasing kp > 0, but a zero deviation will never be achieved with a proportional
controller.
As the problem at hand is a first-order system, the transient response is
completely described by the time constant:
1 1
τ= = .
b1 n2 km ke n km kp
b
J + JR + JR
Recall that a faster response is obtained as τ is shorter. This means that a faster
response is obtained as kp > 0 is chosen to be larger. Moreover, if all the system
parameters are known and a desired time constant T is specified, then the required
proportional gain can be exactly computed as:
JR 1 b n2 km ke
kp = − + .
n km τ J JR
This means that, to ensure kp > 0, the closed-loop system is required to be faster
than the open-loop system, i.e.:
1 b n2 km ke
− + > 0.
τ J JR
β
δ
T1
T2 time
Fig. 3.32 Velocity response in the proportional control of velocity. Continuous: kp = 40 is used.
Dashed: kp = 12 is used. Dash–dot: desired velocity
Tp
1 Scope
12 s+7
wd Add
Add1 kp1 InputOutput
1
40 s+7
Add3 kp2 Add2
The following is MATLAB code that is executed in an m-file to draw Fig. 3.32
after simulation in Fig. 3.33 stops:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=1/n;
t=0:Ts:1;
plot(t,InputOutput(:,1),’k-.’,t,InputOutput(:,3),
’k-’);
hold on
3.8 Controlling First- and Second-Order Systems 163
plot(t,InputOutput(:,2),’k--’);
axis([-0.02 1 0 2.5])
xlabel(’time [s]’)
hold off
Consider the motor model in (3.122), but, now, expressed in terms of position θ , i.e.,
θ̇ = ω:
n2 km ke n km
J θ̈ + b + θ̇ = u − Tp . (3.129)
R R
Assume that the voltage applied at the motor terminals is computed according to the
following expression:
u = kp (θd − θ ) − kv θ̇ ,
where kv is a constant known as the velocity gain, and θd represents the desired
position, which is assumed to be given as a step signal with magnitude A, i.e.,
θd (s) = As . This represents a controller known as proportional position control
plus velocity feedback. The closed-loop equation is found by replacing u in (3.129)
and rearranging terms, i.e.,:
n2 km ke n km
J θ̈ + b + θ̇ = kp (θd − θ ) − kv θ̇ − Tp , (3.130)
R R
b n2 km ke n km kv n km k p n km kp 1
θ̈ + + + θ̇ + θ= θd − Tp ,
J JR JR JR JR J
− J1
G2 (s) = .
n2 km ke n km kv n km kp
s2 + b
J + JR + JR s+ JR
164 3 Ordinary Linear Differential Equations
it is possible to write:
ωn2
G1 (s) = , (3.131)
s 2 + 2ζ ωn s + ωn2
n km kp b n2 km ke n km kv 1
ωn = ζ = + + .
JR J JR JR n km kp
2 JR
Notice that, under these conditions, the inverse Laplace transform of θ1 (s) =
G1 (s)θd (s), is identical to the function presented in (3.57). Hence, stability is
ensured if kp > 0, to ensure that both ωn and ζ are real numbers, and:
b n2 km ke n km kv
+ + > 0,
J JR JR
to ensure that ζ > 0. If this is the case, then we can use the final value theorem to
compute the final position as:
ωn2 A
= lim s = A.
s→0 s 2 + 2ζ ωn s + ωn2 s
Thus, the motor position reaches the constant desired position in a steady state. On
the other hand, according to (3.131), we conclude that:
• The closed-loop system is faster as kp > 0 is chosen to be larger. This is because
ωn increases as kp > 0 increases. However, as kp > 0 increases the system
becomes more oscillatory. This is because ζ decreases as kp increases.
• The system response is less oscillatory as kv > 0 is chosen to be larger. This is
because ζ increases as kv increases.
This means that the response can be rendered as fast and damped as desired merely
by suitably selecting both kp and kv .
Now, consider the equation for ω2 . Notice that this variable represents the
position deviation produced by an external torque disturbance. Hence, it is desirable
for ω2 to be close or equal to zero, if possible. Notice that G2 (s) is stable if is G1 (s)
stable, because both transfer functions have the same characteristic polynomial.
Thus, we can compute the final value of ω2 using the final value theorem when
the disturbance is a step signal, i.e., Tp (s) = ds :
3.8 Controlling First- and Second-Order Systems 165
− J1 d
= lim s ,
n2 km ke n km kv n km kp s
s→0 s2 + b
J + JR + JR s+ JR
− J1
= n km kp
d.
JR
This means that the steady-state deviation is not zero. However, the good news is
that this deviation can be arbitrarily reduced by increasing kp . We conclude that
a faster closed-loop system also results in smaller position deviations because of
constant external torque disturbances. This is corroborated by simulations shown in
Fig. 3.34, which were performed using the MATLAB/Simulink diagram in Fig. 3.35.
2
There, the closed-loop system in (3.130) is simulated using J = 1, b + n kRm ke =
7, and nkm /R = 70. These values were employed merely because they allow
representative, clearly appreciable, results to be obtained. The block theta_d is a
step applied at t = 0 with a zero initial value and 2 as a final value. The external
disturbance Tp is a step applied at t = 0.5[s] with a zero initial value and 7 × 70
as a final value. Once simulation in Fig. 3.35 stops, the following MATLAB code is
executed using an m-file to draw Fig. 3.34:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=1/n;
2.5
2
Position [rad]
1.5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time [s]
Fig. 3.34 Proportional control of the position with velocity feedback. Use of kp = 40 and kv =
0.45 (continuous) results in a faster response, but the same damping, than using kp = 12 and
kv = 0.2 (dashed). See (3.132)
166 3 Ordinary Linear Differential Equations
Tp
1 1
12
70 s+7 s
theta_d
Add5 kp1 Fcn Trans Integrator
Gain Add1
Add4 kv1
0.2
1 1
40 Scope
70 s+7 s
Add7 kp2 Add2 Fcn Trans1 Integrator1
Add6 Gain1
kv2 InputOutput
0.45
To Workspace
t=0:Ts:1;
plot(t,InputOutput(:,1),’k-.’,t,InputOutput(:,3),
’k-’);
hold on
plot(t,InputOutput(:,2),’k--’);
axis([-0.02 1 0 2.75])
xlabel(’time [s]’)
ylabel(’Position [rad]’)
hold off
Notice that in the case where some tr and Mp are specified, the use of expressions
in (3.71) allow the required ωn and ζ to be computed. These data and (3.131) allow
the corresponding controller gains to be computed as:
JR 2 b n2 km ke JR
kp = ω , kv = 2ζ ωn − + . (3.132)
n km n J JR n km
Using this procedure together with tr = 0.039[s], Mp = 29.9%, for the continuous
line in Fig. 3.34, results in kp = 40 and kv = 0.45, whereas tr = 0.071[s], Mp =
29.9%, for the dashed line, results in kp = 12 and kv = 0.2.
Consider the motor model in (3.129) in a closed loop with the following
proportional–derivative (PD) controller:
d
u = kp (θd − θ ) + kd (θd − θ ),
dt
3.8 Controlling First- and Second-Order Systems 167
i.e.,:
b n2 km ke n km kd n km k p n km kp n km kd 1
θ̈ + + + θ̇ + θ= θd + θ̇d − Tp ,
J JR JR JR JR JR J
where kd is known as the derivative gain. Using superposition and the Laplace
transform yields:
− J1
G2 (s) = .
n2 km ke n km kd n km kp
s2 + b
J + JR + JR s+ JR
Notice that except for the term n kJmRkd s in the numerator of G1 (s) and the use of
kd instead of kv in the denominator, we have exactly retrieved the same closed-
loop equations as in the previous example. Thus, we can proceed exactly as in the
previous example to conclude:
• Expressions in (3.131) stand again with kd instead of kv .
• Stability is ensured if kp > 0 and:
b n2 km ke n km kd
+ + > 0.
J JR JR
• If any external disturbance is not present, then the position reaches the constant
desired position in a steady state.
• The closed-loop system is faster as kp > 0 is chosen to be larger. This is because
ωn increases as kp > 0 increases. However, as kp > 0 increases, the system
becomes more oscillatory. This is because ζ decreases as kp increases.
• The system response is less oscillatory as kd > 0 becomes larger. This is because
ζ increases as kd increases.
• The response can be rendered as fast and damped as desired merely by suitably
selecting both kp and kd .
• If a step external torque disturbance Tp (s) = ds is present, then a position
deviation exists in a steady state and it is given as:
− J1
lim ω2 (t) = n km kp
d.
t→∞
JR
168 3 Ordinary Linear Differential Equations
On the other hand, to study the transient response notice that the transfer function
G1 (s) can be rewritten as:
kd 2
kp ωn s + ωn2
G1 (s) = ,
s 2 + 2ζ ωn s + ωn2
kd ωn2 ωn2
= s 2 + ,
kp s + 2ζ ωn s + ωn2 s 2 + 2ζ ωn s + ωn2
where:
n km kp b n2 km ke n km kd 1
ωn = , ζ = + + , (3.133)
JR J JR JR n km kp
2 JR
kd ωn2 ωn2
θ1 (s) = s 2 θd (s) + θd (s). (3.134)
kp s + 2ζ ωn s + ωn2 s 2 + 2ζ ωn s + ωn2
As θd (s) = As , notice that the inverse Laplace transform of the second term in
this expression is the function presented in (3.57), whereas the inverse Laplace
transform of the first term is the time derivative of the function in (3.57) multiplied
by the factor kkpd . This means that, although the shape of θ1 (t) is similar to that of
the function in (3.57), there are some differences. For instance, formulas for the
rise time and overshoot given in (3.71) are only approximate in the present control
problem.
In the case in which some tr and Mp are specified, use of the expressions in (3.71)
allow only approximate values for the required ωn and ζ to be computed. These data
and (3.133) allow approximate values for the corresponding controller gains to be
computed as:
JR 2 b n2 km ke JR
kp = ω , kd = 2ζ ωn − + .
n km n J JR n km
2
Some simulation results are presented in Fig. 3.36 when J = 1, b + n kRm ke = 7,
and nkm /R = 70. The corresponding MATLAB/Simulink diagram is shown in
Fig. 3.37. The block theta_d is a step applied at t = 0 with a zero initial value
and 2 as a final value. The external disturbance Tp is a step applied at t = 0.5[s]
with a zero initial value and 7 × 70 as a final value. When the simulation in Fig. 3.37
stops, the following MATLAB code is executed in an m-file to draw Fig. 3.36:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=1/n;
t=0:Ts:1;
plot(t,InputOutput(:,2),’k-.’,t,InputOutput(:,3),
3.8 Controlling First- and Second-Order Systems 169
2.5
2
Position [rad]
1.5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time [s]
Tp
1 1
40 70
s+7 s
theta_d
Add5 kp Add4 Integrator
Add1 Gain1 Transfer Fcn
kv
0.45
1 Scope1
PID(s) 70
s2+7s
Add7 Gain2 Add2 Transfer Fcn1
PD Controller InputOutput
To Workspace1
’k-’);
hold on
plot(t,InputOutput(:,1),’k--’);
axis([-0.02 1 0 3])
xlabel(’time [s]’)
ylabel(’Position [rad]’)
hold off
170 3 Ordinary Linear Differential Equations
The dashed line represents the desired response, i.e., the inverse Laplace
transform of:
ωn2
θd (s), (3.135)
s 2 + 2ζ ωn s + ωn2
This is a second-order system with two inputs. Then, superposition has to be used,
i.e., to define two signals ω1 and ω2 such that:
First, analyze the equation for ω1 . Applying the Laplace transform with zero initial
conditions:
to find:
n km ki b n2 km ke n km kp 1
ωn = > 0, ζ = + + . (3.138)
JR J JR JR n km ki
2 JR
These expressions require ki > 0 to ensure that ωn and ζ are real numbers. On the
other hand, ζ > 0 is true if kp is chosen to satisfy:
JR b n2 km ke
kp > − + .
n km J JR
Hence, G1 (s) is a stable transfer function and, thus, the velocity final value can be
computed using the final value theorem:
Fig.
t
3.38 The integral e [m]
0 (ωd − ω1 (r))dr is
represented by the shadowed
area under function
e = ωd − ω1 . In this figure it
is assumed that
ωd = A > ω1 (0)
t [s]
kp ωn2 ωn2
ω1 (s) = s 2 ωd (s) + ωd (s).
ki s + 2ζ ωn s + ωn2 s 2 + 2ζ ωn s + ωn2
As ωd (s) = As , notice that the inverse Laplace transform of the second term in
this expression is the function presented in (3.57), whereas the inverse Laplace
transform of the first term is the time derivative of the function in (3.57) multiplied
k
by the factor kpi . This means that, although the shape of ω1 (t) is similar to that
of the function in (3.57), there are some differences. For instance, the rise time
and overshoot formulas given in (3.71) are only approximate in the present control
problem. This is a similar situation to that found in the study of the transient
3.8 Controlling First- and Second-Order Systems 173
− J1 s
ω2 (s) = Tp (s).
n2 km ke n km kp n km ki
s2 + b
J + JR + JR s+ JR
− J1 s d
= lim s = 0,
n2 km ke n km kp n km ki s
s→0 s2 + b
J + JR + JR s+ JR
when the external torque disturbance is a step signal, i.e., Tp (s) = ds . Recall that
it has already been ensured that the characteristic polynomial in this expression has
two poles with a negative real part. Hence, the steady-state velocity deviation due to
a constant external torque disturbance is zero, which is very good news.
The closed-loop response of velocity under PI control is shown in Fig. 3.39
2
where J = 1, b + n kRm ke = 7, and nkm /R = 70 are used. These values are
employed merely because they allow representative, clear, responses to be obtained.
The corresponding MATLAB/Simulink diagram is shown in Fig. 3.40. The block
ωd is a step applied at t = 0 with a zero initial value and 2 as a final value. The
external disturbance Tp is a step applied at t = 0.5[s] with a zero initial value and
0.4 × 70 as a final value. Once the simulation stops, the following MATLAB code
is executed in an m-file to draw Fig. 3.39:
nn=length(InputOutput(:,1));
n=nn-1;
Ts=1/n;
174 3 Ordinary Linear Differential Equations
2.5
Velocity [rad/s] 2
1.5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
time [s]
Fig. 3.39 PI velocity control when a constant external disturbance appears at t = 0.5[s]. The PI
controller gains are kp = 0.7 and ki = 10. Continuous: velocity ω(t). Dashed: desired velocity ωd
Tp
1
PID(s) 70 Scope
s+7
w_d Add1
Add Gain
InputOutput
t=0:Ts:1;
plot(t,InputOutput(:,1),’k--’,t,InputOutput(:,2),
’k-’);
axis([-0.02 1 0 2.5])
xlabel(’time [s]’)
ylabel(’Velocity [rad/s]’)
Notice that the velocity reaches its desired value before and after a constant
external torque disturbance appears at t = 0.5[s].
3.8 Controlling First- and Second-Order Systems 175
Consider the water level system studied in Example 3.2 and depicted in Fig. 3.3.
Suppose that a water pump is employed to produce a water flow qi that is
proportional to the voltage u applied at motor terminals actuating on the pump,
i.e.,:
qi = k1 u, (3.139)
dh
+ ah = kk1 u.
dt
Notice that this differential equation can also be represented by a transfer function
with the form:
Y (s) b2
G(s) = = . (3.140)
U (s) s + b1
Hence, identical conclusions are obtained as those for the proportional control of
velocity, if a proportional level controller is used, or those for a proportional–integral
velocity controller, if a PI level controller is used. Moreover, identical conclusions
are valid for any first order plant with transfer function having the same structure as
in (3.140).
On the other hand, first order systems represented by (3.140) do not need use of
a controller with a derivative action. This can be explained as follows. Suppose that
the following proportional–integral–derivative (PID) controller:
t
de
u = kp e + kd + ki e(r)dr, e = yd − y
dt 0
Y (s) b2 kd s 2 + b2 kp s + b2 ki
H (s) = = . (3.141)
Yd (s) (1 + b2 kd )s 2 + (b1 + b2 kp )s + b2 ki
Notice that the characteristic polynomial is second degree. Thus, only two free
parameters are necessary to assign the corresponding two roots at any location on
the s complex plane, i.e., to achieve any desired transient response. However, three
free parameters appear in this characteristic polynomial, i.e., kp , kd and ki . Hence,
one of them is not necessary, i.e., kd .
On the other hand, the transfer function in (3.141) has polynomials at the
numerator and the denominator having the same degree, i.e., it has the same number
of poles and zeros. It has been shown in Examples 3.6 and 3.7 that time response
of a system whose transfer function has the same number of poles and zeros is
discontinuous when a step input is applied. It is important to remark that such
a response is not possible, for instance, in a velocity control system because the
velocity cannot be discontinuous. This is due to the fact that such a response
would require a very large voltage to be applied at the motor terminals during a
very short time interval. Mathematically, this is explained by the time derivative
of the desired value yd (a discontinuous, step signal) which is introduced by the
derivative action of a controller. However, such large voltage spikes are not possible
in practice. Thus, an unpredictable response is expected. Moreover, in the case of a
velocity control system, the derivative action on velocity (equivalent to acceleration
measurements, a very noisy signal) results in a strong amplification of noise, as
velocity measurements are recognized to be noisy signals.
Thus, it is concluded that any performance improvement is not expected when
using a PID controller with respect to performance achieved with a PI controller for
first-order plants.
di
L = −v − v0 sign(i) + E(t), (3.142)
dt
dv
C = i, (3.143)
dt
dv0 v0
C0 = abs(i) − , (3.144)
dt R
3.9 Case Study 177
where:
+1, i > 0
sign(i) = , (3.145)
−1, i < 0
whereas abs(i) stands for the absolute value of i. The operation of this circuit
is studied in the present section through the solution of the mathematical model
in (3.142)–(3.144). Performing a coordinate change for the variables involved is
very useful. Hence, the following variables are defined (see Sect. 2.5, Chap. 2, for
an explanation of the meaning of the parameters involved):
i L v v0 t
z1 = , z2 = , z3 = , τ=√ . (3.146)
E C E E LC
Figs. 2.34a, 2.35 and 2.36. On the other hand, the transistors Q2 , Q4 are turned on
when z1 < 0, i.e., when i < 0, and hence u = −1 because E(t) = −E in this case.
One way of achieving this is by designing u = sign(z1 ), where sign(z1 ) = +1
if z1 > 0 and sign(z1 ) = −1 if z1 < 0. This means that, according to (3.147)
and (3.148), the evolution of the resonant variables can be described as:
z̈4 + z4 = 0. (3.152)
where the following Laplace transform pairs have been employed [4], Ch. 32:
s
L−1 = cos(aτ ),
s 2 + a2
a
L−1 2 = sin(aτ ),
s + a2
whereas z40 = z4 (0) = z2 (0) − ve and ż40 = ż4 (0) = z1 (0). Differentiating (3.153)
once with respect to τ yields:
If the solution of (3.152) is plotted on the phase plane ż4 − z4 , then a circle
is obtained whose center is located at origin (z4 , ż4 ) = (0, 0), and the radius
is determined by the initial conditions, i.e., z40 2 + ż2 . Moreover, according to
40
z4 = z2 − ve and ż4 = z1 , it is concluded that the solution of (3.150), (3.151), when
the phase plane z1 − z2 , is a circle centered at (z2 , z1 ) = (ve , 0), with
plotted on
a radius (z20 − ve )2 + z10 2 where z
20 = z2 (0) and z10 = z1 (0). It is important
to say that, according to (3.150) and (3.151), the values of z1 and z2 cannot be
discontinuous because that would require infinite values for ż1 and ż2 respectively,
which is not possible as the right-hand sides of (3.150) and (3.151) cannot take
infinite values. This means that, when combining the solutions in both regions, i.e.,
when z1 > 0 and when z1 < 0, the initial conditions on each region must be equal
to the final values reached in the previous region. Hence, Fig. 3.41 is obtained. The
closed trajectory shown in this figure indicates that the resonant variables z2 , z1 , i.e.,
v and i, have sustained oscillations. It should be noted that this closed trajectory is
clockwise-oriented because, according to (3.151), z2 grows when z1 > 0, i.e., if
ż2 > 0 then z2 grows, and z2 decreases when z1 < 0. Notice that ve can only take
two different values, 1−z3 when z1 > 0, and −(1−z3 ) when z1 < 0. Thus, the only
way in which the situation represented in Fig. 3.41 can be obtained is that z3 = 1,
i.e., that ve = 0, in both regions. This means that the output voltage is equal to the
power supply voltage, i.e., v0 = E.
Z1
Z2
(–1+Z3, 0) (1–Z3, 0)
z1
s=0
z 1 = γz 2
z 1 > γz 2
z1 > 0
Q1, Q3
z 1 < γz 2
z1 > 0
D2, D4
– 1 – z3 – 1 + z3 1 – z3 1 + z3 z2
D1, D3 Q2, Q4
z 1 > γz 2 z 1 < γz 2
z1 < 0 z1 < 0
⎧
⎪
⎪ 1 − z3 , Q1 , Q3 in saturation, (z1 > γ z2 , z1 > 0)
⎨
−(1 − z3 ), Q2 , Q4 in saturation, (z1 < γ z2 , z1 < 0)
ve =
⎪
⎪ 1 + z3 , D1 , D3 conduct, (z1 > γ z2 , z1 < 0)
⎩
−(1 + z3 ), D2 , D4 conduct, (z1 < γ z2 , z1 > 0)
This means that, again, and according to arguments between (3.150) and the
paragraph after (3.155), the resonant variables describe circles on the z2 − z1 plane.
Radii of these circles are determined by the initial conditions in each region, which
are equal to the final values in the previous region. The center of these circles is
located at the following points, depending on the operation region:
Figure 3.42 depicts the corresponding situation when γ = 3. Notice that, again,
the resonant variables z2 , z1 , i.e., v and i, describe sustained oscillations. To obtain
the closed trajectory shown in Fig. 3.42, we may proceed as follows. Propose any
z3 < 1 and any point in the z2 − z1 plane as an initial condition. Using a pair
of compasses, draw circles centered at the above indicated points according to the
respective operation region. According to the previous discussion and (3.151), these
circles are clockwise-oriented. The reader will realize that an helix appears similar
to the dashed line in Fig. 3.42, which finally ends on a closed trajectory. The fact
that this closed trajectory is reached from any initial point on the z2 − z1 plane is
indicative that it is stable or attractive. It is possible to proceed analogously using
some z3 > 1 to verify that a closed trajectory is also reached in such a case. This
is indicative that in a series resonant converter is not possible to deliver, in a steady
state, an output voltage v0 larger than the power supply voltage E, i.e., z3 > 1 is not
possible in a steady state. If an output voltage v0 > E is desired, then the parallel
resonant converter shown in Fig. 2.34b is a suitable alternative.
On the other hand, arcs with a center at (z2 , z1 ) = (1 − z3 , 0) and (z2 , z1 ) =
(−1 − z3 , 0), shown in Fig. 3.42, are drawn one after the other. Then, if both of
them were centered at origin (z2 , z1 ) = (0, 0), they would together span a 180◦
angle. However, using basic geometry in Fig. 3.42 it is possible to conclude that
arcs with the center at (z2 , z1 ) = (1 − z3 , 0) and (z2 , z1 ) = (−1 − z3 , 0) together
describe an angle smaller that 180◦ despite completing a semicircle on both resonant
variables z2 , z1 . Hence, the four arcs composing the whole closed trajectory in
Fig. 3.42 together describe an angle smaller that 360◦ despite a complete cycle being
described on both resonant variables. Notice that each one of these arcs is covered
at a frequency that is still ωn = 1, but, according to the above description, less
time is now required to complete an oscillation as the four arcs together describe a
182 3 Ordinary Linear Differential Equations
smaller angle at the same angular frequency. Thus, the resonant variables oscillate
at a frequency ωo , which is larger than ωn = 1, i.e., ωo > ωn . Using (3.146), it is
possible to verify that:
ωn 1 ωo
ωnt = √ =√ , ωot = √ > ωnt ,
LC LC LC
where ωnt and ωot stand respectively, for the resonance frequency and the operation
frequency, expressed with respect to real time t. Hence, it is concluded that the
circuit must operate at frequencies that are greater than the resonance frequency to
deliver output voltages smaller than the power supply voltage v0 < E, i.e., z3 < 1.
This is the reason why, when the transistors are activated according to u = sign(s),
the circuit in Figs. 2.34a and 2.35 is designated as DC-to-DC high-frequency series
resonant power electronic converter. Further information on DC-to-DC resonant
power electronic converters can be found in [8], where converters of this class (series
and parallel) are designed, constructed, controlled, and experimentally tested, and
[7], where the method used here to analyze series resonant converters drawing arcs
of a circle is studied. On the other hand, the use of the phase plane z2 − z1 to study
the operation of resonant power converters was introduced for the first time in [9]
and [10].
3.10 Summary
1. Why is a transfer function unstable if it has one pole with a zero real part that is
repeated two or more times?
2. It has been said that the forced response has the same waveform as the input.
Explain why this is not ensured if the transfer function has poles with a zero real
part. Give an example of an input and a transfer function where this happens.
3. When an incandescent lamp is turned on it becomes hot. However, its tempera-
ture does not grow to infinity, but it stops at a certain value. Of the differential
equations that have been studied in this chapter, which is the one that better
describes the evolution in time of the incandescent lamp temperature? Why?
4. What is the relationship between a transfer function and a differential equation?
5. What are the conditions that determine the stability of a transfer function?
6. What are the necessary assumptions for a permanent magnet brushed DC motor
to behave as an integrator or a double integrator?
7. How do you think the natural response waveform of a second-order differential
equation whose characteristic polynomial has two real, repeated, and negative
roots?
8. It has been explained that the time functions composing the natural response
are determined by the transfer function poles, i.e., roots of the characteristic
polynomial, but what is the effect of the transfer function zeros? What do you
think determines the coefficients when using partial fraction expansion to apply
the inverse Laplace transform? (see Sects. 3.1 and 3.5).
184 3 Ordinary Linear Differential Equations
9. Indicate the zones of the s complex plane where the poles have to be located to
achieve (i) fast but not oscillatory responses, (ii) fast and oscillatory responses,
(iii) permanent oscillatory responses, and (iv) unstable responses.
3.12 Exercises
1. Consider the water level system in Example 3.2. The response in Fig. 3.43 is
obtained when a constant water flow qi is applied and the tank has a constant
cross-section of 0.5[m2 ]. Find the values of both R and qi .
2. Consider a proportional level control, i.e., when qi = k1 kp (hd − h), with hd
the constant desired level. Using the results in the previous exercise to find the
gain kp , such that the steady-state error is less than or equal to 20% of the
desired value and that the time constant is less than or equal to one third of
the time constant in the previous exercise, i.e., the open-loop time constant.
Find the maximal value of qi that must be supplied. This is important for
selecting the water pump to be employed. Suppose that the opening of the
output valve is increased such that its hydraulic resistance decreases to 50%.
Find the increment or the decrement, as a percentage, of the level steady-state
error and the new time constant.
h
[m]
t[s]
x
[m]
t[s]
Fig. 3.44 Mass position in a mass-spring-damper system when a constant force is applied at the
input. The dotted line stands for the final value of the mass position
find values of ζ , ωn and k in (3.53). With these values, write an expression for
y(t).
5. Consider the mass-spring-damper system described in Example 3.8. The
response shown in Fig. 3.44 is obtained when the constant force f =0.5[N] is
applied. Find the values of b, K, and m.
6. Consider the following transfer functions:
7. According to Sect. 3.1, it is known that from any initial condition the following
differential equation ẏ + 7y = 2 has a solution given as y(t) = Ee−7t + D
where E and D are some constants that are not going to be computed in this
exercise. Proceeding similarly, find the solution for each one of the following
differential equations.
ÿ + 4ẏ + y = 2,
−ÿ + ẏ + 10y = 3t,
ÿ + 7ẏ = 2 sin(t),
ÿ + 3ẏ + 2y = 2e−t ,
ÿ + 2ẏ + 2y = 2 cos(2t) − 4 sin(2t),
ÿ − 4y = 8t 2 − 4,
y (4) + 11y (3) + 28ÿ = 10.
8. For each one of the following differential equations, find the value of
limt→∞ y(t). Notice that the same result can be obtained, no matter what
the initial conditions are.
y (3) + ÿ − 2ẏ + y = 8,
ÿ + ẏ − 10y = cos(5t),
ÿ + a ẏ + by = kA, a > 0, b > 0, a, b, A, k are constants.
9. Which one of the following differential equations has a solution with a smaller
overshoot and which one has a solution with a smaller rise time?
A is a constant.
10. Compute the poles of a second-order system with a 25% overshoot and 0.2[s]
rise time.
11. Consider the proportional position control with velocity feedback of the
following DC motor: θ̈ + 0.4θ̇ = 30u, where θ is the angular position, whereas
u is the applied voltage. Find the controller gains to achieve a 0.01[s] rise time
and a 10% overshoot.
12. Consider the solution of a second-order differential equation when a step
input is applied and assuming zero initial conditions, which is presented
in (3.57). Find the maxima and minima of this response and solving for the
first maximum, show that overshoot can be computed as:
−√ ζ
π
Mp (%) = 100 × e 1−ζ 2 .
3.12 Exercises 187
Find the times when the natural response is zero and solving for the first of
these times, show that:
1 1 − ζ2
tr = π − arctan .
ωd ζ
as + b d
Y (s) = U (s), Z(s) = U (s),
s2 + c s2 +c
What must be done with b or c to achieve a faster system response?, What must
be done with b or c to achieve a less oscillatory response?
15. Consider the solution y(t) of an arbitrary n−order linear differential equation
with constant coefficients.
• If the input is bounded, What are the conditions to ensure that y(t) is also
bounded for all time? i.e., to ensure that y(t) does not become infinity.
• What are the conditions for the forced response to be the only component of
y(t) that remains as time increases?
• Assume that the input is zero. What are the different behaviors for y(t) as
time increases and under what conditions do they appear?
• Assume that the input is a polynomial of time. Show that the solution is not
a polynomial with a larger degree than the polynomial at the input if all the
roots of the characteristic polynomial have a negative real part.
• Assume that the input is given as the addition of several sine and cosine
functions of time with different frequencies. Using the results in Sect. 3.6
and the superposition principle, Can you explain the following fundamental
result for linear differential equations? [6, pp. 389]: “if the input is any
periodic function with period T and all the roots of the characteristic
polynomial have negative real parts, then as t → ∞ the solution y(t) is
also a periodic function with period T , although with a waveform that may
be different from that of the input.” Recall the concept of the Fourier series.
16. Verify the following equations:
5 −5/3 5/3
i) = + ,
s2 + s − 2 s+2 s−1
188 3 Ordinary Linear Differential Equations
2 1/3 2/3 −1
ii) = + + ,
s(s + 2)(s − 1) s+2 s−1 s
1 1/2 −1/4 1/4
iii) = + + ,
s3 − s2 −s+1 (s − 1) 2 s−1 s+1
1 1 1/2 −3/4 −1/4
iv) = + + + ,
s4 − s3 −s +s
2 s (s − 1) 2 s−1 s+1
2 1 −s
v) = + 2 ,
s 3 + 2s s s +2
3 −1 −1/3 −1/9 1/9
vi) 4 = 3 + 2 + + ,
s − 3s 3 s s s s−3
8 −1/2 1/4 1/4
vii) = + + ,
s(s + 4)(s − 4) s s+4 s−4
8 1 −1
viii) = + ,
s 2 − 16 s−4 s+4
4 2 −1 s−1
ix) 4 = 2+ + 2 ,
s + s 3 + 2s 2 s s s +s+2
4 2 2 1 −s − 1
x) 5 = + + + 2 ,
s + 3s 4 + 4s 3 + 4s 2 + 3s (s + 1)3 (s + 1)2 s+1 s +1
3s 2 + 3s − 2 −1 2 1
xi) = 2 + + ,
s 3 + 2s 2 s s s+2
s+2 2 −3 1 3
xii) 2 = 2+ + + .
s (s + 1)2 s s (s + 1)2 s+1
km
ω(s) = JR V (s),
km ke
s+ B
J + J Ra
where ω(s) and V (s) are the Laplace transforms of the motor velocity and
voltage applied at the motor terminals respectively.
• Assume that the applied voltage is zero and that the initial velocity is not
zero. Notice that applying a zero voltage at motor terminals is equivalent
to putting a short circuit at the armature motor terminals and that a non-
zero-induced voltage is present if the velocity is not zero. Depict the natural
response under these conditions. What can be done to force the natural
response to vanish faster? What happens with the electric current? Can you
explain why the natural response vanishes faster if the armature resistance is
closer to zero? Do you know the meaning of the term “dynamic braking”?
Why does the time constant depend on motor inertia? What does this mean
from the point of view of Newton’s Laws of Mechanics?
• Assume that a voltage different from zero is applied when the initial velocity
is zero. Depict the system response. Why does the final velocity not depend
on the motor inertia J ? Give an interpretation from the point of view of
physics.
19. Consider the electric circuit in Fig. 3.45. This circuit is called a phase-lag
network. The corresponding mathematical model is given in (2.146) and is
rewritten here for ease of reference:
R2 s + R21C R1 1
V0 (s) = Vi (s) + vc (0),
R1 + R2 s + (R +R
1
)C
R 1 + R2 s + 1
(R1 +R2 )C
1 2
190 3 Ordinary Linear Differential Equations
R2
1
0.8
0.6
0.4
0.2
vo(t) [V]
0
−0.2
−0.4
−0.6
−0.8
−1
where vc (0) is the initial voltage at the capacitor. Show that the solution is given
as:
R1 1
v0 (t) = A + (vc (0) − A)e−at , a= ,
R1 + R2 (R1 + R2 )C
and use this result to explain the response in Fig. 3.46 when vi (t) is the square
wave represented by the dash-dot line, vc (0) = 0, R1 = 2[Ω], R2 = 1[Ω] and
C = 1/33[F].
20. Repeat the previous exercise for all circuits in Fig. 2.39. Use MAT-
LAB/Simulink to draw the time response and verify your results.
21. Consider the simple pendulum in Fig. 3.47 when the external torque T (t) = 0
and friction is negligible. The mathematical model is given as:
ml 2 θ̈ + mglθ = 0,
References 191
which is valid only when the pendulum remains close to the downward vertical
configuration, i.e., θ is “small,” θ ≈ 0 (see Example 7.5, Chap. 7). Find the
required pendulum length l to produce oscillations with a period of 1 s.
References
1. K. Ogata, Modern control engineering, 4th edition, Prentice-Hall, Upper Saddle River, 2002.
2. E. Kreyszig, Advanced engineering mathematics, Vol. 1, 3rd. edition, John Wiley and Sons,
New Jersey, 1972.
3. C. Ray Wylie, Advanced engineering mathematics, McGraw-Hill, 1975.
4. M. R. Spiegel, Mathematical handbook of formulas and tables, McGraw-Hill, Schaum series,
New York, 1974.
5. W. H. Hayt and J. E. Kemmerly, Engineering circuit analysis, McGraw-Hill, 1971.
6. C.-T. Chen, Linear system theory and design, Holt, Rinehart, and Winston, New York, 1984.
7. V. Hernández Guzmán, A new stability analysis method for DC to DC series resonant
converters, Computación y Sistemas, vol. 11, no. 1, pp. 14–25, 2007.
8. R. Silva-Ortigoza, Control of resonant power converters based on differential flatness: design
and construction, MSc. Thesis, CINVESTAV-IPN (Zacatenco), México City, February, 2002.
9. R. Oruganti and F.C. Lee, Resonant power processors, Part I—State plane analysis, IEEE
Trans. Industry Applications, vol. AI-21, no. 6, pp. 1453–1460, 1985.
10. R. Oruganti and F.C. Lee, Resonant power processors, Part II—Methods of control, IEEE
Trans. Industry Applications, vol. AI-21, no. 6, pp. 1461–1471, 1985.
11. M.E. Van Valkenburg, Network analysis, Prentice-Hall, Upper-Saddle River, 1974.
12. J. Stewart, Calculus concepts and contexts, Brooks Cole Publishing and IPT Company, 1998.
Chapter 4
Stability Criteria and Steady-State Error
designing a controller that renders the closed-loop system forced response equal
to, or at least close to, the reference or desired output. This subject is also studied in
the present chapter.
Some examples are presented in the following to show how a block diagram can be
simplified to obtain a single transfer function representing the whole block diagram.
We also present some examples of block diagrams where a single output is affected
by two different inputs.
Example 4.1 Consider two systems such that the input of one of them is the output
of the other, as depicted in Fig. 4.1. It is said that these systems are cascade-
connected. Notice that:
to obtain:
This means that cascade-connected systems, such as those in Fig. 4.1, can be
represented by a single transfer function G(s) that can be computed as the product
of the individual transfer functions of systems in the connection. The reader can
verify that this is true no matter how many cascade-connected systems there are.
Example 4.2 Suppose that we have two parallel-connected systems, as depicted in
Fig. 4.2. Notice that:
to write:
Y 1 (s)
G 1 (s)
+
U(s)
Y 1 (s) +Y 2 (s)
+
G 2 (s)
Y 2 (s)
U(s)
G(s) Y 1 (s) +Y 2 (s)
This means that parallel-connected systems, such as those in Fig. 4.2, can be
represented by a single transfer function G(s) that is computed as the addition of
the transfer functions of each single system in the parallel connection. The reader
can verify that this is true no matter how many systems are in the parallel connection.
Example 4.3 Consider the closed-loop control system depicted in Fig. 4.3. Blocks
G(s) and H (s) stand for the transfer functions of the several components of a control
system. In fact, G(s) and H (s) can be the result of the combination of several
transfer functions of several components of the control system, such as those in the
previous examples. According to the definition of transfer function, from Fig. 4.3 it
is found that:
where:
C(s) G(s)
M(s) = = , (4.1)
R(s) 1 + G(s)H (s)
Example 4.4 Consider the block diagram shown in Fig. 4.4a. To simplify this block
diagram, it is convenient to shift the subtraction point placed at the right of U (s) to
the point where I ∗ (s) appears. This must be accomplished by keeping the definition
of I (s) in Fig. 4.4a without change. This means that, according to Fig. 4.4a:
1
I (s) = [KAp (I ∗ (s) − I (s)) − nke sθ (s)].
Ls + R
Ui (s ) Tp (s )
–
I *(s) + U ( s) 1 I(s) + 1 θ(s)
K Ap nk m
+ Ls +R Js 2 +bs
–
–
nk e s
(a)
Tp (s )
I *(s) + –
+ 1 I(s) + 1 θ(s)
KA p nk m
Ls +R Js 2 +bs
– –
nk e
KA p
s
(b)
Tp (s )
–
I *(s) + KA p I(s) + 1 θ(s)
nk m
Ls +R +KA p Js 2 +bs
–
nk e
KA p
s
(c)
Notice that this expression is also valid in the block diagram of Fig. 4.4b; hence, this
block diagram is equivalent to that in Fig. 4.4a. It is clear that the loop between the
second subtraction point in Fig. 4.4b and I (s) is identical to the closed-loop system
shown in Fig. 4.3 with:
KAp
G(s) = , H (s) = 1.
Ls + R
It is clear that the main result in Example 4.1 has been employed to compute
the transfer function of two cascaded systems as the product of the individual
transfer functions of the cascaded systems. Hence, using (4.1), the following transfer
function is found, which must be placed before I (s):
KAp
.
Ls + R + KAp
This is shown in Fig. 4.4c. The block diagram in Fig. 4.4c has two inputs. To
represent the output θ (s) as a function of both inputs, the superposition principle
has to be employed (see Sect. 3.7), i.e.,
G1 (s) is the transfer function computed when I ∗ (s) is the input and θ (s) is the
output, and it is assumed that Tp (s) = 0 in the block diagram in Fig. 4.4c, i.e.,
when the block diagram is depicted as in Fig. 4.5a. Thus, using (4.1), the following
is defined:
G(s) θ (s)
M(s) = = ∗ = G1 (s),
1 + G(s)H (s) I (s)
with:
KAp nkm nke s
G(s) = , H (s) = ,
(Ls + R + KAp )(J s 2 + bs) KAp
to find:
nkm
G1 (s) = . (4.3)
n2 km ke
sL+R
KAp + 1 (sJ + b) + KAp s
On the other hand, G2 (s) is the transfer function obtained when Tp (s) is the input,
θ (s) is the output and it is assumed that I ∗ (s) = 0 in the block diagram in Fig. 4.4c,
i.e., when block diagram is depicted as in Fig. 4.5b. Hence, using (4.1), the following
is defined:
−G(s) θ (s)
M(s) = = = G2 (s),
1 + G(s)H (s) Tp (s)
198 4 Stability Criteria and Steady-State Error
I *(s) + KAp 1
θ(s)
Ls +R+KAp
nk m Js 2+bs
–
nk e
KAp
s
(a)
Tp(s) – 1
θ(s)
Js 2+bs
–
nk m KAp nk e
KAp
s
Ls +R+KAp
(b)
I *(s) G 1(s)
+
θ(s)
+
Tp(s) G 2(s)
(c)
Fig. 4.5 Simplifying the block diagram in Fig. 4.4c . (a) Block diagram when Tp (s) = 0. (b)
Block diagram when I ∗ (s) = 0. (c) Block diagram equivalent to any of the block diagrams in
Fig. 4.4
with:
1 n2 km ke s
G(s) = , H (s) = ,
J s + bs
2 Ls + R + KAp
to obtain:
− sL+R
KAp +1
G2 (s) = . (4.4)
n2 km ke
sL+R
KAp + 1 (sJ + b) + KAp s
4.1 Block Diagrams 199
Thus, any of block diagrams in Figs. 4.4a, b or c can be represented as block diagram
in Fig. 4.5c with G1 (s) and G2 (s) given in (4.3) and (4.4).
Example 4.5 Consider the closed-loop system shown in Fig. 4.6a. This block
diagram represents a control scheme known as two degrees of freedom control. This
is a closed-loop system with two inputs and one output. Hence, we can proceed as
in the previous example to write, using the superposition principle:
G1 (s) is the transfer function obtained when using R(s) as the input, C(s) as the
output and D(s) = 0, i.e., when the block diagram in Fig. 4.6b is employed. On
the other hand, G2 (s) is the transfer function obtained when using D(s) as the
input, C(s) as the output and R(s) = 0, i.e., when the block diagram in Fig. 4.6c is
employed.
D (s)
R(s) + + C(s)
Gc1 ( s ) + + G p (s )
– –
Gc2 ( s )
(a)
– –
Gc2 ( s )
(b)
D (s) + C (s)
Gp (s )
–
Gc1 ( s )
+
+
Gc2 ( s )
(c)
Fig. 4.6 A two-degree-of-freedom control system. (a) Closed-loop system. (b) Case when D(s) =
0. (c) Case when R(s) = 0
200 4 Stability Criteria and Steady-State Error
First, proceed to obtain G1 (s). To simplify the block diagram in Fig. 4.6b
notice that:
Then, the block diagrams in Figs. 4.7a, b, and c are successively obtained. Notice
that, according to the Example 4.2, the following can be written:
Gc2 (s)
F (s) = 1 − R(s),
Gc1 (s) + Gc2 (s)
Gc1 (s) + Gc2 (s) − Gc2 (s)
= R(s),
Gc1 (s) + Gc2 (s)
Gc1 (s)
= R(s). (4.5)
Gc1 (s) + Gc2 (s)
Gc2(s)
Gc2(s)
Gc1(s)+ Gc2(s)
R(s)
– F(s) V(s) C(s)
Gc1(s) + Gc2(s) Gp ( s )
+
+ –
1
(c)
to find:
hence:
Gc1 (s)Gp (s)
G1 (s) = . (4.7)
1 + (Gc1 (s) + Gc2 (s))Gp (s)
On the other hand, from the block diagram in Fig. 4.6c and according to Exam-
ple 4.2, the block diagram in Fig. 4.8 is obtained. Using (4.1) and:
yields:
Gp (s)
C(s) = D(s),
1 + (Gc1 (s) + Gc2 (s))Gp (s)
i.e.,
Gp (s)
G2 (s) = . (4.8)
1 + (Gc1 (s) + Gc2 (s))Gp (s)
Hence, the block diagram in Fig. 4.6a can be represented as the block diagram in
Fig. 4.9 with G1 (s) and G2 (s) given in (4.7) and (4.8).
Gc1(s) + Gc2(s)
202 4 Stability Criteria and Steady-State Error
+
D(s) G2(s)
According to Sect. 3.4, the stability of a transfer function is ensured if all its poles
have a negative real part, i.e., if all the roots of its characteristic polynomial have
a negative real part. However, sometimes, it is difficult to compute the exact value
of the poles and this is especially true when the polynomial has a degree that is
greater than or equal to 3. The reason for this is that the procedure to compute the
roots of third- or fourth-degree polynomials is complex. Moreover, for polynomials
with a degree greater than or equal to 5, analytical procedures do not exist. Even
for second-degree polynomials the analytical procedure may be tedious. Thus, it is
desirable to have a simple method for determining whether all roots of a polynomial
have a negative real part or whether there are some roots with a positive real part.
Some simple criteria for solving this problem are introduced in this section. These
criteria are based on the study of signs of the polynomial coefficients.
Criterion 4.1 If all the coefficients of a second-degree polynomial have the same
sign, then all its roots have a negative real part.
Proof Consider the following polynomial:
p(s) = s 2 + cs + d,
where c > 0, d > 0. If all the coefficients of the polynomial had a negative sign,
then this sign can be factorized to proceed as shown in the following, i.e., when all
the coefficients are positive. A second-degree polynomial p(s) has two roots, which
can be computed using the general formula:
√
−c ± c2 − 4d
s1,2 = . (4.9)
2
In this case, both roots are complex conjugate with a negative real part because
c > 0:
√
−c 4d − c2
s1,2 = ± j.
2 2
c2 > c2 − 4d > 0,
According to (4.9), this means that both roots are real, different, and negative in
this case:
√
c + c2 − 4d
s1 = − < 0,
2
√
c − c2 − 4d
s2 = − < 0.
2
• Case (iii): c2 − 4d = 0.
In this case, both roots are real, repeated, and negative:
−c
s1,2 = .
2
Example 4.6 Notice that the polynomial s 2 + s + 1 satisfies the case (i); hence, its
roots are complex conjugate with a negative real part. In fact, it is not difficult to
verify that these roots are −0.5 + j 0.866 and −0.5 − j 0.866. On the other hand, the
polynomial s 2 + 2.5s + 1 satisfies the case (ii); hence, its roots are real, different,
and negative. It is not difficult to verify that these roots are −2 and −0.5. Finally,
the polynomial s 2 + 2s + 1 satisfies the case (iii); hence, its roots are real, repeated,
and negative. It is not difficult to verify that these roots are −1 and −1.
Criterion 4.2 If some coefficients of a second-degree polynomial have a sign that
is different to signs of the other coefficients, then at least one root has a positive
real part.
204 4 Stability Criteria and Steady-State Error
p(s) = s 2 + cs + d.
c2 < c2 − 4d.
This means that both roots are real and different, with one of them positive:
√
c+c2 − 4d
s1 = − < 0,
2
√
c − c2 − 4d
s2 = − > 0.
2
Now consider case 1):
c2 > c2 − 4d.
4.2 The Rule of Signs 205
i.e.,
abs(c) − c2 − 4d > 0, or − abs(c) + c2 − 4d < 0.
As c < 0 and d > 0, then there are two positive real roots:
√
c+ c2 − 4d
s1 = − > 0,
2
√
c − c2 − 4d
s2 = − > 0.
2
• Case (iii): c2 − 4d = 0.
In this case d = c2 /4 > 0, only if 1) is satisfied, i.e., c < 0. This implies that
both roots are real, repeated, and positive:
−c
s1,2 = > 0.
2
Example 4.7 Several second-degree polynomials and their corresponding roots are
presented in what follows. It is left as an exercise for the reader to verify these results
and to relate them to the cases analyzed above.
• s 2 + 2s − 1, roots: −2.4142 and 0.4142.
• s 2 − 2.5s + 1, roots: 2 and 0.5.
• s 2 − s − 1, roots: 1.618 and −0.618.
• s 2 − s + 1, roots: 0.5 + j 0.866 and 0.5 − j 0.866.
• s 2 − 2s + 1, roots: 1 and 1.
In this case, is very easy to prove that the same conditions stand as for second-degree
polynomials:
Criterion 4.3 If both coefficients of a first-order polynomial have the same sign,
then its only root is real and negative. If one coefficient has the opposite sign to the
other, then the only root is real and positive.
206 4 Stability Criteria and Steady-State Error
Criterion 4.4 If at least one coefficient has the opposite sign to the other coeffi-
cients, then there is at least one root with a positive real part.
Proof Consider the following polynomial where n ≥ 3:
As explained in the previous section, although the rule of signs is very easy to apply,
its main drawback appears when analyzing polynomials with a degree greater than
or equal to 3: when all coefficients have the same sign, nothing can be concluded
from the sign of the real part of the roots. The solution to this problem is provided
by Routh’s stability criterion, which, given a polynomial with an arbitrary degree,
establishes necessary and sufficient conditions to ensure that all its roots have a
negative real part.
Given an arbitrary polynomial, order its terms by descending powers of its
variable:
Notice that, according to these formulae, the last entry in each row is zero and
the table is triangular.
208 4 Stability Criteria and Steady-State Error
2. Only analyze the first column in Table 4.1. The number of sign changes found
from top to bottom in the first column of the table is equal to to the number of
roots with a positive real part.
Several examples are presented in the following.
Example 4.9 Consider the following second-degree polynomial:
s 2 + as + b,
with a and b two real constants. The rule of signs (Sect. 4.2) can be employed to
conclude that both roots have a negative real part if:
a > 0, b > 0,
a > 0, b > 0,
must be true to ensure that both roots have a negative real part. Thus, Routh’s
criterion and the rule of signs in Sect. 4.2 have the same conclusion, as expected.
s 3 + 5s 2 + 2s − 8.
4.3 Routh’s Stability Criterion 209
Because of coefficient −8, i.e., with a negative sign when all the other coefficients
are positive, it is known from the rule of signs in Sect. 4.2 that there is at least
one root with a positive real part. Routh’s criterion is now used to corroborate this
result. First, Table 4.3 is filled. Routh’s criterion establishes that the number of sign
changes in the first column is equal to the number of roots with a positive real part.
Hence, it is concluded that the polynomial s 3 + 5s 2 + 2s − 8 has one root with a
positive real part. In fact, the use of the MATLAB command:
roots([1 5 2 -8])
allows us to find that:
s = −2, s = 1, s = −4,
As all the coefficients have the same sign and the polynomial is third-degree,
the rule of signs in Sect. 4.2 is not useful in this problem. In this case, Routh’s
stability criterion is a suitable alternative. First, Table 4.4 is filled. Routh’s criterion
establishes that the number of sign changes in the first column is equal to the
number of roots with a positive real part. Hence, it is concluded that the polynomial
s 3 + 1.8s 2 + 0.61s + 2.02 has two roots with a positive real part. In fact, use of the
MATLAB command:
roots([1 1.8 0.61 2.02])
allows us to find that:
s 3 + as 2 + bs + c,
where a, b and c are real unknown constants. This type of situation is very common
in control systems where coefficients of the characteristic polynomial depend on the
controller gains, which are not known and must be found such that closed-loop
stability is ensured. This is achieved by forcing all the roots of the closed-loop
characteristic polynomial to have a negative real part. However, the computation
of the roots of a third-degree polynomial using analytical methods is a very tedious
process; hence, that is not a practical solution. In this type of problem, Routh’s
stability criterion is, again, very useful. First, fill Table 4.5. Routh’s criterion
establishes that the number of sign changes in the first column of the table is equal
to the number of roots with a positive real part. Thus, as the first element in the first
column is +1, then if:
ab − c
a > 0, > 0 c > 0, (4.12)
a
it is ensured that all three roots have a negative real part. Notice that conditions
in (4.12) are equivalent to:
c
a > 0, b> >0 c > 0.
a
This means that, although the coefficients a and c are only required to be positive,
in the case of the coefficient b, this is not enough and a little more is demanded:
b > ac > 0.
Example 4.13 (Special Case: Only the Entry at the First Column of a Row Is Equal
to Zero) Consider the following polynomial:
s 5 + 2s 4 + 3s 3 + 6s 2 + 5s + 3.
First fill Table 4.6. However, the procedure stops at the row corresponding to s 3
because the entry in the first column in that row is zero. As a consequence, some
divisions by zero would appear when continuing filling the remaining rows. In this
case, it is advised to replace the zero in the first column with a small ε > 0 to
continue filling the table as shown in Table 4.7.
4.3 Routh’s Stability Criterion 211
Now, determine the number of sign changes in the first column as ε > 0 tends
toward zero. Notice that in this example there are two sign changes. This means that
the polynomial under study has two roots with a positive real part. In fact, use of the
MATLAB command:
roots([1 2 3 6 5 3])
allows us to find that the roots of the polynomial s 5 + 2s 4 + 3s 3 + 6s 2 + 5s + 3 are:
If after ε > 0 is employed to fill the table, there were no sign changes in the first
column, then the system would be marginally stable, i.e., there would be some roots
on the imaginary axis.
Example 4.14 (Special Case: A Row Is Filled Exclusively with Zeros or a Row only
Has One Entry, Which Is Zero) Consider the following polynomial:
s 3 + 3s 2 + s + 3. (4.13)
First fill Table 4.8. The process stops at the row corresponding to s 1 because that
row is filled exclusively with zeros. This is a special case that is indicative of three
possibilities [3], pp. 336,[6], pp. 136:
1. There are real roots that are placed symmetrically with respect to origin.
2. There are imaginary roots that are placed symmetrically with respect to origin.
3. There are four complex conjugate roots placed at the vertices of a rectangle
centered at the origin.
212 4 Stability Criteria and Steady-State Error
To continue, use the entries in the row s 2 to form a new polynomial, i.e.,
P (s) = 3s 2 + 3,
3s 2 + 3 = 0, ⇒ s = ±j.
s = −3, s = j, s = −j.
Example 4.15 (Special Case: A Row Is Filled Exclusively with Zeros or a Row only
Has One Entry, Which Is Zero) Consider the following polynomial:
s 4 + s 2 + 1.
4.3 Routh’s Stability Criterion 213
Fill Table 4.10. As there is a row filled exclusively with zeros, proceed as in the
previous example. The polynomial P (s) = s 4 + s 2 + 1 is differentiated with respect
to s:
dP (s)
= 4s 3 + 2s.
ds
These coefficients are substituted in the row filled exclusively with zeros and
continue filling Table 4.11. As two sign changes exist in the first column of this
table, it is concluded that two roots with a positive real part exist. This means that
only the following case is possible: there are four complex conjugate roots placed on
vertices of a rectangle centered at the origin. In fact, use of the MATLAB command:
roots([1 0 1 0 1])
allows us to find that the roots of the polynomial s 4 + s 2 + 1 are:
Example 4.16 (Repeated Roots on the Imaginary Axis) When a characteristic poly-
nomial has repeated roots on the imaginary axis, the transfer function is unstable.
However, this class of instability is not detected by Routh’s criterion. For instance,
consider the following polynomial:
Notice that there are two repeated roots on the imaginary axis. Fill Table 4.12. As
there is a row exclusively filled with zeros, the polynomial P (s) = s 4 + 2s 2 + 1 is
differentiated with respect to s:
dP (s)
= 4s 3 + 4s,
ds
and continue filling Table 4.13.
214 4 Stability Criteria and Steady-State Error
As there is another row exclusively filled with zeros, the polynomial P1 (s) =
s 2 + 1 is differentiated with respect to s:
dP1 (s)
= 2s,
ds
and continue filling Table 4.14. Notice that no sign changes exist in the first column
of Table 4.14; hence, the method correctly indicates that no roots exist with a
positive real part. Also notice that the roots of P1 (s) = s 2 + 1 are s = ±j , i.e.,
marginal stability is concluded. However, this is incorrect because the polynomial
s 4 + 2s 2 + 1 has two imaginary roots, which are repeated twice, which implies
instability. Thus, attention must be paid to these cases.
The solution of a differential equation is given as the addition of the natural response
and the forced response. If the differential equation is stable or, equivalently, if the
transfer function is stable then the natural response disappears as time increases and
the complete solution reaches the forced response. Recall that the forced response
depends on (or is similar to) the applied input. According to these ideas, in a closed-
loop control system, we have the following. 1) The closed-loop system input is a
signal that stands for the desired closed-loop output. This is why such a signal is
known as the reference or desired output. 2) The controller is designed such that the
4.4 Steady-State Error 215
closed-loop system is stable and the forced response is equal to or is close to the
reference or desired output.
The properties that a closed-loop control system must possess to ensure that the
forced response is equal to or close enough to the closed-loop system input are
studied in this section. Notice that this is equivalent to requiring the system error,
defined as the difference between the system output and the reference, to be zero
or close to zero in a steady state, i.e., when time is large. Thus, the behavior of the
steady-state error is studied in the following.
Consider the closed-loop system with unit feedback shown in Fig. 4.10. An
important concept in the study of the steady-state error is the system type, which
is defined next. It is assumed that any n−order open-loop transfer function can be
written as:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
s N (s − p1 )(s − p2 ) · · · (s − pn−N )
where n is the number of open-loop poles and m is the number of open-loop zeros
with n > m, zj = 0, j = 1, . . . , m and pi = 0, i = 1, . . . , n − N . Hence, N
is the number of poles that the open-loop transfer function has at the origin, i.e.,
after cancelling with any zeros that the open-loop transfer function might have at
the origin. The system type is defined as N , i.e., it is the number of poles at the
origin or, equivalently, the number of integrators that the open-loop transfer function
possesses.
The error signal is given as the difference between the closed-loop system output
and the reference or desired output:
hence:
The steady-state error, ess , is obtained using (4.14) and the final value theorem
in (3.4), i.e.,
s
ess = lim e(t) = lim sE(s) = lim R(s). (4.15)
t→∞ s→0 s→0 1 + G(s)
Notice that the steady-state error is the difference between the system output c(t)
and the reference, or desired output, r(t), in a steady state. This explains why ess
depends on the reference R(s). Hence, to continue this study, it is necessary to know
R(s), which motivates the definition of the so-called test signals. A test signal is a
function of time with two features: 1) It must make sense in real applications, and
2) It must be mathematically simple. Some important test signals, or test inputs, in
classical control are defined in the following.
Consider the problem of a video camera tracking a target. The control objective
in this problem is to force the video camera to aim at a target that moves very fast.
Some situations arising in this problem are the following.
• Step test signal. Suppose that the target approaches the video camera directly
along a constant direction represented by A. If video camera is at the beginning
aiming in another direction and it is desired that it aims in the direction from
which the target is approaching, then the reference or desired direction has the
shape depicted in Fig. 4.11. This test signal is known as a step and it represents an
abrupt change in the desired output. The system output is the direction in which
the video camera is aiming. It is desired that the difference between these signals
is zero or close to zero in a steady state. If r(t) is a step:
0, t < 0
r(t) = ,
A, t ≥ 0
0 t
4.4 Steady-State Error 217
0 t
0 t
that the desired output changes at a constant rate A, i.e., the target velocity. If
r(t) is a ramp:
0, t < 0
r(t) = ,
At, t ≥ 0
where A = dr(t)dt is a constant standing for the rate of change of r(t), then R(s) =
L{r(t)} = sA2 is a function that is simple enough to be mathematically handled.
• Parabola test signal. Suppose that the target passes in front of the video camera
with a constant acceleration A, approaching another point, and that the video
camera is aiming at the target at the beginning. Then, the reference or desired
output has the shape shown in Fig. 4.13. This signal is known as a parabola and
it indicates that the desired output changes with a constant acceleration A, i.e.,
the target acceleration. If r(t) is a parabola:
0, t <0
r(t) = 1 2, t ≥ 0 ,
2 At
2
where A = d dtr(t)
2 is a constant standing for the acceleration of r(t), then R(s) =
Any of these three situations may appear under the normal operating conditions
of a recording video camera control system. Thus, the design of a controller must
ensure that the steady-state error is zero or close to zero for any of these desired
outputs. The conditions required to achieve this control objective are studied in the
following.
218 4 Stability Criteria and Steady-State Error
Suppose that R(s) = A/s is the step desired output. Using (4.15) the following is
found:
s A
ess = lim ,
s→0 1 + G(s) s
A
= , kp = lim G(s),
1 + kp s→0
where kp is known as the position constant and is related to the system type. Hence,
the following cases are considered:
• System type 0 (N = 0). In this case, the open-loop transfer function has the form:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
(s − p1 )(s − p2 ) · · · (s − pn )
i.e.,
kp is finite. This means that the steady-state error is constant and different from
zero:
A
ess = = 0.
1 + kp
• System type greater than or equal to 1 (N ≥ 1). In this case, the open-loop
transfer function has the form:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
s N (s − p1 )(s − p2 ) · · · (s − pn−N )
i.e.,
A
ess = = 0.
1 + kp
4.4 Steady-State Error 219
Suppose that R(s) = A/s 2 is the desired output. Using (4.15), the following is
found:
s A
ess = lim ,
s→0 1 + G(s) s 2
A
= , kv = lim sG(s),
kv s→0
where kv is known as the velocity constant and it is related to the system type.
Hence, consider the following cases:
• System type 0 (N = 0). In this case, the open-loop transfer function has the form:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
(s − p1 )(s − p2 ) · · · (s − pn )
i.e.,
k(−z1 )(−z2 ) · · · (−zm )
kv = lim sG(s) = (0) = 0.
s→0 (−p1 )(−p2 ) · · · (−pn )
This means that the steady-state error grows without a limit:
A
ess = → ∞.
kv
• System type 1 (N = 1). The open-loop transfer function has the form:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
s(s − p1 )(s − p2 ) · · · (s − pn−1 )
i.e.,
kv is finite and different from zero. This means that the steady-state error is
constant and different from zero:
A
ess = = 0.
kv
• System type greater than or equal to 2 (N ≥ 2). The open-loop transfer function
can be written as:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
s N (s− p1 )(s − p2 ) · · · (s − pn−N )
220 4 Stability Criteria and Steady-State Error
i.e.,
A
ess = = 0.
kv
Suppose that R(s) = A/s 3 is the desired output. Using (4.15), the following is
obtained:
s A
ess = lim ,
s→0 1 + G(s) s 3
A
= , ka = lim s 2 G(s),
ka s→0
where ka is known as the acceleration constant and is related to the system type.
The open-loop transfer function is given as:
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = ,
s N (s − p1 )(s − p2 ) · · · (s − pn−N )
i.e.,
• The steady-state error is constant and different from zero when the system type
is 2:
A
ess = = 0, N = 2.
ka
4.4 Steady-State Error 221
0 t
• The steady-state error is zero when the system type is greater than or equal to 3:
A
ess = = 0, N ≥ 3.
ka
Notice that, in the case of the three references, or test signals, that have
been considered, the steady-state error becomes zero if the number of open-loop
integrators are suitably increased. This explains why some controllers include an
integrator, i.e., proportional–integral (PI) or proportional–integral–derivative (PID)
control. On the other hand, it is important to note that all the results presented above
are true only if it is ensured that the closed-loop system is stable. This is because the
final value theorem assumes that the natural response vanishes as time increases.
Finally, in Fig. 4.14, the behavior of the output is depicted c(t) with respect to
the reference r(t), when the latter is a ramp for different system types. The results
found above are summarized in Table 4.15.
Example 4.17 A velocity control system for a permanent magnet brushed DC motor
is depicted in Fig. 4.15 (see Chap. 10). The motor model is given by the transfer
function Gm (s) = s+a k
, with k > 0 and a > 0, whereas kp is a positive constant
standing for the transfer function of a proportional controller. This means that the
electric current used as the control signal is computed as:
i ∗ = kp (ωd − ω),
where ω is the measured velocity, ωd is the desired velocity and I ∗ (s) is Laplace
transform of i ∗ . The open-loop transfer function is:
kp k
G(s)H (s) = .
s+a
222 4 Stability Criteria and Steady-State Error
Notice that, as a > 0, the system type is 0 because the open-loop transfer function
has no pole at the origin. Hence, according to Sect. 4.4.1, if the desired velocity is
constant, i.e., a step signal, then the steady-state error ess = ωd − limt→∞ ω(t) is
constant and different from zero, i.e., a proportional velocity controller is not useful
for motor velocity to reach the desired velocity. See Fig. 3.32 for a simulation in
which these observations are corroborated. However, it is important to stress that the
steady-state error analysis that is presented in this chapter is useful for describing the
situation in Fig. 3.32 only as long as no external disturbance Tp is present. Notice
that, according to Sects. 4.4.2 and 4.4.3, the steady-state error would be greater if
the desired velocity was either a ramp or a parabola.
A PI controller solves this problem. A PI controller performs the following
operation on the velocity error:
t
i ∗ = kp e + ki e(r)dr, e = ωd − ω,
0
where kp and ki are positive constants. Use of the Laplace transform yields:
E(s)
I ∗ (s) = kp E(s) + ki ,
s
ki
= kp + E(s),
s
kp s + ki
= E(s),
s
⎛ ⎞
s + kkpi
= kp ⎝ ⎠ E(s),
s
where E(s) is the Laplace transform of the velocity error. Hence, the block diagram
in Fig. 4.16 is obtained. Notice that, now, the system type is 1 because the open-loop
transfer function:
⎛ ⎞
s + kkpi
G(s)H (s) = kp ⎝ ⎠ k ,
s s+a
4.4 Steady-State Error 223
has one pole at s = 0 and, thus, according to Sect. 4.4.1, the steady-state error
is zero, i.e., the motor velocity reaches the desired velocity when time is large
enough if ωd is constant, or a step signal. We conclude that the integral term of a
PI controller is introduced to render the steady-state error zero. It must be stressed,
however, that this result is absolutely true only if it is ensured that the closed-loop
system is stable, i.e., if all the closed-loop poles have a negative real part.
Some simulation results are shown in Fig. 3.39 where these ideas are corrob-
orated. Notice that in those simulations the steady-state error is still zero, even
when a constant external disturbance is applied. However, it is important to say
that this property is not described by the steady-state error analysis presented in this
chapter. Recall that this analysis is only valid for a closed-loop system such as that
represented in Fig. 4.10, i.e., when no external disturbance is present.
Finally, according to Sects. 4.4.2 and 4.4.3, a PI velocity controller is only useful
for step desired outputs as the steady-state error is still different from zero if the
desired velocity is either a ramp or a parabola.
Example 4.18 Consider the position control system of a permanent magnet brushed
DC motor depicted in Fig. 4.17. Notice that the motor transfer function has one pole
at s = 0, when the output to be controlled is in the position. Hence, the system
type is 1 and the steady-state error is zero if the desired position is a constant,
i.e., a step (see Sect. 4.4.1). It is important to realize that this result stands if any
of the following controllers are employed (see Chap. 11): a) A PD controller,
i.e., Fig. 4.18, b) A proportional position controller with velocity feedback, i.e.,
Fig. 4.19, or c) A lead-compensator, i.e., Fig. 4.20. The purpose of these controllers
is to ensure that the closed-loop system is stable, introducing suitable damping and
accomplishing a suitable response time. It is important to stress that closed-loop
stability must be ensured to really achieve a zero steady-state error.
Some simulation results are presented in Figs. 3.34 and 3.36, which corroborate
the above-mentioned ideas. Notice, however, that the steady-state error analysis
presented in this chapter is not intended to explain the different from zero steady-
state error observed in those simulations when a constant external disturbance
appears. Recall that this analysis is only valid for a closed-loop system, such as
that represented in Fig. 4.10, i.e., when no external disturbance is present.
224 4 Stability Criteria and Steady-State Error
– –
kv s
θd(s) + I *(s) k
θ(s)
γ s+d
s+c s ( s+a)
–
Example 4.19 Consider the control of a permanent magnet brushed DC motor when
constant references are employed. How can it be explained that the proportional
control of velocity cannot achieve a zero steady-state error, but a proportional
control of the position does achieve a zero steady-state error?
The answer to this question is the following. When the error is zero in position
control, then the commanded current i ∗ = kp (θd −θ ) is zero; hence, the motor stops
and the condition θd = θ can stand forever.
On the other hand, when the error is zero in velocity control, then the commanded
current i ∗ = kp (ωd − ω) is zero; hence, the motor tends to stop. This means that the
condition ωd = ω cannot stand forever. As a result the steady-state error is such that
the difference between ω and ωd is large enough to command an electric current
i ∗ = kp (ωd − ω), which maintains the motor rotating at that velocity. When a PI
t
velocity controller is employed, then the integral of the error 0 (ωd − ω(r))dr is
constant when ωd = ω. This constant value, multiplied by ki is enough to command
a suitable electric current to maintain the motor rotating at the desired velocity.
4.4 Steady-State Error 225
θd(s) + kp k
s 2+k s+k i
I*(s) k θ(s)
kd s
d d
s(s+a)
–
E(s)
I ∗ (s) = kp E(s) + kd sE(s) + ki ,
s
ki
= kp + kd s + E(s),
s
kp ki
s2 + kd s + kd
= kd E(s).
s
Hence, the block diagram in Fig. 4.21 is obtained. Notice that the motor has one
pole at s = 0 and the controller has another pole at s = 0, i.e., the system type is 2
because the open-loop transfer function has two poles at the origin. This means that,
according to Sects. 4.4.1 and 4.4.2, the position reaches the desired position θd , if
this is either a step or a ramp. A steady-state error different from zero is obtained if
the desired position is a parabola, see Sect. 4.4.3.
To verify the above conclusions, some simulations have been performed using
the MATLAB/Simulink diagrams shown in Fig. 4.22. The top simulation diagram
uses a ramp as the reference with a slope of 10 and an initial value of −10. The
PID controller gains are kd = 1, kp = 2, ki = 1. It is observed in Fig. 4.23
that the steady-state error is zero, which corroborates the steady-state error analysis
presented above. The bottom simulation diagram in Fig. 4.22 uses a ramp with slope
of 1 and a zero initial value, which passes through an integrator with an initial value
of −10. This results in a parabola reference given as 12 t 2 − 10, i.e., A = 1. The PID
controller gains are the same as in the previous simulation, i.e., kd = 1, kp = 2,
ki = 1. According to Sect. 4.4.3 and Figs. 4.21, 4.22:
kp ki
A s2 + kd s + kd k
ess = , ka = lim s 2 G(s), G(s) = kd ,
ka s→0 s s(s + a)
226 4 Stability Criteria and Steady-State Error
Scope
1 InputOutput
PID(s)
2
Ramp
Add
Scope
1
s 1 InputOutput
PID(s)
2
Ramp Integrator
Add
Fig. 4.22 MATLAB/Simulink diagrams used to obtain results in Figs. 4.23 and 4.24
200
150
100
50
0 2 4 6 8 10 12 14 16 18 20
−5
−10
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 4.23 Time response obtained from the top simulation diagram in Fig. 4.22, which is
equivalent to the system in Fig. 4.21, when a ramp reference is commanded. Top subfigure: system
response (continuous), ramp (dashed) Bottom subfigure: system error
200
150
100
50
0
0 2 4 6 8 10 12 14 16 18 20
−5
−10
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 4.24 Time response obtained from the bottom simulation diagram in Fig. 4.22, which is
equivalent to the system in Fig. 4.21, when a parabola reference is commanded. Top subfigure:
system response (continuous), parabola (dashed) Bottom subfigure: system error
228 4 Stability Criteria and Steady-State Error
Xd (s) + + ρ X(s)
Ax g s+ b α
k
+ s+ c 1 s ( s+ a )
2 s2
– – –
kv s Aθ
Aθ
steady-state error when the position reference θd is a parabola. In this case, the
system type is required to be 3. As the plant has one pole at s = 0, it is necessary to
use a controller introducing two poles at s = 0. Hence, the following controller is
proposed:
t t r
de
i ∗ = kp e + kd + ki e(r)dr + kii e(τ )dτ dr, e = θd − θ,
dt 0 0 0
kd s 3 + kp s 2 + ki s + kii
I ∗ (s) = E(s), (4.16)
s2
where E(s) stands for the Laplace transform of the position error. This shows that
the controller has two poles at s = 0 and, thus, it is useful for solving the problem.
Notice that not only the double-integral term is included, with gain kii , but also the
single-integral term with gain ki . This is done for closed-loop stability reasons. If the
single- integral term is not considered, then closed-loop instability is observed. This
can be verified by the reader obtaining the closed-loop characteristic polynomial and
applying Routh’s stability criterion. As a general rule, if a controller has to introduce
an integral term of order k, then the terms of integrals of order 1 to k − 1 must also
be included.
Consider the simulation diagram in Fig. 4.26. This is a system with type 3, which
is equivalent to a plant Gm (s) = s(s+1)
1
with a controller such as that in (4.16) where
kd = 0.5, kp = 3, ki = 2, kii = 1. A ramp with an unit slope and a zero initial
value is passed through an integrator with −10 as initial value. This corresponds to
a parabola reference given as 12 t 2 − 10, i.e., A = 1. In Fig. 4.27 the steady-state
error is corroborated to be zero, which verifies the above predictions.
Once the simulation in Fig. 4.26 stops, the following MATLAB code is executed
in an m-file to draw Fig. 4.27:
nn=length(InputOutput(:,1));
n=nn-1;
4.4 Steady-State Error 229
Ts=20/n;
t=0:Ts:20;
subplot(2,1,1)
plot(t,InputOutput(:,1),’k--’,t,InputOutput(:,3),
’k-’);
axis([-1 20 -30 200])
subplot(2,1,2)
plot(t,InputOutput(:,2),’k-’);
axis([-1 20 -12 8])
xlabel(’time [s]’)
Scope
1 3 2
s 1 InputOutput
s3 s+1
Ramp Integrator
Add
200
150
100
50
0
0 2 4 6 8 10 12 14 16 18 20
−5
−10
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 4.27 Time response obtained from the simulation diagram in Fig. 4.26, i.e., a type 3 system,
when a parabola reference is commanded. Top subfigure: system response (continuous), parabola
(dashed) Bottom subfigure: system error
230 4 Stability Criteria and Steady-State Error
4.5 Summary
The basic preliminary tools for the analysis and design of arbitrary order control
systems have been presented in this chapter. It must be understood that the response
of any closed-loop control system, no matter how complex, is determined by the
equivalent closed-loop transfer function.
The control system representation by means of block diagrams, and their
simplification, are instrumental in obtaining the corresponding closed-loop transfer
function. From this transfer function it is possible to determine: i) The closed-loop
stability and the transient response, i.e., the closed-loop poles, and ii) The steady-
state response.
It is explained in Chap. 3 that a necessary and sufficient condition for a transfer
function to be stable is that all its poles have a negative real part. However, checking
this condition through the exact computation of the poles is a complex problem.
This is especially true when the numerical values of the characteristic polynomial
coefficients are not known. This situation is common in control systems design as
the characteristic polynomial coefficients depend on the controller gains, which
are initially unknown. Moreover, it is desirable that the controller gains can be
chosen within a range to render the design flexible. These features require the use
of analytical tools, instead of numerical tools, useful to determine when a closed-
loop control system is stable. This fact represents an important obstacle because the
analytical formulas existing to compute the roots of higher-degree polynomials are
complex. Furthermore, no analytical solution exists for polynomials with a degree
greater than or equal to 5. This problem is successfully solved by Routh’s stability
criterion, which, however, only verifies whether all the polynomial roots have a
negative real part, but does not compute the exact values of the roots. On the other
hand, although the rule of signs presented in Sect. 4.2 has some limitations, it may
be simpler to use than Routh’s stability criterion in some applications. This is the
reason for including such a methodology.
As a result of the study of the steady-state error, some criteria are established
for suitable selection of a controller such that the steady-state response reaches the
desired value; in other words, to render the forced response equal or very close to the
close-loop system input, i.e., the desired response. Finally, the controller selection
must be also performed such that the desired transient response is achieved through
the suitable location of the closed-loop poles. The solution to this latter problem is
presented in the next chapter.
3. How does Routh’s stability criterion ensure that the real part of all roots of the
characteristic polynomial is negative?
4. What are the advantages and the disadvantages or the rule of signs presented in
Sect. 4.2?
5. Suppose that analysis of the steady-state error concludes that the output final
value reaches the desired output value. Why is it still necessary for the closed-
loop system to be stable?
6. Suppose that a controller possessing a five times iterated integral is required to
render the steady-state error zero. Why is it also necessary to include terms with a
four times integrated integral, a three times iterated integral, a two times iterated
integral and a simple integral? Illustrate your answer using a permanent magnet
brushed DC motor as a plant and Routh’s stability criterion.
7. What is the relationship between the study of the steady-state error in this chapter
and the requirement that the forced response reaches the closed-loop system
input, i.e., the desired output?
8. The study of the steady-state error that has been presented in this chapter only
considers test inputs such as step, ramp, and parabola. What would happen in
applications, such as the video camera tracking control system, where the desired
output is not exactly known in advance?
4.7 Exercises
1. Based on the knowledge of the system type required to ensure a zero steady-
state error for references such as the step, the ramp and the parabola, show that
the corresponding closed-loop transfer function (see Fig. 4.10) must possess the
following features:
• The terms independent of s must be equal in the polynomials at the numerator
and the denominator to ensure a zero steady-state error when the reference is
a step.
• The terms independent of s in addition to the first-order terms in s must be
equal in the polynomials at the numerator and the denominator to ensure a
zero steady-state error when the reference is a ramp.
• The terms independent of s in addition to the first-order and the second-
order terms in s must be equal in the polynomials at the numerator and
the denominator to ensure a zero steady-state error when the reference is a
parabola.
This means that the controller also has to suitably assign the closed-loop
transfer function zeros, which supports the arguments presented in Example 4.21
(see (4.16)).
2. In Example 3.18, in Chap. 3, everyday experience-based arguments are presented
to explain the steady-state error achieved by a proportional control of a mass-
spring-damper system when xd is constant. Now, explain this result using the
system type as the argument.
232 4 Stability Criteria and Steady-State Error
in a steady state. Now, use the final value theorem to compute the final value of
x when f = A. What is the relationship among conditions ẋ = 0, ẍ = 0, and
s → 0 in the final value theorem?
4. Consider the rotative mass-spring-damper system:
J θ̈ + f θ̇ + Kθ = T ,
f + kd ki
J > 0 ki > 0, K + kp > 0, > > 0,
J K + kp
ensure closed-loop stability. Notice that a large integral gain ki tends to produce
instability and this effect can be compensated for using large values for either kp
or kd . Also notice that a small inertia J allows the use of larger integral gains
before instability appears and something similar occurs if the stiffness constant
K is large. Can you find an explanation for this from the point of view of physics
(mechanics)?
5. Proceeding as in the Example 4.3 in this chapter, show that the closed-loop
transfer function shown in Fig. 4.3 is:
C(s) G(s)
M(s) = = ,
R(s) 1 − G(s)H (s)
when the system has positive feedback, i.e., when the feedback path adds (instead
of subtracts) in Fig. 4.3.
6. Consider the mechanical system depicted in Fig. 4.28. In the Example 2.3,
Chap. 2, it was found that the corresponding mathematical model is given as:
d 2 xm1 b1 dxm1 K 1
2
+ + (xm1 − xm2 ) = F (t),
dt m1 dt m1 m1
d 2 xm2 b2 dxm2 K
2
+ − (xm1 − xm2 ) = 0,
dt m2 dt m2
References 233
b1 b2
where xm1 is the position of m1 and xm2 is the position of m2 . Apply the Laplace
transform to each one of these equations to express Xm1 (s) and Xm2 (s) as the
outputs of two transfer functions. Draw the corresponding block diagram suitably
connecting these two transfer functions according to their inputs and outputs.
Using the result in the previous exercise, simplify this block diagram to verify
that:
G1 (s)G2 (s)/m1
Xm2 (s) = F (s),
1 − G1 (s)G2 (s)K/m1
1
G1 (s) = b1
,
s2 + m1 s + K
m1
K
m2
G2 (s) = b2
.
s2 + m2 s + K
m2
References
1. S. Bennett, A brief history of automatic control, IEEE Control Systems Magazine, pp. 17–25,
June 1996.
2. K. Ogata, Modern control engineering, 4th edition, Prentice-Hall, Upper Saddle river, 2002.
234 4 Stability Criteria and Steady-State Error
3. N. S. Nise, Control systems engineering, 5th. edition, John Wiley and Sons, New Jersey, 2008.
4. R. C. Dorf and R. H. Bishop, Modern control systems, 10th. edition, Pearson Prentice-Hall,
2005.
5. B. C. Kuo, Automatic control systems, Prentice-Hall, 1995.
6. G. H. Hostetter, C. J. Savant and R. T. Stefani, Design of feedback control systems, Holt,
Rinehart and Winston, 1982.
Chapter 5
Time Response-Based Design
Consider the closed-loop system in Fig. 5.1. In Example 4.3, Sect. 4.1, it is shown
that the closed-loop transfer function is given as:
C(s) G(s)
M(s) = = . (5.1)
R(s) 1 + G(s)H (s)
H(s)
loop zeros, i.e., G(s) = 0, are also suitably located.1 In this chapter, one of the
main classical control techniques for control design is studied: the root locus method
(see [1] for a historical perspective). This method assigns poles of the closed-loop
transfer function M(s) through a suitable modification of the open-loop transfer
function G(s)H (s). Moreover, it is also possible to place the zeros of the closed-loop
transfer function M(s) such that their effects on the closed-loop system response are
small.
Assuming that the poles and zeros of the plant are known, the root locus method is
a graphical tool that is useful to locate the closed-loop poles by suitably selecting
poles and zeros of a controller. Moreover, this can also be performed by cancelling
some undesired (slow) closed-loop poles with some controller zeros. According to
Sect. 3.5.1, this achieves system order reduction and the elimination of some zeros
such that the closed-loop system transient response can be approximated by some
of the simple cases studied in Sects. 3.1.1 and 3.3.1. This simplifies the task of
designing a controller such that the closed-loop transfer function M(s) has poles
and zeros that ensure the desired transient response specifications.
The root locus diagram is represented by several curves whose points constitute
the closed-loop system poles parameterized by the open loop-gain, k, which takes
values from k = 0 to k = +∞. According to (5.1), every closed-loop pole s, i.e.,
a point in the s plane belonging to the root locus, must satisfy 1 + G(s)H (s) = 0.
The root locus diagram is drawn by proposing points s on the complex plane s,
which are checked to satisfy 1 + G(s)H (s) = 0. To verify this condition in a simple
manner, a set of rules are proposed, which are listed next. Following these rules,
the root locus diagram is drawn using the poles and zeros of the open-loop transfer
function G(s)H (s) as data. This means that the closed-loop poles are determined
by the open-loop poles and zeros.
It is assumed that the open-loop transfer function can be written as:
$m
j =1 (s − zj )
G(s)H (s) = k $n , n > m, (5.2)
i=1 (s − pi )
1 Although the poles determine stability and transient response, zeros also have an effect on the
final shape of the transient response (see Sect. 8.1, Chap. 8). This is the reason why the design
based on the root locus is sometimes performed by trying to cancel one closed-loop pole with a
closed-loop zero.
5.1 Drawing the Root Locus Diagram 237
zj
s–
s–
lj li
pi
θi
θj
zj pi
Re (s)
s − zj = lj θj ,
s − pi = li θi ,
On the other hand, the closed-loop poles are those values of s satisfying the
following:
Using (5.3) and (5.5) the so-called magnitude condition (5.6) and angle condi-
tion (5.7) are obtained, which must be satisfied by every closed-loop pole s, i.e.,
those points s belonging to root locus:
$m
j =1 lj
k $n = 1, (5.6)
i=1 li
m
n
θj − θi = ±(2q + 1)180◦ , q = 0, 1, 2, . . . (5.7)
j =1 i=1
n
= (s − pi ) = 0,
i=1
n
m
1 + G(s)H (s) = (s − pi ) + k (s − zj ) = 0,
i=1 j =1
m
≈k (s − zj ) = 0,
j =1
$ $
because ni=1 (s−pi )
k m j =1 (s−zj ) if k → ∞. This means that the closed-
loop poles (those satisfying 1 + G(s)H (s) = 0) are identical to the open-loop
zeros (s = zj , j = 1, . . . , m) when k → ∞.
3. When k → ∞ there are n − m branches of the root locus that tend toward
some point at the infinity of the plane s. This means that the open-loop
transfer function G(s)H (s) has n − m zeros at infinity.
These branches can be identified by the angle of the asymptote where the root
locus diagram approaches as k → ∞. The angle that each asymptote forms
with the positive real axis can be computed as:
±180◦ (2q + 1)
asymptote angle = , q = 0, 1, 2, . . . (5.9)
n−m
5.1 Drawing the Root Locus Diagram 239
asymptote
open-loop
m
n
θj − θi = (m − n)θ = ±(2q + 1)180◦ , q = 0, 1, 2, . . .
j =1 i=1
±(2q + 1)180◦
θ= , q = 0, 1, 2, . . .
n−m
5. Consider a point on the real axis of the plane s. Suppose that the number of
real open-loop poles plus the number of real open-loop zeros on the right
of such a point is equal to an odd number. Then such a point on the real
axis belongs to the root locus. If this is not the case, then such a point does
not belong to the root locus.
240 5 Time Response-Based Design
Observe Fig. 5.4 and recall the angle condition (5.7). Notice that two open-
loop complex conjugate poles or zeros produce angles that added to result in
0◦ or 360◦ and, hence, have no contribution to the angle condition (5.7). This
means that, in this rule, only real open-loop poles and zeros must be considered
in (5.7). On the other hand, notice that any real pole or zero located at the left
of the test point s contributes with a zero angle. This means that, in this rule,
in the expression (5.7), only real open-loop poles and zeros located on the right
of the test point s must be considered. Notice that each real open-loop zero on
the right of the point s contributes with a +180◦ angle, whereas each real open-
loop pole at the right of the same point contributes with a −180◦ angle. Hence,
the total angle contributed by all open-loop poles and zeros appearing on the
right of the test point s is:
m
n
θj − θi = m1 (+180◦ ) + n1 (−180◦ ),
j =1 i=1
where m1 and n1 stand for the number of real open-loop zeros and poles
respectively, on the right of the test point s. On the other hand, if the subtraction
of two numbers is equal to an odd number, then the addition of the same
numbers is also an odd number. Hence, if:
m
n
θj − θi = (m1 − n1 ) × (+180◦ ) = ±(2q + 1)180◦ ,
j =1 i=1
m
n
θj − θj = (m1 + n1 ) × (+180◦ ) = ±(2q + 1)180◦ ,
j =1 i=1
θj
θi
180° 180°
0° 0° s
Re(s)
θ 0i θ 0j
θi θj
pi zj
Re (s)
Consider Fig. 5.5. Assume that the point s belongs to the root locus and it is
very close to open-loop pole at pv . The angle θpv is the departure angle from
the open-loop complex pole at pv . According to the angle condition (5.7):
m
n
θj − θi =
j =1 i=1
where θzj and θpi stand for the angles due to the open-loop zeros and poles
respectively. Solving for θpv :
θi θj
pi zj
Re (s)
Consider Fig. 5.6. Assume that the point s belongs to the root locus and is
very close to zero at zv . The angle θzv is the arrival angle to the open-loop zero
at zv . According to the angle condition (5.7):
m
n
θj − θi =
j =1 i=1
where q = 0, 1, 2, . . . , whereas θzj and θpi stand for the angles due to the
open-loop zeros and poles respectively. Solving for θzv :
10. The points where the root locus passes through the imaginary axis can be
determined using Routh’s criterion (see Sect. 4.3).
11. If an additional open-loop pole located on the left half-plane is considered,
“instability tends to increase” in the closed-loop system. This effect is
stronger as the additional pole is placed closer to the origin.
Consider Fig. 5.7, where s represents a point that belongs to the root locus and
the open-loop transfer function is assumed to have only the shown two poles
without zeros. According to the angle condition (5.7):
The poles at p1 and p2 are retained in Fig. 5.8, but an additional pole is
considered at p3 . The angle condition (5.7) now becomes:
This means that the addition θp1 + θp2 must be smaller in Fig. 5.8 with respect
to Fig. 5.7, which is accomplished if point s in Fig. 5.7 moves to the right, as
in Fig. 5.8, i.e., if the root locus bends toward the right in Fig. 5.8. It is easy to
see that this effect is stronger, i.e., the root locus is further pushed to the right
half-plane, as θp3 is larger, i.e., as p3 approaches the origin. This proves that
and integral controller tends to produce instability in the closed-loop system.
12. If an additional open-loop zero located on the left half-plane is considered,
“stability tends to increase” in the closed-loop system. This effect is
stronger as the additional zero is placed closer to the origin.
Consider again Fig. 5.7. According to the angle condition (5.7):
The poles at p1 and p2 are retained in Fig. 5.9, but an additional zero at z1 is
considered. The angle condition (5.7) now becomes:
This means that the addition θp1 +θp2 must be larger in Fig. 5.9 than in Fig. 5.7,
which is accomplished if point s in Fig. 5.7 moves to the left as in Fig. 5.9, i.e.,
if the root locus bends toward the left in Fig. 5.9. It is easy to see that this effect
is stronger, i.e., the root locus is pulled to the left, as θz1 is larger, i.e., as z1 is
closer to the origin. This proves that a derivative controller tends to improve the
stability of a closed-loop system.
244 5 Time Response-Based Design
s Im (s)
θp2 θp1
p2 p1 Re (s)
Fig. 5.7 A point belonging to the root locus for an open-loop system with two poles
Im (s) s
θp1
θp2 θp3
p2 p3 p1 Re (s)
Fig. 5.8 The root locus is pushed toward the right when an additional open-loop pole is considered
s Im (s)
p2 z1 p1 Re (s)
Fig. 5.9 The root locus is pulled toward the left when an additional open-loop zero is considered
5.2 Root Locus-Based Analysis and Design 245
According to Chap. 11, the permanent magnet brushed direct current (DC) motor
model is given as:
k
θ (s) = I ∗ (s), (5.12)
s(s + a)
b nkm
a= > 0, k= > 0,
J J
where θ (s) and I ∗ (s) stand for the position and the electric current commanded
respectively. Suppose that the following proportional position controller is
employed:
where θd (s) is the desired position and kp is a constant known as the proportional
gain. The closed-loop system can be represented as in Fig. 5.10, where it is
concluded that the open-loop transfer function is given as:
kp k
G(s)H (s) = . (5.13)
s(s + a)
Notice that the system type is 1, i.e., the steady state error is zero when the desired
position is a step. Hence, the only design problem that remains is to choose kp
such that the closed-loop poles are assigned to the desired locations. Use of the root
locus method to solve this problem is shown in the following. The root locus method
forces the gain kp to take values from 0 to +∞. First, G(s)H (s) is rewritten as:
kp k
G(s)H (s) = − (θ1 + θ2 ),
l1 l2
Im (s)
s
β β
l2 l1
t1 t2
θ2 α θ1
–a – a2 0 Re (s)
kp k
Fig. 5.11 Root locus for G(s)H (s) = s(s+a)
Rule 5 indicates that, on the real axis, the root locus only exists between the points
s = 0 and s = −a. Furthermore, according to rule 1, the root locus begins (kp = 0)
at s = 0 and s = −a. On the other hand, according to rules 2 and 3, the branches
starting at s = 0 and s = −a must approach some open-loop zero (no zero exists in
this case) or some point at the infinity of the plane s as kp tends to +∞. Hence, the
root locus has to move away from points s = 0 and s = −a, on the real axis, as kp
increases such that a breakaway point must exist somewhere between such points
and then two branches appear to be moving away to infinity in plane s.
On the other hand, according to the angle condition, −(θ1 + θ2 ) = −180◦ =
−(α + θ1 ) in Fig. 5.11, it is concluded that α = θ2 , i.e., both triangles t1 and t2 must
be identical for any closed-loop pole s. Hence, both branches referred above, which
are shown in Fig. 5.11, must be parallel to the imaginary axis. This means that the
breakaway point is located at the middle point between s = 0 and s = −a, i.e., at
(0 − a)/2 = −a/2. This can also be verified using rules 3 and 4. Finally, according
to rule 6, both branches are symmetrical with respect to the real axis.
The magnitude condition is employed when the exact value of kp that renders a
specific point of the root locus an actual closed-loop pole is required. Notice, for
instance, that lengths l1 and l2 grow as kp tends to +∞ to satisfy the magnitude
condition:
kp k
= 1, (5.14)
l1 l2
5.2 Root Locus-Based Analysis and Design 247
which means that the closed-loop poles corresponding to large values of kp tend to
some point at infinity on the s plane. Hence, it is concluded: (i) Both closed-loop
poles are real, negative, different, and approach the point s = −a/2 when kp > 0
is small; this means that the closed-loop system becomes faster because the slowest
pole moves away from the origin, (ii) According to the magnitude condition, when:
l1 l2 a2 a
kp = = , with l1 = l2 = ,
k 4k 2
both closed-loop poles are real, repeated, negative, and located at s = − a2 , i.e.,
2
the fastest response without oscillations is obtained, (iii) As kp > a4k increases,
both poles move away from the real axis (one pole moves upward and the other
downward) on the vertical line passing through s = − a2 ; this means that the
closed-loop system becomes faster (because ωn increases; see Sect. 3.3) and more
oscillatory (because the angle 90◦ − α decreases and damping, given as ζ =
sin(90◦ − α), decreases; see Sect. 3.3).
The above discussion shows that it is not possible to achieve a closed-loop system
response that is simultaneously fast and well damped. This is a direct consequence
of the fact that closed-loop poles cannot be assigned at any arbitrary location of the
s plane, as they can only be located on the thick straight line shown in Fig. 5.11.
In the next example, it is shown that the introduction of an additional zero in the
open-loop transfer function of the present example allows the closed loop poles to
be assigned at any point on the s plane.
Example 5.1 The root locus diagram can also be plotted using MATLAB. Given a
closed-loop system as that in Fig. 5.1, it suffices to use the command:
rlocus(GH)
where GH stands for the open-loop transfer function G(s)H (s). Consider, for
instance, the closed-loop system in Fig. 5.10 when k = 2 and a = 8. The root
locus diagram in Fig. 5.12 is plotted using the following commands:
k=2;
a=8;
gh=tf(k,[1 a 0]);
rlocus(gh);
rlocfind(gh)
The root locus in Fig. 5.12 is represented by the continuous lines. Notice that,
contrary to the previous discussion, in the above commands the proportional gain
kp is not considered. This is because kp is automatically increased from 0 to +∞
by MATLAB when executing the command “rlocus()”. This must be taken into
account when defining the open-loop transfer function to be used as an argument
of this MATLAB command. In Fig. 5.12, each open-loop pole is represented by a
symbol “×”, i.e., at s = 0 and s = −a = −8. Compare Figs. 5.12 and 5.11 to
verify similarities between them. For instance, the horizontal and vertical lines in
248 5 Time Response-Based Design
Root Locus
5
2
Imaginary Axis
−1
−2
−3
−4
−5
−9 −8 −7 −6 −5 −4 −3 −2 −1 0 1
Real Axis
Fig. 5.12 intersect at s = −4, i.e., at s = −a/2, as predicted in Fig. 5.11. The root
locus diagram is plotted by MATLAB when executing the command
rlocus(gh);
alone. However, the additional use of the command:
rlocfind(gh)
allows the user to select any desired point on the root locus. When selected, this
point and all points on the root locus corresponding to the same gain kp are marked
with a symbol “+”. For instance, in Fig. 5.12 the point −4 + 3j was selected and,
automatically, the point −4 − 3j was also selected and marked with a “+” (only the
horizontal line of this symbol is appreciable in Fig. 5.12 because of the particular
geometry of this root locus). Also, MATLAB automatically sends the following text:
selected_point =
-3.9882 + 2.9969i
ans =
12.4907
This means that kp = 12.4907 at s = −4 ± 3j and this can be verified using the
magnitude condition in (5.14) as:
s − 0 = l1 θ1 , s − (−a) = l2 θ2 ,
l1 = 42 + 32 = 5, l2 = (8 − 4)2 + 32 = 5,
5.2 Root Locus-Based Analysis and Design 249
l1 l2 25
kp = = = 12.5.
k 2
When using the command “rlocus()”, MATLAB automatically determines a max-
imal value of kp to be considered to draw Fig. 5.12. However, the user can decide
herself/himself the maximal value of kp to be considered by using the command:
rlocus(gh,d);
where d is a vector containing all of the specific values of the gain kp , which the
user wants to be considered to plot the root locus.
Some closed-loop pole pairs are selected in Fig. 5.13. The time response of
the closed-loop system Fig. 5.10 is presented in Fig. 5.14 when the corresponding
closed-loop pole pairs are those indicated in Fig. 5.13. Recall that kp increases as
it passes from poles at “o” to poles at the square in Fig. 5.13. It is observed that
the closed-loop system response becomes faster as kp increases and overshoot is
present once the closed-loop poles have imaginary parts that are different from zero.
Moreover, overshoot is small if the imaginary parts are small. These observations
corroborate the above root locus-based analysis.
The results in Figs. 5.13 and 5.14 were obtained by executing several times the
following MATLAB code in an m-file:
k=2;
a=8;
kp=30; % 1 5 10 20 30
gh=tf(kp*k,[1 a 0]);
figure(1)
rlocus(gh);
hold on
rlocus(gh,34);
axis([-10 2 -9 9])
hold on
M=feedback(gh,1,-1);
v=pole(M);
figure(1)
plot(real(v(1)),imag(v(1)),’bs’)
plot(real(v(2)),imag(v(2)),’bs’)
figure(2)
step(M,’b:’,5)
hold on
250 5 Time Response-Based Design
Root Locus
4
Imaginary Axis
−2
−4
−6
−8
−10 −8 −6 −4 −2 0 2
Real Axis
Fig. 5.13 Root locus in Fig. 5.12 when some closed-loop pole pairs are selected
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
Fig. 5.14 Step response of the closed-loop system in Fig. 5.10, when the closed-loop poles are
located as indicated in Fig. 5.13. The +line corresponds to poles at “o.” The continuous line
corresponds to poles at the triangle up. The dashed line corresponds to poles at the triangle down.
The dash–dot line corresponds to poles at “*.” The dotted line corresponds to poles at the square
5.2 Root Locus-Based Analysis and Design 251
Consider again the motor model shown in (5.12), but now together with the
following proportional–derivative (PD) controller:
de
i ∗ = kp e + kd , e = θd − θ,
dt
where kp is the proportional gain and kd is a constant known as the derivative gain.
Use of the Laplace transform yields:
The corresponding closed-loop block diagram is shown in Fig. 5.15. The open-loop
transfer function is given as:
kd k(s + c) kp
G(s)H (s) = , c= > 0. (5.15)
s(s + a) kd
Notice that, now, kd is the gain that varies from 0 to +∞ to plot the root locus. First,
G(s)H (s) is rewritten as:
k d k l3
G(s)H (s) = θ3 − (θ1 + θ2 ), (5.16)
l1 l2
The root locus in this case can be obtained from the root locus obtained for the
transfer function in (5.13) by simply taking into account that an additional zero at
s = −c has been included.
According to rule 12, the branches of the root locus in Fig. 5.11 will bend toward
the left as a consequence of the additional zero. This can be verified using rule 3 to
find that, now, the root locus only has one branch whose asymptote forms a ±180◦
with the positive real axis. As shown in Fig. 5.16, the root locus has two different
possibilities depending on the exact location of the zero at s = −c. If it is placed at
the left of the pole at s = −a (as in Fig. 5.16a) then, according to rule 5, the root
252 5 Time Response-Based Design
θd(s) + k I*(s) k
θ(s)
kd s + p
k d s(s+a)
–
–c –a Re(s)
(a)
Im(s)
–a –c Re(s)
(b)
locus exists on two segments of the negative real axis: between the points s = 0 and
s = −a, and to the left of zero at s = −c. Moreover, according to rules 2 and 3 one
of the two root locus branches beginning (kd = 0) at the open-loop poles located at
s = 0 and s = −a must tend toward the zero at s = −c whereas the other branch
must tend toward infinity in the s plane following the asymptote forming ±180◦
with the positive real axis. Hence, a breakaway point must exist between points
s = 0 and s = −a. Furthermore, as the root locus is symmetrical with respect to
the real axis (rule 6), these branches must describe two semi circumferences toward
the left of the breakaway point, which join again in a break-in point located on the
negative real axis to the left of the zero at s = −c. After that, one branch approaches
the zero at s = −c and the other tends toward infinity along the negative real axis.
On the other hand, if the zero at s = −c is placed between the open-loop poles at
s = 0 and s = −a, then, according to rule 5, the root locus exists on two segments
on the negative real axis located between points s = −c and s = 0 and on the left
of the pole at s = −a. Notice that, now, the branch beginning (kd = 0) at s = 0
approaches the zero at s = −c, whereas the branch beginning (kd = 0) at s = −a
tends toward infinity along the negative real axis. Also notice that this is possible
without the necessity for any branch to exist outside the real axis, as is shown in
Fig. 5.16b.
5.2 Root Locus-Based Analysis and Design 253
From the study of the resulting root locus, it is possible to realize that the closed-
loop system is stable for any kp > 0 and kd > 0 because both possibilities for the
root locus that have been presented in Fig. 5.16 show that the closed-loop poles are
always located on the left half-plane s, i.e., the closed-loop poles have a negative real
part. Finally, according to Sect. 3.8.3, there always exist gains kp and kd allowing
any values to be chosen for both ωn and ζ . This means that it is always possible to
assign both closed-loop poles at any desired point on the left half-plane s.
Notice that the open-loop zero at s = −c is also a zero of the closed-loop transfer
function; hence, it also affects the closed-loop system transient response. This
means that the transient response will not have the exact specifications computed
using (3.71).
Example 5.2 The following MATLAB code is executed in an m-file to simulate the
closed-loop system in Fig. 5.15:
clc
a=7;
k=70;
c=4; %7 4 10
Polo_des=-20;
l3=abs(Polo_des)-c;
l1=abs(Polo_des);
l2=abs(Polo_des)-a;
kd=l1*l2/(k*l3);
kp=c*kd;
Md=tf(20,[1 20]);
gm=tf(k,[1 a 0]);
PD=tf([kd kp],1);
M=feedback(gm*PD,1,-1);
v=pole(M)
%{
figure(1)
rlocus(gm*PD);
hold on
plot(real(v(1)),imag(v(1)),’k^’);
plot(real(v(2)),imag(v(2)),’k^’);
%}
figure(2)
step(Md*2,’r--’,M*2,’:’,0.25)
hold on
It is assumed that a = 7 and k = 70. The desired response is that of a first-order
system with time constant 0.05[s], i.e., with a real pole at s = −20. The idea is
to propose different locations for the zero at s = −c to observe when the desired
response is accomplished. The derivative gain kd is computed using the magnitude
condition kdl1kl2l3 = 1 where l1 , l2 , l3 are the magnitude of the vectors defined in
254 5 Time Response-Based Design
Step Response
2.5
1.5
Amplitude
0.5
0
0 0.05 0.1 0.15 0.2 0.25
Time (sec)
Fig. 5.17 Step response of the closed-loop system in Fig. 5.15, when a closed-loop first-order
response with 0.05[s] time constant is desired. Dashed: desired response and closed-loop response
when c = a. Dotted: closed-loop response when c = 4. Continuous: closed-loop response when
c = 10
the paragraph after (5.16). Then kp = ckd is computed. After that, it is possible
to generate the closed-loop transfer function M and to simulate it together with
the desired response. These results are shown in Fig. 5.17. Notice that the desired
response is matched when c = a. The root locus diagram in this case is shown in
Fig. 5.18 where the closed-loop poles are represented by a triangle up. One closed-
loop pole is located at s = −20, as desired, and the other cancels with the zero at
s = −c. This explains why the desired response is accomplished in this case.
When c = 4, the closed-loop poles are at s = −20, as desired, and s = −3.25.
The latter pole is slow and does not cancel with zero at s = −c = −4; hence, its
effects are important in the closed-loop transient response. This explains why, in
this case, the response in Fig. 5.17 is slow. When c = 10, the closed-loop poles are
located at s = −20 and s = −13, i.e., the pole at s = −13 cannot be cancelled
by the zero at s = −c. This results in an overshoot, i.e., the desired response is not
accomplished again. The reason for this overshoot is explained in Sect. 8.1.2, where
it is stated that overshoot is unavoidable whenever all of the closed-loop poles are
on the left of an open-loop zero despite all the closed-loop poles being real, i.e., as
in the present case.
Example 5.3 The following MATLAB code is executed in an m-file to simulate the
closed-loop system in Fig. 5.15:
clc
a=7;
5.2 Root Locus-Based Analysis and Design 255
Root Locus
1.5
0.5
Imaginary Axis
−0.5
−1
−1.5
−25 −20 −15 −10 −5 0 5
Real Axis
k=70;
tr=0.05;
Mp=14;%
z=sqrt( log(Mp/100)^2 /( log(Mp/100)^2 + pi^2 ) );
wn=1/(tr*sqrt(1-z^2))*(pi-atan(sqrt(1-z^2)/z));
s=-z*wn+wn*sqrt(1-z^2)*j
kd=(2*z*wn-a)/k;
kp=wn^2/k;
den1=conv([1 -s],[1 -real(s)+j*imag(s)]);
Md=tf(den1(3),den1);
gm=tf(k,[1 a 0]);
PD=tf([kd kp],1);
M=feedback(PD*gm,1,-1);
v=pole(M)
%%{
figure(1)
rlocus(gm*PD);
hold on
plot(real(v(1)),imag(v(1)),’k^’);
plot(real(v(2)),imag(v(2)),’k^’);
%}
figure(2)
step(Md*2,’r--’,M*2,’-’,0.25)
hold on
256 5 Time Response-Based Design
Root Locus
60
40 X: −26.66
Y: 42.6
20
Imaginary Axis
−20
−40
−60
−200 −150 −100 −50 0 50
Real Axis
Fig. 5.19 Root locus diagram corresponding to Fig. 5.15 when c > a and two closed-loop
complex conjugate poles are specified (triangle up)
The desired specifications are a rise time of 0.05[s] and a 14% overshoot. This
results in a pair of desired complex conjugate closed-loop poles located at s =
−26.66 ± 42.59j . The controller gains kp and kd were computed using:
2ζ ωn − a ωn2
kd = , kp = ,
k k
(see Sect. 3.8.3). This allows the corresponding root locus diagram to be plotted in
Fig. 5.19. Notice that this diagram is similar to that depicted in Fig. 5.16a because
c > a in this case. Although the desired closed-loop poles have been assigned,
notice that the closed-loop zero at s = −c cannot be cancelled; hence, it will modify
the actual closed-loop response with respect to the desired one. As a matter of fact,
in Fig. 5.20, the desired response, with a dashed line, and the actual closed-loop
response, with a continuous line, are presented. We conclude that the effects of the
zero at s = −c are a shorter rise time and a larger overshoot.
Consider again the DC motor model in (5.12) but, now, together with the following
controller:
s+d
I ∗ (s) = γ , c > d > 0, γ > 0,
s+c
5.2 Root Locus-Based Analysis and Design 257
Step Response
2.5
1.5
Amplitude
0.5
0
0 0.05 0.1 0.15 0.2 0.25
Time (sec)
Fig. 5.20 Step response of the closed-loop system in Fig. 5.15, when c > a and two closed-
loop complex conjugate poles are specified. Dashed: desired response. Continuous: closed-loop
response
d = a, (5.18)
θ (s) γk ωn2
= 2 = 2 ,
θd (s) s + cs + γ k s + 2ζ ωn s + ωn2
258 5 Time Response-Based Design
Although proportional–integral (PI) velocity control has been studied in Sect. 3.8.4,
in this part, some ideas are presented that are clearer when employing block
diagrams and the root locus. According to Chap. 10, when the velocity ω(s) is the
output, the permanent magnet brushed DC motor model is:
1 1
ω(s) = [kI ∗ (s) − Tp (s)],
s+a J
b nkm
a = > 0, k = > 0,
J J
where the commanded electric current I ∗ (s) is the input and Tp (s) is an external
torque disturbance. A PI velocity controller is given as:
t
i ∗ = kp e + ki e(r)dr, e = ωd − ω,
0
where ωd is the desired velocity, kp is the proportional gain and the constant ki is
known as the integral gain. Using the Laplace transform:
E(s)
I ∗ (s) = kp E(s) + ki ,
s
ki
= kp + E(s),
s
kp s + ki
= E(s),
s
⎛ ⎞
s + kkpi
= kp ⎝ ⎠ E(s).
s
5.2 Root Locus-Based Analysis and Design 259
Hence, the closed-loop block diagram is depicted in Fig. 5.22a. As this control
system has two inputs, the superposition principle can be employed (see Sect. 3.7)
to write:
where G1 (s) is the transfer function obtained when using ωd (s) as the input and
ω(s) as the output and assuming Tp (s) = 0, i.e., using the block diagram in
Fig. 5.22b, whereas G2 (s) is the transfer function when Tp (s) is the input and
ω(s) is the output, assuming that ωd (s) = 0, i.e., when using the block diagram
in Fig. 5.22c. It is important to say that, in the case when Tp (s) is the input, ω(s)
represents the velocity deviation produced by disturbance Tp (s).
Now, the problem of choosing the PI controller gains such that the transient
response of the closed-loop system satisfies the desired specifications is studied.
It is observed in Fig. 5.22b, that the open-loop transfer function is:
kp k(s + c) ki
G(s)H (s) = , c= , (5.20)
s(s + a) kp
Notice that the system type is 1, which ensures that ω(t) = ωd in a steady state if
ωd is a constant. This is one reason for using a PI controller in this example. Hence,
the only problem that remains is to choose the controller gains kp and ki , such that
the transient response satisfies the desired specifications. To this aim, notice that
the open-loop transfer function shown in (5.20) is identical to the transfer function
shown in (5.15), which corresponds to the PD control of position as only kd has to
be replaced by kp . Thus, the root locus diagram corresponding to the PI velocity
control is identical to both cases shown in Fig. 5.16 and the same conclusions are
obtained:
i) There always exist some gains kp and ki allowing both closed-loop poles to be
placed at any point on the left half-plane; hence, it is possible to tune the PI
controller using a trial and error procedure (see Sect. 3.8.4).
ii) The open-loop zero located at s = −c is also a zero of the closed-loop transfer
function G1 (s), i.e., it also affects the closed-loop transient response. This means
that the transient response does not have the specifications designed using (3.71)
to choose the closed-loop poles. This poses the following two possibilities.
T p(s)
1
J
–
ω d(s) + k I *(s) + ω(s)
s+k pi 1
kp k s+a
s
–
(a)
ω d(s) + k ω(s)
s+k pi k
kp s s+a
–
(b)
T p(s) ω(s)
1 – 1
J s+a
–
k
s+k pi
k pk s
(c)
Fig. 5.22 Proportional–integral control of velocity . (a) The complete control system. (b) Tp (s) =
0. (c) ωd (s) = 0
This means that the closed-loop response is as that of a first-order system with a
unit steady state gain and a time constant given as kp1k . Then, if a time constant
τ is specified:
1
kp k = . (5.22)
τ
The conditions in (5.22) and (5.21) represent a simple tuning rule. Finally, the
k k
root locus diagram corresponding to this case (c = a, G(s)H (s) = ps ) is shown
5.2 Root Locus-Based Analysis and Design 261
–c
–a Re(s)
in Fig. 5.23. This can be easily verified using rules 3 and 5. As there is only one
open-loop pole, there is only one closed-loop pole, which must be real and tends
toward one zero at infinity (on an asymptote forming −180◦ with the positive real
axis) because there is no open-loop zero. Furthermore, the magnitude condition:
kp k
= 1,
l1
where l1 is the distance from the desired closed-loop pole to the origin,
establishes that the desired closed-loop pole located at s = − τ1 is reached when:
1 1
kp k = l1 , l1 = ⇒ kp k = ,
τ τ
which corroborates (5.22). However, this tuning rule has a problem when con-
sidering the closed-loop response when an external disturbance Tp (s) appears.
Consider the block diagram in Fig. 5.22c. If c = a is chosen, then the closed-
loop transfer function is:
ω(s) − Jk s
= . (5.23)
Tp (s) (s + kp k)(s + a)
− Jk s td
= lim s = 0,
s→0 (s + kp k)(s + a) s
i.e., that the velocity deviation produced by the external torque disturbance with
a constant value td vanishes in a steady state. This is the reason why a PI velocity
controller is chosen. However, there is a problem. The poles of the transfer
262 5 Time Response-Based Design
function in (5.23) determine how fast this velocity deviation vanishes. These
poles are located at s = −kp k and s = −a. Although one of these poles can
be rendered as fast as desired just by choosing a suitable kp , the other pole, at
s = −a, cannot be modified and depends on the parameters of the DC motor.
This has as a consequence that the velocity deviation due to the disturbance may
approach zero very slowly, which is a serious drawback.
2. Trying to solve the above problem, we might abandon the tuning rule in (5.22)
and (5.21). As we now have c = a, the closed-loop transfer function correspond-
ing to the block diagram in Fig. 5.22c is:
ω(s) − Jk s
= 2 . (5.24)
Tp (s) s + (a + kp k)s + kp kc
Using the final value theorem, it can be easily verified that, in the case of
a constant disturbance Tp (s) = tsd , the steady-state deviation is zero again:
limt→∞ ω(t) = 0, because the transfer function in (5.24) has a zero at s = 0. On
the other hand, poles of the transfer function in (5.24), which determine how
fast the velocity deviation vanishes, are identical to the poles of the transfer
function ωω(s)
d (s)
= G1 (s); hence, they can be assigned using the root locus method
from (5.20). As has been explained, the corresponding root locus is identical to
both cases shown in Fig. 5.16 replacing kd by kp . It is important to stress that
the transfer function in (5.24) has no zero at s = −c shown in the root locus
diagram in Fig. 5.16. This means that none of the closed-loop poles obtained
using the root locus method can cancelled with the zero at s = −c and the
slowest pole will have the most significant effect on the time required for the
velocity deviation due to the disturbance to vanish. With these ideas in mind, the
following is concluded.
• To render small the effect of the zero at s = −c on the transient response to
a given velocity reference, one closed-loop pole must be placed close to the
zero at s = −c. The other closed-loop pole (the fastest one) moves away to
the left and tends toward infinity as the slow pole approaches to s = −c.
• This means that the fast pole determines the transient response, i.e., the time
constant, to a given velocity reference. Then, if it is desired to fix some finite
value for the time constant (such that the fast pole is placed at a finite point on
the negative real axis), the slow pole is always relatively far from zero at s =
−c. This means that the transient response is always affected by both poles
and the zero at s = −c. Hence, if c = a, a tuning rule cannot be determined
such that transient response to a given velocity reference satisfies the desired
specifications. Notice that this is also true if the response to a reference is
specified by two complex conjugate poles, as the zero at s = −c cannot be
cancelled; hence, it has the effect of modifying the transient response with
respect to that specified by the two complex conjugate poles.
5.2 Root Locus-Based Analysis and Design 263
kp kl1
= 1,
l3 l2
ki l2 l3
= c, c < p1 , kp = , (5.25)
kp l1 k
l1 = abs(−p1 + c), l2 = abs(−p1 ), l3 = abs(−p1 + a).
Tp
1
PID(s) 70 Scope
s+7
w_d Add1
Add Gain
InputOutput
Fig. 5.24 MATLAB/Simulink diagram corresponding to the closed-loop system in Fig. 5.22a
The simulation in Fig. 5.24, was performed with the help of the following
MATLAB code in an m-file:
a=7;
k=70;
Polo_des=-20;
c=15; %1 5 7 10 15
l1=abs(Polo_des)-c;
l2=abs(Polo_des);
l3=abs(Polo_des)-a;
kp=l2*l3/(k*l1);
ki=c*kp;
PI=tf(kp*[1 c],[1 0]);
gm=tf(k,[1 a]);
M=feedback(PI*gm,1,-1);
figure(1)
gd=tf(20,[1 20]);
step(M*2,’b:’,gd*2,’r--’,0.2)
hold on
%%{
nn=length(InputOutput(:,2));
n=nn-1;
Ts=10/n;
t=0:Ts:10;
figure(2)
plot(t,InputOutput(:,2),’k:’);
axis([-0.5 10 0 2.5])
xlabel(’t [s]’)
ylabel(’w [rad/s]’)
hold on
%}
In this code, the desired closed-loop response is specified to be as that of a first-
order system with a time constant τ = 20 1
= 0.05[s] when a desired step velocity
is commanded. This desired response is shown in Fig. 5.25 with a dashed line. The
5.2 Root Locus-Based Analysis and Design 265
Step Response
2.5
1.5
Amplitude
0.5
0
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
Time (sec)
design criterion is to find kp and ki such that the desired closed-loop pole is assigned
at s = −20, provided that a ratio kkpi is given. This allows to the system response
to be analyzed when the integral gain is enlarged and one closed-loop pole is at the
desired location.
First, the location of zero at − kkpi = −c is fixed by defining the constant c. The
k kl
proportional gain kp is computed using the magnitude condition lp3 l21 = 1, where
l1 , l2 , l3 , are the magnitudes of vectors defined in the paragraph before (5.25), and
ki = ckp is also computed. Then, the closed-loop transfer function is obtained and
the closed-loop system response as well as the desired response can be simulated
using the command “step()”. These signals are shown in Fig. 5.25. At this point, the
simulation diagram in Fig. 5.24 is run and, with the help of the remaining code lines
above, the corresponding results are shown in Fig. 5.26.
In Figs. 5.25 and 5.26 the following data are presented. (i) The line marked with
“+” corresponds to c = 1, (ii) Continuous line: c = 5, (iii) Dashed line: c = 7,
(iv) Dash–dot line: c = 10, and (v) Dotted line: c = 15. Notice that the disturbance
effect is rejected very slowly when c = 1. In this case, the closed-loop poles are at
s = −20 and s = −0.6842, which can be verified using the MATLAB command
“pole(M)”. Recall that the transfer function in (5.24) has no zero to cancel the pole
at s = −0.6842.2 This explains the slow rejection of the disturbance effects in this
case. Also notice that the response to the velocity reference is also slow. This is
because the effect of the pole at s = −0.6842 is not suitably cancelled by the zero
at s = −c = −1.
2 If it is assumed that this pole and zero at s = 0 cancel each other out, then a nonzero steady-state
2.5
1.5
w [rad/s]
0.5
0
0 1 2 3 4 5 6 7 8 9 10
t [s]
Notice that the disturbance rejection and the response to the reference improve
as c increases. Moreover, the system response exactly matches the desired response
when c = 7 = a. However, the disturbance effects are still important in this case.
When c > 7 = a, the disturbance rejection further improves, but the response to the
reference exhibits overshoot, i.e., it is no longer a first-order response. According to
Sect. 8.1.2, this behavior appears, and it is unavoidable, when the closed-loop poles
are on the left of an open-loop zero. In this respect, notice that the closed-loop poles
are at s = −20 and s = −13 when c = 10 and at s = −20 and s = −39 when
c = 15.
The simulation results in this example corroborate the system behavior predicted
in the above discussion, i.e., the classical PI control has limitations when it is
required to satisfy simultaneously a specified response to a reference and a specified
performance for disturbance rejection.
Consider again the DC motor model but, now, assuming the presence of an external
disturbance:
1 1
θ (s) = [kI ∗ (s) − Tp (s)],
s(s + a) J
5.2 Root Locus-Based Analysis and Design 267
where θd is the desired position and the constants kp , kd and ki are known as
the proportional, derivative, and integral gains respectively. Use of the Laplace
transform, yields:
E(s)
I ∗ (s) = kp E(s) + kd sE(s) + ki ,
s
ki
= kp + kd s + E(s),
s
kp ki
s2 + kd s + kd
= kd E(s),
s
and the corresponding block diagram is shown in Fig. 5.27a. As this is a system
with two inputs, the superposition principle (see Sect. 3.7) can be used to write:
where G1 (s) is the closed-loop transfer function when θd (s) is the input and θ (s) is
the output with Tp (s) = 0, i.e., when the block diagram in Fig. 5.27b is used to find:
k
θ (s) kd k s 2 + kpd s + kkdi
= G1 (s) = 3 , Tp (s) = 0. (5.26)
θd (s) s + (a + kd k)s 2 + kp ks + ki k
On the other hand, G2 (s) is the closed-loop transfer function when Tp (s) is the input
and θ (s) is the output with θd (s) = 0, i.e., when the block diagram in Fig. 5.27c is
employed to write:
θ (s) − Jk s
= G2 (s) = 3 , θd (s) = 0. (5.27)
Tp (s) s + (a + kd k)s 2 + kp ks + ki k
It is stressed that when Tp (s) is the input, then θ (s) stands for the position deviation
(with respect to θd (s)) produced by the external disturbance. Using the final value
theorem, it is found that:
− Jk s td
= lim s = 0,
s→0 s + (a + kd k)s + kp ks + ki k s
3 2
268 5 Time Response-Based Design
T p(s)
1
J
–
θ d(s) + kp k
s 2+ k s+ k i
I *(s) + θ (s)
1
kd d d k s(s+a)
s
–
(a)
θ d(s) + kp k
s 2+k s+k i
θ(s)
d d
k
kd s s(s+a)
–
(b)
T p(s) θ(s)
1 – 1
J s(s+a)
–
k k
s 2+k ps+k i
d d
k dk s
(c)
Fig. 5.27 Proportional–integral–derivative (PID) position control . (a) The complete control
system. (b) Tp (s) = 0. (c) θd (s) = 0
of the transfer function in (5.26) to a polynomial with roots at the desired points
s = p 1 , s = p2 , s = p3 :
It is clear that any values can be assigned to the coefficients of the characteristic
polynomial by using suitable combinations of the controller gains kp , kd and ki . This
means that the three poles of the closed-loop system can be assigned at any desired
location of the left half-plane. Any set of three poles satisfying this requirement can
be written as:
Notice that σ1 = σ2 if ω1 > 0, i.e., when a pair of complex conjugate poles exists,
but σ1 = σ2 is possible when ω1 = 0. Hence:
Equating the coefficients and using the above data, the following tuning rule is
obtained:
−(σ1 + σ2 + p3 ) − a
kd = > 0, (5.28)
k
σ1 σ2 + ω12 + p3 σ1 + σ2 p3
kp = > 0,
k
−p3 (σ1 σ2 + ω12 )
ki = > 0.
k
It is stressed that the three controller gains are positive. As a rule of thumb, if
−p3 > 6|σ1 | then the real and imaginary parts of the poles at p1 and p2 can be
computed using (3.71) such that the desired rise time tr and overshoot Mp (%) are
obtained. However, the system response presents some important differences with
respect to these values because of the pair of zeros contained in the transfer function
in (5.26). Although this is an important drawback of the tuning rule in (5.28), these
values can be used as rough approximations of the required gains for the controller
to perform fine adjustments afterward, by trial and error, until the desired transient
response specifications are accomplished. To this aim, as the closed-loop system is
third order, it is important to recall the stability rule obtained in Example 4.12 of
Sect. 4.3. The possibility of adjusting the gains of a PID controller by trial and error
(see Sect. 5.3) is one of the main reasons for the success of PID control in industry.
270 5 Time Response-Based Design
With the aim of finding a tuning rule allowing to exactly compute the gains of a
PID controller, the root locus method is employed in the following. From the block
diagram in Fig. 5.27b, it is concluded that the open-loop transfer function is given as:
kd k(s + α)(s + β) kp ki
G(s)H (s) = , (s + α)(s + β)=s 2 + s + , (5.29)
s 2 (s + a) kd kd
for some constants α and β different from zero whose values are proposed as part of
the design process. Then, from these values both kp and ki are computed. Notice that
kd is the gain that the method varies from 0 to +∞ to plot the root locus diagram. It
is clear that the system type is 2 (the motor is naturally provided with an integrator
and another integrator is introduced by PID controller) and, hence, the steady-state
error is zero if the reference of the position is constant.
Three possibilities for the corresponding root locus diagram are presented in
Fig. 5.28. They depend on the values proposed for α and β. The reader is encouraged
to use the rules introduced in Sect. 5.1.1 to corroborate these results. According to
Fig. 5.28a, it is possible to design the control system such that two closed-loop poles
are close to the zeros located at s = −α and s = −β. This would allow the closed-
loop system to respond as a first-order system with one real and negative pole. One
closed-loop pole may also be chosen to be close to the zero at s = −α such that
the closed-loop system responds as a second-order system with complex conjugate
poles and one real zero. Although the presence of this zero modifies the transient
response, this is one way of specifying the transient response in terms of rise time
and overshoot. This is the design criterion used in the following.
In cases like this one, the traditional root locus-based design procedures suggest
performing the following three steps:
• Design a PD controller with transfer function:
kd (s + β),
such that some desired rise time and overshoot are accomplished.
• Given the open-loop transfer function designed in the previous step, introduce
the following factor:
s+α
,
s
with α some positive value close to zero.
• Compute the PID controller gains using (5.29), i.e.,
(a)
Im(s)
+
–β –a –α Re(s)
(b)
–α Im(s)
+
–a Re(s)
–β
(c)
s 2 + (a + kd k)s + kd kβ = s 2 + 2ζ ωn s + ωn2 ,
yields:
2ζ ωn − a ωn2
kd = , β= . (5.32)
k kd k
272 5 Time Response-Based Design
Im(s)
Re(s)
Fig. 5.30 Root locus diagram for the system in Fig. 5.29
The values for ζ and ωn can be computed using (3.71) from the desired values for
rise time and overshoot. The corresponding root locus diagram is shown in Fig. 5.30,
which is identical to the case c > a depicted in Fig. 5.16, because only in this case
can the PD control of the position produce complex conjugate closed-loop poles.
From (5.31), it is found that the angle and the magnitude conditions establish:
kd kl3
θ3 − (θ1 + θ2 ) = ±180◦ (2q + 1), q = 1, 2, . . . = 1, (5.33)
l1 l2
where l1 , l2 , l3 , θ1 , θ2 and θ3 are defined in Fig. 5.30. When the factor s+α
s is included
in the open-loop transfer function shown in (5.31), the resulting open-loop transfer
function becomes:
kd k(s + β)(s + α)
G(s)H (s) = . (5.34)
s 2 (s + a)
As α > 0 is small, the corresponding root locus has the shape shown in Fig. 5.31.
The reader is encouraged to follow the rules in Sect. 5.1.1 to verify this result. The
angle and the magnitude conditions are established in this case from (5.34) as:
kd kl3 l5
θ3 + θ5 − (2θ1 + θ2 )= ± 180◦ (2q + 1), q=1, 2, . . . = 1, (5.35)
l12 l2
Im(s)
θ5
l1
l3 l2 l5 θ1
θ3 θ2
–β –a –ε –α +
Re(s)
Fig. 5.31 Root locus for the open-loop transfer function shown in (5.34)
obtained when the open-loop transfer function is that presented in (5.31) are almost
identical to the closed-loop poles obtained when the open-loop transfer function
employed is that presented in (5.34). This ensures that the desired transient response
specifications (rise time and overshoot) designed with the PD controller in (5.32) are
also accomplished with the PID controller:
k ki
(s + α)(s + β) s 2 + kpd s + kd
kd = kd ,
s s
i.e., when the controller gains are chosen according to (5.30).
However, it is important to point out a drawback of this design approach:
according to (5.30) a small α results in a small integral gain ki . As a consequence,
the deviation of the position produced by the external disturbance vanishes very
slowly, which may be unacceptable in practice. This can also be explained from
the root locus diagram in Fig. 5.31. Notice that a closed-loop pole (located, say, at
s = −ε, ε > 0) approaches the zero at s = −α, which means that both cancel
each other out in the transfer function shown in (5.26), i.e., the effect of none of
them is observed in the transient response to a reference of the position. However,
the zero at s = −α does not appear in the transfer function shown in (5.27). But the
pole at s = −ε is still present in this transfer function; hence, it significantly affects
the transient response: this slow pole (close to the origin) is responsible for a slow
transient response when an external disturbance appears.
Despite this drawback, the traditional criteria for root locus-based design suggest
proceeding as above when designing PID controllers. Moreover, it is interesting to
say that these problems in traditional design methods remain without a solution
despite the fact that they have been previously pointed out in some research works.
See [10] for instance.
On the other hand, according to (5.30), a larger integral gain can be obtained (to
achieve a faster disturbance rejection) by choosing a larger value for α. However,
according to the previous discussion, this will result in a transient response to a
274 5 Time Response-Based Design
Tp
1
PID(s) 70 Scope
2
theta_d Add1
Add Gain
InputOutput
Fig. 5.32 MATLAB/Simulink diagram for the closed-loop system in Fig. 5.27a
reference of position that does not satisfy the desired specifications. Hence, it is
concluded that there is no tuning rule allowing the gains of a PID controller for
position to be computed exactly, simultaneously satisfying the desired transient
response specifications to a given reference of the position and producing a satis-
factory rejection of the effects of an external torque disturbance. These observations
are experimentally verified in Chap. 11 where, given the described drawback, some
new controllers solving these problems are designed and experimentally tested.
Finally, despite the above drawback, it is important to recall what was indicated
just after (5.28): PID control is one of the most frequently employed controllers in
industry because it can be tuned by trial and error (see Sect. 5.3). This has to be
performed by taking into account the stability rule obtained in the Example 4.12,
Sect. 4.3.
Example 5.5 The MATLAB/Simulink diagram corresponding to the block diagram
in Fig. 5.27a is presented in Fig. 5.32. It is assumed that a = 7 and k = 70. The
desired position θd is a step command applied at t = 0 with 2 as the magnitude,
whereas the disturbance Tp is another step applied at t = 0.5[s] and 700 as the
magnitude. The PID controller gains are kp , kd , and ki , computed in the following
MATLAB code executed in an m-file:
clc
a=7;
k=70;
tr=0.05;
Mp=14;%
z=sqrt( log(Mp/100)^2 /( log(Mp/100)^2 + pi^2 ) );
wn=1/(tr*sqrt(1-z^2))*(pi-atan(sqrt(1-z^2)/z));
s=-z*wn+wn*sqrt(1-z^2)*j
kd=(2*z*wn-a)/k;
beta=wn^2/(k*kd)
den1=conv([1 -s],[1 -real(s)+j*imag(s)]);
Md=tf(den1(3),den1);
gm=tf(k,[1 a 0]);
PD=tf(kd*[1 beta],1);
alpha=20;%0.1 1 10 20
5.2 Root Locus-Based Analysis and Design 275
Step Response
3
2.5
2
Amplitude
1.5
0.5
0
0 0.05 0.1 0.15 0.2 0.25
Time (sec)
2.5
2
theta [rad]
1.5
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t [s]
Thus, the simulation results in this example corroborate the predictions stated in
the above discussion in the present section.
An example is presented in this section to show how the root locus method can
be used to assign the desired closed-loop poles. Consider the following transfer
function:
k
G(s)H (s) = . (5.36)
(s − 35.7377)(s + 36.5040)
The gain k is varied by the method to take values from 0 to +∞. First, G(s)H (s) is
rewritten as:
k
G(s)H (s) = − (θ1 + θ2 ),
l1 l2
Rule 5 indicates that the root locus on the real axis only exists between the points
s = 35.7377 and s = −36.5040. Moreover, according to rule 1, the root locus
begins (k = 0) at s = 35.7377 and s = −36.5040. On the other hand, according
to rules 2 and 3, when k tends to +∞ the branches starting at s = 35.7377 and
s = −36.5040 must end at some open-loop zero (there is no zero in this case) or at
some point at infinity on the s plane. Hence, the root locus must move away from
the points s = 35.7377 and s = −36.5040 on the real axis as k increases and a
breakaway point must exist somewhere between such points. Then, the branches
must move toward infinity on the s plane.
On the other hand, according to the angle condition, to −(θ1 + θ2 ) = −180◦ =
−(α + θ1 ), and to Fig. 5.35, it can be observed that α = θ2 ; hence, the triangles t1
and t2 must be identical for any closed-loop pole s. Then, both branches, which
are also shown in Fig. 5.35, must be parallel to the imaginary axis. This means
that the breakaway point on the real axis is located at the middle point between
s = 35.7377 and s = −36.5040, i.e., at (35.7377 − 36.5040)/2 = −0.7663. This
can also be verified using rules 3 and 4. Finally, according to rule 6, both branches
are symmetrical with respect to the real axis.
278 5 Time Response-Based Design
Im(s)
s
β β
l2 l1
t1 t2
θ2 θ1
α
Re(s)
–36.50 –0.7663 35.73
The magnitude condition is employed when it is required to know the exact value
of k rendering a specific point on the root locus an actual closed-loop pole. Notice,
for instance, that both l1 and l2 must increase to satisfy the magnitude condition as
k grows to +∞:
k
= 1,
l1 l2
which means that the closed-loop poles corresponding to large values of k tend
toward some points at infinity on the s plane.
Now suppose that an additional pole is included in the transfer function in (5.36)
to obtain:
116137 k
G(s)H (s) = ,
s 3 + 72.54s 2 − 1250s − 9.363 × 104
116137 k
= . (5.37)
(s − 35.7377)(s + 36.5040)(s + 71.7721)
Again, k is the gain that the method varies from 0 to +∞ to plot the root locus
diagram. First, G(s)H (s) is rewritten as:
116137 k
G(s)H (s) = − (θ1 + θ2 + θ3 ),
l1 l2 l3
Root Locus
15
10
5
Imaginary Axis
−5
−10
−15
−80 −60 −40 −20 0 20 40
Real Axis
The root locus diagram corresponding to this case can be obtained from the root
locus diagram obtained for the transfer function in (5.36) by simply taking into
account the additional pole at s = −71.7721.
According to the rule 11, the new pole is responsible for both branches of the root
locus shown in Fig. 5.35 bending to the right, as can be observed in Fig. 5.36. This
can be corroborated using rule 3 to find that, now, three branches exist, which tend
toward the asymptotes at ±180◦ and ±60◦ with respect to the positive real axis.
On the other hand, the breakaway point between the points s = 35.7377 and s =
−36.5040, which was located at (35.7377 − 36.5040)/2 = −0.7663 in Fig. 5.35,
is now shown in Fig. 5.36 shifted to the right of −0.7663. The reason for this is
explained in Fig. 5.37 where s and s stand for the points on the root locus which are
very close to the breakaway point for the case of Figs. 5.35 and 5.36 respectively. As
−(θ1 +θ2 +θ3 ) = −180◦ must be satisfied in Fig. 5.36, whereas −(θ1 +θ2 ) = −180◦
must be satisfied in Fig. 5.35, then both θ1 and θ2 must be smaller than θ1 and θ2 .
This means that the point s must be shifted to the right of the point s . Notice that
this displacement of the breakaway point to the right of the point −0.7663 is greater
as the angle θ3 introduced by the pole at s = −71.7721 is greater, i.e., as this pole
is placed farther to the right. In fact, it is observed in Fig. 5.36 that the breakaway
point is located on the right half-plane.
280 5 Time Response-Based Design
Im(s)
s, s
θ2
,
, θ1 θ2
θ3 θ1
–0.7663
Re(s)
Fig. 5.37 An additional pole moves the breakaway point to the right
This description of the root locus diagram in Fig. 5.36 allows us to conclude
that there is always at least one closed-loop pole with a positive real part, i.e., the
closed-loop system is unstable for any positive value of k. As k can be interpreted
as the gain of a proportional controller, it is concluded that it is not possible to
render the closed-loop system stable using any proportional controller and, thus,
another controller must be proposed. According to rule 12 it is required to use a
controller introducing an open-loop zero because this bends the root locus to the
left accomplishing closed-loop stability.
Consider the following open-loop transfer function:
116137(s + b)
G(s)H (s) = k , (5.38)
s 3 + 72.54s 2 − 1250s − 9.363 × 104
116137(s + b)
=k ,
(s − 35.7377)(s + 36.5040)(s + 71.7721)
with b a positive constant. Again, k is the gain that the method varies from 0 to +∞
to draw the root locus diagram. First, G(s)H (s) is rewritten as:
116137 k l4
G(s)H (s) = [θ4 − (θ1 + θ2 + θ3 )], (5.39)
l1 l2 l3
loop poles) must end (k = +∞) at the open-loop zero s = −b. Hence, there are two
root locus branches tending toward some points at infinity of the s plane. According
to rule 3, the angles of the asymptotes toward which these branches tend are:
±180◦ (2 × 0 + 1) ±180◦ (2 × 0 + 1)
= = ±90◦ .
n−m 3−1
Moreover, according to rule 4, the point where these asymptotes cross the real axis
can be shifted by using the zero at s = −b:
p1 + p2 + p3 − (−b) 35.7377 − 36.5040 − 71.7721 + b
σa = = . (5.42)
n−m 2
Notice that b must be positive, as, if this is not the case, the root locus would be
pushed to the right half-plane producing unstable closed-loop poles. Also notice that
the asymptotes move to the left (increasing stability) as the zero is located closer to
the origin, i.e., as b tends toward zero. This means that the closed-loop poles cannot
be placed arbitrarily to the left.
According to rule 5, the root locus now exists on two segments of the real axis.
The locations of these segments depend on the value of b as shown in Figs. 5.38a
and b. Furthermore, it is shown in Fig. 5.38c that in the case when b = 36.5040
is selected, the open-loop zero at s = −b cancels with the open-loop pole at s =
−36.5040. This means that, in such a case, the root locus only exists in one segment
on the real axis.
It is observed, in Fig. 5.38c, that only two closed-loop poles exist. It is observed,
in Figs. 5.38a and b, that three closed-loop poles exist and one of them is on the right
half-plane (closed-loop instability) if the gain k is too small. On the other hand,
if k is too large, two complex conjugate poles exist with too large an imaginary
part, i.e., producing a fast oscillation. Although in theory this can work because
the three poles have negative real parts, a large k produces a number of practical
problems such as noise amplification and power amplifier saturation, i.e., the control
system may not work correctly in practice. Hence, a good design is that enabling the
designer to locate as desired the closed-loop poles avoiding the use of values that
are too large and values that are too small for the gain k.
Suppose that s = −25 ± j 40 are the desired closed-loop complex conjugate
poles. A procedure that is useful for computing the exact values required for both b
and k is presented in the following. According to Fig. 5.39 the following angles are
computed:
40
θ3 = arctan ,
71.7721 − 25
40
θ2 = arctan ,
36.5040 − 25
40
θ1 = 180 − arctan
0
.
35.7377 + 25
282 5 Time Response-Based Design
Imaginary Axis
10
0
–b
-10
-20
-30
-40
-50
-80 -60 -40 -20 0 20 40
Real Axis
(a)
150 Root Locus
100
50
Imaginary Axis
0
–b
-50
-100
-150
-80 -60 -40 -20 0 20 40
Real Axis
(b)
2 Root Locus
1.5
1
Imaginary Axis
0.5
0
–b
-0.5
-1
-1.5
-2
-80 -60 -40 -20 0 20 40
Real Axis
(a)
5.2 Root Locus-Based Analysis and Design 283
Im(s)
–25 + j40
l3
l2 l1
l4
θ3 θ2 θ4 θ1
Fig. 5.39 Open-loop poles and zeros when trying to locate the desired closed-loop poles at s =
−25 ± j 40
θ4 = −1800 + (θ1 + θ2 + θ3 ),
40
b= + 25 = 31.2463.
tan(θ4 )
On the other hand, according to Fig. 5.39, the following lengths are computed:
l4 = 402 + (b − 25)2 ,
l3 = 402 + (71.7721 − 25)2 ,
l2 = 402 + (36.5040 − 25)2 ,
l1 = 402 + (35.7377 + 25)2 ,
116137(s + 31.2463)
1 + 0.0396 = 0, (5.43)
s3 + 72.54s 2 − 1250s − 9.363 × 104
hence:
2.5
1.5
0.5
−0.5
0 0.05 0.1 0.15 0.2 0.25
Fig. 5.40 Closed-loop response of the system (5.38) from an initial output that is different from
zero. Continuous line: designed response. Dashed line: desired response. Vertical axis: y[m].
Horizontal axis: time in seconds
The roots of this polynomial are the closed-loop poles when b = 31.2463 and
k = 0.0396. Using MATLAB, it is found that these roots are −25.0037 + j 39.9630,
−25.0037 − j 39.9630 and −22.5326. These poles are also shown in Fig. 5.38a
using symbols “+.” Notice that the desired complex conjugate poles have been
successfully assigned and the third pole, which is real, is also located on the left
half-plane, i.e., closed-loop stability has been accomplished. Recall that the factor
k(s + b) represents a PD controller.
It is important to say that this control system is employed to regulate the output
at a zero value. This implies that no matter what the system type, the desired output
(i.e., zero) is reached. Hence, consideration with respect to the steady-state response
is not necessary.
The closed-loop response (continuous line) is shown in Fig. 5.40 when the
desired output is zero, r = 0 (see Fig. 5.1). In this simulation (5.38), b = 31.2463
and k = 0.0396 are employed. The dashed line represents the response of a system
ω2
with the transfer function s 2 +2ζ ωn s+ω2 whose poles are located at s = −25 ± j 40.
n n
Thus, this system represents what is known as a reference model, because its
response possesses the desired transient response specifications. Both responses
start from an initial output equal to 2.85. Notice that some differences exist between
these responses, which are due to the zero at s = −31.2463 and the closed-loop
pole at s = −22.5326, because they are not close enough to completely cancel out
their effects.
Finally, Figs. 5.36, 5.38 and 5.40 have been drawn using the following MATLAB
code in an m-file:
clc
clear
5.2 Root Locus-Based Analysis and Design 285
In this section, the use of the root locus method to select the gains of a PID controller
for an open-loop unstable plant is presented. The open-loop transfer function is:
⎛ ⎞
k ki
11613700 kd s 2 + kpd s +
G(s)H (s) = 3 ⎝ kd ⎠ (5.44)
s + 2739s 2 − 1250s − 3.536 × 106 s
where kd is the parameter that the method varies from 0 to +∞ to draw the root
k
locus, whereas kpd and kkdi must be proposed. Notice that a PID controller is selected
because it renders the system type 1, i.e., to ensure a zero steady-state error when the
desired output is a constant. Notice that the PID controller introduces two open-loop
zeros. There are four open-loop poles placed at:
Using rule 3 it is found that there are n − m = 4 − 2 = 2 branches of the root locus
that tend toward infinity on the plane s following the asymptotes whose angles are
given as:
±180◦
= ±90◦ .
2
Moreover, according to rule 4, the point on the real axis where these asymptotes
intersect is:
35.9 − 2739.4 − 35.9 + σz1 + σz2
σa = ,
2
where −σz1 < 0 and −σz2 < 0 are the real parts of both open-loop zeros introduced
by the PID controller (these values have to be proposed). It is clear that σa moves to
the left (which implies that the closed-loop system becomes more stable) if −σz1 <
0 and −σz2 < 0 are chosen to be close to zero. Notice that this is in agreement with
rule 12. Thus, it is concluded that σa < −1100 is placed far to the left of the origin.
Using these observations, in addition to rules 1, 2, 5, and 6, it is found that the root
locus has the three possibilities depicted in Fig. 5.41.
Instead of assigning some desired closed-loop poles, the control objective is
simply to render the closed-loop system stable. As previously stated, it is preferable
to place both open-loop zeros close to the origin. This means that the possibility
shown in Fig. 5.41a is to be used. On the other hand, two complex conjugate zeros
would force two complex conjugate closed-loop poles to appear, which would result
in a less damped closed-loop system. It is for this reason that the possibility in
Fig. 5.41c is also avoided. Hence, searching for a root locus diagram such as that in
5.2 Root Locus-Based Analysis and Design 287
σa Re(s)
(a)
Im(s)
σa Re(s)
(b)
Im(s)
σa Re(s)
(c)
kp ki 31.24
= 31.24, = , (5.45)
kd kd 0.8
s5 = −29.9355, s6 = −1.3045,
s3 = −35.9, s4 = 0.
288 5 Time Response-Based Design
The facts that σa < −1100 is located far to the left of the origin and that the
asymptotes form ±90◦ angles, ensure that a minimal kd exists for all closed-loop
poles to be placed on the left half-plane. Using (5.45) and Routh’s criterion, it is
found that:
ensures that all of the closed-loop poles are located on the left half-plane and, hence,
the closed-loop system is stable. This is performed as follows. From the condition
1 + G(s)H (s) = 0, i.e., using (5.44) and (5.45), the following characteristic
polynomial is obtained:
s 4 + a3 s 3 + a2 s 2 + a1 s + a0 = 0, (5.47)
a3 = 2739, a2 = 11613700 kd − 1250,
a1 = 11613700 × 31.24 kd − 3.536 × 106 ,
31.28
a0 = 11613700 × kd .
8
To apply Routh’s criterion, the Table 5.1 is filled. Closed-loop stability is ensured if
no sign changes exist in the first column of Table 5.1, i.e., if:
a3 a2 − a1 ea1 − a3 a0
> 0, > 0, a3 > 0, a0 > 0. (5.48)
a3 e
Notice that the third condition in (5.48) is naturally satisfied and from the first
and the last conditions it is found that:
It is not difficult to find that the roots of the second-degree polynomial in (5.50) are
kd = 0.01 and kd = −3.5 × 10−6 . Moreover, it is possible to evaluate numerically
to find that:
Root Locus
10
4
Imaginary Axis
−2
−4
−6
−8
−10
−60 −40 −20 0 20 40
Real Axis
Fig. 5.42 Root locus diagram for G(s)H (s) given in (5.44) under the conditions in (5.45)
0.8
0.6
0.4
Amplitude
0.2
−0.2
−0.4
−0.6
−0.8
0 0.5 1 1.5 2 2.5 3
Time (sec)
Fig. 5.43 Closed-loop time response when G(s)H (s) is given in (5.44) under the conditions
in (5.45) and kd = 0.0226
kd = 0.0226, i.e., the closed-loop system is stable. Notice that the open-loop zeros
are located at s = −29.93 and s = −1.3, which was found using the command
“zero(gh).” This means that all the closed-loop poles are located on the left of
the open-loop zero at s = −1.3. Hence, according to Sect. 8.1.2, this means that
5.2 Root Locus-Based Analysis and Design 291
overshoot is unavoidable despite the fact that all the closed-loop poles are real.
This explains the large overshoot observed in Fig. 5.43, when a zero reference is
commanded and the initial output is 1. Thus, in this example, it is not important to
try to assign the closed-loop poles at some specific locations.
In this section, a controller is designed for the ball and beam system that is built and
experimentally tested in Chap. 14, Sect. 14.9. Assume that a proportional controller
is proposed with gain γ . First, one proceeds to study the possibility that the closed-
loop system might be rendered stable for some positive gain γ . The other system
parameters are positive too, but they cannot be changed. The corresponding block
diagram is shown in Fig. 5.44. The open-loop transfer function is:
X(s) γ Ax kρ
= 4 ,
Xd (s) s + as 3 + γ Ax kρ
Ax = 5.3750, k = 16.6035, a = 3.3132, ρ = 5.
The stability of the closed-loop system is studied using Routh’s criterion. Thus,
Table 5.2 is filled using the closed-loop characteristic polynomial s 4 +as 3 +γ Ax kρ.
Notice that one entry at the first column is zero; hence, the method suggests
replacing it by a small ε > 0. Also notice that under this condition, there are two sign
changes in the first column of Table 5.2 and this cannot be modified by adjusting
γ > 0. Then, it is concluded that no proportional controller exists to render the
closed-loop system stable. Thus, another controller must be proposed.
Xd (s) k ρ X(s)
Ax γ
+ s ( s+ a ) s2
–
Xd (s) k ρ X(s)
Ax s+ δ
γ s+ c s ( s+ a ) s2
+
–
The closed-loop stability is studied using Routh’s criterion. Hence, the Table 5.3
is constructed using the closed-loop characteristic polynomial s 5 + (a + c)s 4 +
acs 3 + γ Ax kρs + γ Ax kρδ. As all the parameters are positive, there are at least
two sign changes in the first column of Table 5.3. Then, it is concluded that there is
no lead compensator rendering the closed-loop system stable; thus, another control
strategy must be proposed. Carefully analyzing Table 5.3, it is concluded that the
problem is originated by the first entry corresponding to row s 2 , i.e., −(a+c)e
ac , which
is negative. Notice that this is a consequence of the fact that the second entry in the
row corresponding to s 4 is equal to zero. This is because s 2 has a zero coefficient in
the polynomial s 5 +(a +c)s 4 +acs 3 +γ Ax kρs +γ Ax kρδ. Thus, it is concluded that
the closed-loop system may be rendered stable if the characteristic polynomial of the
open-loop transfer function has a positive coefficient for s 2 . Next, it is shown that
this is possible if two internal loops are employed, as shown in Fig. 5.46. Notice that
a lead compensator is still considered. In this case, the open-loop transfer function
is given as:
Ax ρ γ s + b αkAθ 1
G(s)H (s) = , (5.51)
Aθ s + c s + (a + kv kAθ )s + αkAθ s 2
2
Xd (s) + + k ρ X(s)
Ax γ s+ b
α
+ s+ c 1 s ( s+ a )
2 s2
– – –
kυ s Aθ
Aθ
Fig. 5.46 Closed-loop system. Use of two internal loops and a lead compensator
Notice that the system type is 2, i.e., the steady state error is zero if the reference
is a step or a ramp. The reader may obtain the closed-loop transfer function XX(s) d (s)
to verify that the corresponding characteristic polynomial has degree 5 and all of
its coefficients are positive (including the coefficient of s 2 ), as expected. According
to the previous discussion, this means that there exists the possibility of finding
positive values for γ , c, b (with c > b), kv and α such that the closed-loop system
is stable. These values are found in the following using the root locus method.
Suppose that the roots of the polynomial s 2 + (a + kv kAθ )s + αkAθ are complex
conjugate, i.e., they can be written:
According to rule 3, there are n − m = 4 root locus branches tending toward infinity
on the plane s along four asymptotes whose angles are given as:
±180◦
= ±45◦ ,
4
±180◦ (3)
= ±3(45◦ ) = ±135◦ .
4
Hence, using these results in addition to rules 1,2 and 5, it is concluded that the
possibilities depicted in Fig. 5.50 exist. According to rule 4, the point where these
asymptotes intersect with the real axis is given as:
−2σ + (b − c)
σa = .
4
294 5 Time Response-Based Design
(a)
Im(s)
x
–σ
x +
x
–c –b Re(s)
x
(b)
Im(s)
x +
x
–c –σ Re(s)
–b
x
(c)
This means that the four branches are pulled to the left; hence, the closed-loop
system becomes more stable, if:
• A greater σ > 0 is chosen, i.e., if the system:
αkAθ
, (5.52)
s 2 + (a + kv kAθ )s + αkAθ
is damped enough, which is accomplished using a large enough value for kv > 0.
• b > 0 Approaches to zero and c > 0 are large, i.e., if c > b. Note that this is in
agreement with rules 11 and 12.
Following the second item above, the root locus shown in Fig. 5.47b is obtained.
Notice that both branches starting at the poles located at s = 0 always remain on
5.2 Root Locus-Based Analysis and Design 295
the right half-plane, i.e., the closed-loop system is unstable. The main reason for
this behavior is that branches starting at the poles of the transfer function in (5.52)
are pulled to the segment on the real axis between s = −c and s = −b. This
is because both open-loop complex conjugate poles are too close to the segment
between s = −c and s = −b. If these complex poles are placed far from such a
segment, then the possibility exists for branches starting at s = 0 to be pulled to
the segment between s = −c and s = −b to obtain the root locus diagram shown
in Fig. 5.47c. This implies closed-loop stability for some of the small values of the
loop gain. To achieve this, it is necessary to use large values for the coefficient αkAθ
(because this increases the distance to the origin of the above-mentioned open-loop
complex conjugate poles), i.e., using a large value for α.
According to the previous discussion, large values must be used for kv and α.
However, these values are limited in practice by the system noise content; hence, kv
and α must be obtained using experimental tests. In fact, noise is also an important
reason not to select real poles for the transfer function in (5.52): real poles produce a
very damped system that requires a large value for kv . According to the experimental
tests reported in Chap. 14 the following values were selected:
α = 12, kv = 0.2.
Hence, the only values that remain to be determined are γ , c and b. Although these
parameters can be determined such that the closed-loop poles are assigned at the
desired locations (using the methodology presented in Sect. 5.2.6), in this case, it
is preferred just to select them such that closed-loop stability is accomplished. To
achieve this, we proceed as follows.
• b and c are proposed such that c > b > 0.
• MATLAB is employed to draw the root locus diagram.
• γ > 0 is chosen as that value placing all the closed-loop system poles on the left
half-plane. This means that γ is the parameter used by the method to plot the root
locus diagram.
• If such a γ > 0 does not exist, then we go back to the first step.
The root locus diagram shown in Fig. 5.48 is obtained following this procedure. It
is observed that all the closed-loop poles, i.e., those indicated with a symbol “+,”
have a negative real part if:
The simulation response of the closed-loop system when the reference is an unitary
step is shown in Fig. 5.49. The graphical results in Figs. 5.48 and 5.49 were obtained
by executing the following MATLAB code in an m-file:
Ax=5.375;
At=0.9167;
k=16.6035;
296 5 Time Response-Based Design
Root Locus
15
10
5
Imaginary Axis
−5
−10
−15
Fig. 5.48 Root locus diagram for the ball and beam system that has been designed
Step Response
1.5
Amplitude
0.5
0
0 1 2 3 4 5 6 7 8
Time (sec)
a=3.3132;
rho=5;
alpha=12;
kv=0.2;
c=20;
b=2.5;
gm=tf(k,[1 a 0]);
velFd=tf(kv*At*[1 0],1);
g1=feedback(gm,velFd,-1);
g2=feedback(alpha*g1,At,-1);
glead=tf([1 b],[1 c]);
5.2 Root Locus-Based Analysis and Design 297
gball=tf(rho,[1 0 0]);
gh=glead*g2*Ax*gball;
figure(1)
rlocus(gh);
axis([-23 2 -17 17])
gamma=rlocfind(gh)
M=feedback(gamma*gh,1,-1);
figure(2)
subplot(2,1,1)
step(M,8)
axis([0 8 0 1.7])
Consider again the control problem in the previous section, but now using the
following system parameters:
Suppose3 that the transient response specifications are stated by requiring a rise time
tr = 1[s] and an overshoot Mp = 25%. The use of this information and:
%
&
& ln2 Mp(%)
& 100
ζ =' ,
ln2 Mp(%)
100 + π2
1 1 − ζ2
ωd = π − arctan ,
tr ζ
ωd
ωn = ,
1 − ζ2
allows us to find that a complex closed-loop pole must be located at:
According to the closed-loop block diagram shown in Fig. 5.46, the open-loop
transfer function in (5.51) becomes:
s+b 1545
G(s)H (s) = γ . (5.55)
s + c s + 4.735s 3 + 321.9s 2
4
Using these numerical values, it is found that the open-loop poles are located at:
Consider Fig. 5.50a. Proceed as in Sect. 5.2.6. The angle and the magnitude
conditions establish that:
θ3 − (θ1 + θ2 + θ4 + θ5 + θ6 ) = −180◦ ,
1545γ l3
= 1.
l1 l2 l4 l5 l6
From these expressions, the following is found:
s6
θ6
l6 s
, l2
, θ2
–c
l5
θ5
s5
(a)
s6
θ6
l6 s
, l2
, θ2
–c
l5
θ5
s5
(b)
Fig. 5.50 Open-loop pole–zero contributions to the root locus diagram for a ball and beam system
ωn2
M(s) = , (5.63)
s 2 + 2ζ ωn s + ωn2
where the values for ωn and ζ ensure that the poles are identical to those defined
in (5.54), i.e., the dashed line represents the desired response. An important
difference between these time responses is observed. In particular, overshoot is
almost twice its desired value. This difference may be explained by the fact that
the closed-loop transfer function of the system in Fig. 5.46 has a zero4 at s = −b.
This feature deviates the time response from its desired behavior represented by the
dashed line, i.e., the second-order system without any zero defined in (5.63).
Thus, to solve this problem it is proposed to use the block diagram in Fig. 5.53.
Notice that the only difference with respect to the block diagram in Fig. 5.46 is
that the lead-compensator γ s+b s+c is now placed in the feedback path. The reason
for this is that the resulting closed-loop transfer function now has no zero.5 Notice
that the root locus diagram in this case is identical to that in Fig. 5.51 as the open-
loop transfer function in this case G(s)H (s) is identical to that in (5.55) because
b = 0.7, c = 2.8658, γ = 1.3531 again. Recall that the zero at s = −b is no longer
closed-loop zero. The closed-loop time response for the block diagram in Fig. 5.53
is presented in Fig. 5.54 with a continuous line, whereas the desired response is
represented by the dashed line. Notice that, again, an significant difference exists
between the achieved response and the desired response. Analyzing the root locus
diagram in Fig. 5.51, it is observed that a closed-loop real pole at ≈ −0.95 is very
close to the poles at −0.8765 ± j 1.9864, which determine the transient response.
Hence, the effects of this real pole are not negligible, and they are important in the
transient response: the closed-loop system behaves as a third-order system instead of
a second-order system. This fact explains the lag observed in the response achieved
in Fig. 5.54.
Root Locus
20
15
Imaginary Axis (seconds−1)
10
−5
−10
−15
−20
−3 −2.5 −2 −1.5 −1 −0.5 0 0.5
Real Axis (seconds−1)
Fig. 5.51 Root locus diagram for the ball and beam system when using the block diagram in
Fig. 5.46 and the controller gains b = 0.7, c = 2.8658, γ = 1.3531
Step Response
1.5
1
Amplitude
0.5
0
0 1 2 3 4 5 6 7
Time (seconds)
Fig. 5.52 Closed-loop time response of the ball and beam system when using the block diagram
in Fig. 5.46 and the controller gains b = 0.7, c = 2.8658, γ = 1.3531 (continuous). Dashed:
desired response
Hence, a remedy for this problem is to place this real pole further to the left. This
may be accomplished by placing the zero at s = −b further to the left as depicted
302 5 Time Response-Based Design
b
Fig. 5.53 Use of the lead compensator in the feedback path. The factor γ c on the left is included
to ensure that limt→∞ x(t) = xd
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7
Time (seconds)
Fig. 5.54 Closed-loop time response of the ball and beam system when using the block diagram
in Fig. 5.53 and the controller gains b = 0.7, c = 2.8658, γ = 1.3531 (continuous). Dashed:
desired response
Thus, the design procedure proposed above is still valid, only requiring use of (5.64)
instead of (5.58). Hence, proposing b = 1.4, the following is found: c = 5.1138 and
γ = 2.1868. The root locus diagram for this case is shown in Fig. 5.55 where the
closed-loop poles are marked with the symbol “+.” It can be seen that the real pole
is now placed at about −3.5, far enough from the poles in (5.54). Moreover, the time
response achieved in this case (continuous) is shown in Fig. 5.56 and compared with
5.2 Root Locus-Based Analysis and Design 303
Root Locus
20
15
Imaginary Axis (seconds−1)
10
−5
−10
−15
−20
−4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 0.5
Real Axis (seconds−1)
Fig. 5.55 Root locus for the ball and beam system according to the block diagram in Fig. 5.53 and
controller gains b = 1.4, c = 5.1138, γ = 2.1868
the desired response (dashed). We realize that both responses are very similar in
this case, which corroborates the correctness of the design. This controller is tested
experimentally in Chap. 14.
Finally, to further improve the transient response, in Figs. 5.57 and 5.58, the
root locus diagram and the time response respectively are shown when using the
controller gains b = 2, c = 11.7121 and γ = 4.6336. Note that the real pole is now
placed at about −10.5, i.e., it is far from the poles in (5.54). This results in a very
small effect of this pole on the transient response, which, as shown in Fig. 5.58, is
now very close to the desired response.
Except for Figs. 5.50 and 5.53, all the figures in this section have been drawn
using the following MATLAB code in an m-file:
clc
clear
rho=4.8;
a=0.98;
k=10.729;
kv=0.35;
alpha=30;
Ao=1;
Ax=1;
Gdcm=tf(k,[1 a 0]);
Gfvel=tf(kv*Ao*[1 0],1);
Gfdbk1=feedback(Gdcm,Gfvel,-1);
304 5 Time Response-Based Design
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8
Time (seconds)
Fig. 5.56 Closed-loop time response of the ball and beam system according to the block diagram
in Fig. 5.53 and controller gains b = 1.4, c = 5.1138, γ = 2.1868 (continuous). Dashed: desired
response
Root Locus
20
15
Imaginary Axis (seconds−1)
10
−5
−10
−15
−20
−12 −10 −8 −6 −4 −2 0
−1
Real Axis (seconds )
Fig. 5.57 Root locus diagram for the ball and beam system when using the block diagram in
Fig. 5.53 and the controller gains b = 2, c = 11.7121 and γ = 4.6336
G2=alpha*Gfdbk1;
Gfdbk2=feedback(G2,Ao,-1);
5.2 Root Locus-Based Analysis and Design 305
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8
Time (seconds)
Fig. 5.58 Closed-loop time response of the ball and beam system when using the block diagram
in Fig. 5.53 and the controller gains b = 2, c = 11.7121 and γ = 4.6336 (continuous). Dashed:
desired response
Gball=tf(rho,[1 0 0]);
GH=Ax*Gfdbk2*Gball
pole(GH)
figure(1)
rlocus(GH)
axis([-5 2 -30 30])
tr=1; %s
Mp=25;%
z=sqrt(log(Mp/100)^2/(pi^2+log(Mp/100)^2));
wn=1/(tr*sqrt(1-z^2))*(pi-atan(sqrt(1-z^2)/z));
wd=wn*sqrt(1-z^2);
Res=-z*wn % -0.8765
Ims=wd % j 1.9864
th1=pi-atan(Ims/(-Res));
th5=atan((Ims+17.7838)/(2.3676+Res));
th6=-atan((17.7838-Ims)/(2.7636+Res));
th3menosth4=-pi+(2*th1+th5+th6);
b=2
%b=1.4
%b=0.7
%th3=pi-atan(Ims/(-Res-b));
th3=atan(Ims/(b+Res));
306 5 Time Response-Based Design
th4=-th3menosth4+th3;
c=Ims/tan(th4)-Res
l1=sqrt(Ims^2+Res^2);
l3=sqrt(Ims^2+(-Res-b)^2);
l4=sqrt(Ims^2+(c+Res)^2);
l5=sqrt((17.7838-Ims)^2+(2.3676+Res)^2);
l6=sqrt((17.7838+Ims)^2+(2.3676+Res)^2);
gamma=l1^2*l4*l5*l6/(l3*rho*alpha*k*Ax)
ctrl=tf(gamma*[1 b],[1 c]);
GHcomp=GH*ctrl;
gg=0:0.01:1;
figure(2)
rlocus(GHcomp) %,gg)
axis([-12.5 0.5 -20 20])
rlocfind(GHcomp)
M=feedback(GH,ctrl,-1);
M1=tf(wn^2,[1 2*z*wn wn^2])
figure(3)
step(M*0.7913,’b-’,M1,’r--’)
%step(M*0.5987,’b-’,M1,’r--’)
%step(M*0.3305,’b-’,M1,’r--’)
grid on
The PID control for position regulation in a DC motor is studied in Sect. 5.2.5.
There, it was found that the motor position relates to the desired position and an
external torque disturbance through two transfer functions, which, however, have
the same characteristic polynomial:
s 3 + (a + kd k)s 2 + kp ks + ki k. (5.65)
It was also found that the following closed-loop poles p1 , p2 , p3 can be assigned:
Notice that σ1 = σ2 if ω1 > 0, i.e., when a pair of complex conjugate poles exists,
but σ1 = σ2 is possible when ω1 = 0. Then, controller gains must be selected
according to:
−(σ1 + σ2 + p3 ) − a
kd = > 0, (5.66)
k
5.3 Case Study 307
σ1 σ2 + ω12 + p3 σ1 + σ2 p3
kp = > 0, (5.67)
k
−p3 (σ1 σ2 + ω12 )
ki = > 0. (5.68)
k
On the other hand, in Example 4.12, Chap. 4, it was found that all of the roots of
the following polynomial:
s 3 + as 2 + bs + c,
ki k
a + kd k > 0, kp k > , ki k > 0. (5.69)
a + kd k
Using the expressions in (5.66), (5.67), (5.68), (5.69), Fig. 5.59, the results in
Sect. 3.3, and Example 3.9, the effects of the PID controller gains on the closed-
loop system response can be studied.
• kp > 0 and kd > 0 are small, whereas ki > 0 is large.
– Suppose that p1 and p2 are complex conjugate. Then, ωn2 = σ1 σ2 + ω12 in
Fig. 5.59. According to (5.68), the product −p3 ωn2 is large, which implies a
faster response because a real pole produces faster responses as p3 moves to
the left and a second-order system is faster as ωn is larger. Note that ki can
be kept constant and, according to (5.67), kp > 0 can be rendered small if
both σ1 and σ2 approach zero, i.e., if θ > 0 in Fig. 5.59 approaches zero and,
hence, damping approaches zero (without affecting ωn nor −p3 ). According
to (5.66), this also renders kd > 0 small. Also notice that this is in agreement
ki k
with the second inequality in (5.69), i.e., kp k > a+k dk
. If ki > 0 is large and
kp > 0, kd > 0 are small, then this condition tends not to be valid, i.e., the
closed-loop system approaches instability and becomes more oscillatory.
– Suppose that p1 and p2 are real and different, i.e., ω1 = 0. Thus, a more
damped and, hence, slower response is obtained. According to (5.68), this
results in a smaller ki > 0. However, according to (5.66), (5.67), kp > 0,
and kd > 0 can be rendered larger because |σ1 | may become larger despite σ2
approaching zero. Thus, from the second inequality in (5.69), it is concluded
too that a more damped response is obtained.
Notice that an increment in kd > 0 has a greater effect on the increment of
|σ1 | than the effect that an increment in kp > 0 has on the increment of |σ1 |
because this real part is affected by p3 in (5.67), which is assumed to be large.
308 5 Time Response-Based Design
p3 ωn
Re (s)
θ
p2
Thus, it is concluded that kd has a greater effect on the damping than kp , i.e.,
the slower response predicted above is more affected by kd .
• ki > 0 is small and kp > 0 is large.
This may be possible if p3 is close to zero and p1 and p2 , are complex conjugate.
Thus, according to (5.67) and (5.66), kp > 0 can be large and kd > 0 small if
ωn2 = σ1 σ2 + ω12 is large and σ1 and σ2 , are close to zero. This means that
the damping is small because θ > 0 in Fig. 5.59 is close to zero. Thus, a more
oscillatory but faster closed-loop system response is obtained.
However, |σ1 | and |σ2 | may be rendered larger, i.e., to increase kd > 0, without
affecting ωn if θ > 0 in Fig. 5.59 is increased. Thus, a more damped but slower
system response is obtained. Notice that kp > 0 is less affected by the changes
in |σ1 | and |σ2 | because they are affected by p3 in (5.67), which is assumed to be
close to zero.
According to the discussion above the following is concluded regarding the
effects that the PID control gains have when used for position regulation in a DC
motor:
• Larger positive values for the integral gain, ki , result in a faster response that
becomes more oscillatory.
• Large positive values of the proportional gain, kp , result in either a) a slightly
more damped response if ki > 0 is large, or b) a more oscillatory response if
ki > 0 is small. In both cases, a fast response is expected.
• Larger positive values of the derivative gain, kd , produce a more damped and
slower response.
It is convenient to say that the transfer function between the position and its
desired value (G1 (s) in (5.26)) has two zeros whose effect on the transient response
is not completely clear. Hence, it is possible that sometimes, some variations appear
5.3 Case Study 309
regarding the effects that have just been described for the gains of the PID controller.
Furthermore, the fact that the external disturbance is present because the desired
position is commanded in some mechanisms may favor these variations.
To illustrate the ideas above, some experimental results that were obtained
when controlling the position of a DC motor are presented in the following. The
experimental prototype is the same as that described in Chap. 11 with a simple
modification (that is not present in that chapter): the pendulum shown in Fig. 5.60
is fixed to the motor shaft. Hence, by means of the gravity effect g, a torque
disturbance is introduced that tries to deviate the motor position from its desired
value. In Fig. 5.60, T (t) represents the torque generated by the motor and θ is the
controlled variable. The pendulum parameters l and m are not measured to show
that a PID controller can be tuned without any necessity of knowing the plant, if the
effects of the controller gains (listed above) are well understood.
The corresponding experimental results are presented in Figs. 5.61 and 5.62. The
desired position is set to θd = π/2[rad] as this is where the torque disturbance due
to gravity has its greatest effect. A vertical line at t = 0.13[s] and a horizontal line
at θ = 1.8[rad] are also shown to indicate the desired rise time and overshoot. Only
one parameter is adjusted each time to clearly appreciate its effect. Curves drawn in
Fig. 5.61 correspond to the following PID controller gains:
1. Upper figure:
• Continuous: kp = 0.5, ki = 0, kd = 0
• Dash–dot: kp = 1, ki = 0, kd = 0
• Dotted: kp = 1, ki = 0, kd = 0.05
2. Bottom figure:
• Continuous: kp = 1, ki = 2, kd = 0.05
• Dash–dot: kp = 1, ki = 5, kd = 0.05
• Dotted: kp = 2, ki = 5, kd = 0.05
• Dashed: kp = 2, ki = 5, kd = 0.1
As the closed-loop system is third-order when a PID controller is used and the motor
parameters are not known, it is difficult to know the controller gains that ensure
310 5 Time Response-Based Design
θ
[rad]
t[s]
θ
[rad]
t[s]
Fig. 5.61 The PID control of position for a DC motor with a pendulum as a load. Experimental
results
stability. Thus, the best that can be done is to begin with a PD controller (assigning
ki = 0), which produces a second-order closed-loop system that is stable for any
positive kp with kd = 0 (because any real mechanism possesses friction). Later,
according to the transient response obtained and to the tuning rules listed above,
the gains ki and kd are introduced such that stable responses are accomplished. It
is for this reason that, in the upper part of Fig. 5.61 a PD controller is employed.
Note that a steady-state error that is different from zero is obtained because of the
torque disturbance introduced by gravity (recall that ki = 0). The aim in this part
of the experiment is to allow the system response time to approach its desired value
ensuring stable behavior. Thus, the proportional gain is first increased to kp = 1
and then the derivative gain is increased to kd = 0.05. Then, an integral term can
be introduced, which, although producing a zero steady-state error, increases the
oscillations in the system response. This is shown at the bottom part of Fig. 5.61.
Again, the idea is to allow the response time to approach its desired value. This is
accomplished first by increasing the integral gain to ki = 5. As this also increases
the oscillation, kp = 2 is employed to render the system response faster without
appreciably increasing the oscillation. Finally, kd = 0.1 is used to produce a well
damped response. Notice that the increment on kd increases the rise time a little.
5.3 Case Study 311
θ
[rad]
t[s]
θ
[rad]
t[s]
Fig. 5.62 The PID control of position for a DC motor with a pendulum as a load. Experimental
results
Curves drawn in Fig. 5.62 correspond to the following PID controller gains:
1. Upper figure:
• Continuous: kp = 2, ki = 5, kd = 0.1
• Dash–dot: kp = 2, ki = 5, kd = 0.2
• Dotted: kp = 2, ki = 8, kd = 0.2
2. Bottom figure:
• Continuous: kp = 2, ki = 8, kd = 0.2
• Dash–dot: kp = 2.5, ki = 8, kd = 0.2
• Dotted: kp = 3, ki = 8, kd = 0.2
• Dashed: kp = 3.5, ki = 8, kd = 0.2
In the upper part of Fig. 5.62, it is observed that the response is even more damped
and slower when the derivative gain is increased from kd = 0.1 to kd = 0.2.
Because, at this moment, the response is slow and overshoot is small, ki = 8 is
employed to render the response faster and with a larger overshoot that is equal to
the desired overshoot. To render the system faster, without appreciably affecting
overshoot, the proportional gain is increased to kp = 3.5 in the lower part of
Fig. 5.62. This allows the desired rise time and overshoot to be accomplished.
312 5 Time Response-Based Design
5.4 Summary
The most general method of controller design using the time response approach
is the root locus method. This means that the plants that can be controlled are of
arbitrary order with any number of zeros as long as they are less than the number
of poles. This method provides the necessary tools to determine, in a graphical way,
the location of the closed-loop poles from the location of the open-loop poles and
zeros. Some of the open-loop poles and zeros are due to the controller and the idea
of the method is to select the location of the controller poles and zeros such that the
desired closed-loop poles are assigned. The desired closed-loop poles are chosen
from the knowledge of how they affect the corresponding transient response. The
study presented in Chap. 3 is important for this. On the other hand, the controller
structure is chosen from the knowledge of how the open-loop poles and zeros affect
the closed-loop system steady- state response. The study presented in Chap. 4 is
very important for this.
Although the root locus has been presented as a controller design method, it is
also a powerful tool for control systems analysis. This means that it can be used to
determine: (i) The relative stability of a control system, (ii) How the control system
response changes as one of its parameters changes, (iii) What has to be done to
modify the control system properties, etc. The use of the root locus method in these
applications depends, to a large extent, on a good understanding of the method and
the material presented in Chaps. 3 and 4.
5.6 Exercises 313
5.6 Exercises
θd (s) + k θ(s)
k
kp + si γ s+d
s+c s(s+a)
–
Use kp as the parameter the method varies from 0 to +∞ to draw the root locus
diagram. Select kp = 1 and observe what happens with the closed-loop poles
corresponding to s = −4.8935 ± j 6.6766. Perform simulations for each case
when the reference is a unit step. Compare the obtained response as ki grows
with the response obtained when kp = 1 and ki = 0. Draw the corresponding
root loci using the method presented in this chapter and explain what happens.
2. Consider the following plant:
k
Y (s) = H1 (s)U (s), H1 (s) = , k = 35.2671, a = 3.5201.
s(s + a)
a) Employ (3.71) in Chap. 3 to find the values for kp and kv such that the
following transient response specifications are satisfied:
when yd is a unit step and the following controller is used: u(t) = kp (yd −
y) − kv ẏ.
b) Assume that the input is given as:
d(yd − y)
u(t) = kp (yd − y) + kd , PD control.
dt
Obtain the closed-loop transfer function and use (3.71) in Chap. 3 to deter-
mine kp and kd such that the closed-loop poles are located at some points
determining the following closed-loop transient response specifications:
Perform simulations corresponding to each one of the above items and compare
the obtained responses. What is the reason for the differences between these
responses? May zeros of a transfer function affect the transient response? Can
these differences be explained using the root locus?
3. Consider a closed-loop system such as that shown in Fig. 5.1 with H (s) = 1
and G(s) = s 3 +s 21+s+1 .
5.6 Exercises 315
• Using the rules presented in Sect. 5.1.1, draw the root locus diagram when
using a proportional controller. Use Routh’s criterion to determine the values
of the proportional gain ensuring closed-loop stability.
• To stabilize the closed-loop system and to achieve a zero steady-state error
when the reference is a step, design a PID controller proceeding as follows.
(i) Propose kd s 2 + kp s + ki = kd (s − z1 )(s − z2 ), with z1 = −0.5 + 1.3j ,
z2 = −0.5 − 1.3j . Using the rules presented in Sect. 5.1.1, draw the root
locus diagram to verify that no positive value exists for the derivative gain
rendering the closed-loop system stable. (ii) Propose kd s 2 + kp s + ki =
kd (s − z1 )(s − z2 ), with z1 = −0.25 + 1.3j , z2 = −0.25 − 1.3j . Using
the rules presented in Sect. 5.1.1, draw the root locus diagram to verify that
a range of positive values exists for the derivative gain kd , rendering the
closed-loop system stable. Use Routh’s criterion to find the range of values
for kd , rendering the closed-loop system stable.
• How should the zeros of a PID controller be selected to improve the stability
of the closed-loop system?
4. Verify that the transfer function of the circuit shown in Fig. 5.64 is:
Vo (s) s+a 1 1 1
= , a= , b= + .
Vi (s) s+b R1 C R1 C R2 C
As b > a, this electric network can be used as a lead compensator.
5. Consider the following plant:
4(s + 0.2)
G(s) = .
(s + 0.5)(s 2 − 0.2s + 0.3)
Use the root locus method to design a controller, ensuring closed-loop stability
and a zero steady-state error when the reference is a step. It is suggested that the
location of the poles and the zeros of the controller are proposed and then the
open-loop gain is selected such that all the closed-loop poles have a negative
real part.
+
+ R1
vi vo
–
R2 –
316 5 Time Response-Based Design
6. Consider the PD control of the position in Fig. 5.2.2. Prove that the value of the
derivative gain kd does not have any effect on the steady-state error when the
reference is a step.
7. Consider the PID control of the position studied in Sect. 5.2.5. Prove that the
values of the proportional kp and the derivative kd gains do not have any effect
on the steady-state error, despite a constant disturbance being present if the
reference is also constant.
Assume that the integral part of the controller is not present, i.e., that ki = 0.
Prove that the value of the derivative gain kd does not have any effect on the
steady-state error.
8. Consider the mass-spring-damper system shown in Fig. 5.65, which has been
modeled in Example 2.1, Chap. 2. In Example 3.18, Chap. 3, it is explained
why a steady-state error that is different from zero exists when a proportional
controller is employed and the desired position xd is a constant that is different
from zero. Recall that the force F (t) applied to the mass is the control signal.
Now suppose that a PID controller is used to regulate the position. Find the
steady-state error when the desired position xd is a constant that is different
from zero. Use your everyday experience to explain your response, i.e., try to
explain what happens with the force applied to the mass and the effect of the
spring.
9. Consider the simple pendulum studied in Example 2.6, Chap. 2, which is shown
in Fig. 5.66. Notice that the gravity exerts a torque that is different from zero
on the pendulum if the angular position θ is different from zero. Suppose that
it is desired to take the pendulum position θ to the constant value θd = 90◦ .
Note that torque T (t) is the input for the pendulum. Using the experience in
the previous exercise, state which controller you would employ to compute
T (t) such that θ reaches θd . Explain why. This problem is contrived to be
solved without using a mathematical model; you merely need to understand
the problem. In fact, the mathematical model is in this case nonlinear; hence, it
cannot be analyzed using the control techniques studied in this book so far.
10. Consider an arbitrary plant G(s) in cascade with the following controllers:
s+a
Gc (s) = , 0 < a < b,
s+b
s+c
Gd (s) = , c > d > 0.
s+d
• What is the effect of each one of these compensators on the steady-state error
when the reference is a step?
• What is the effect of each one of these compensators on the closed-loop
stability?
• Which compensator is related to PI control and which to PD control? Explain
why.
• How would you employ these compensators to construct a controller with
similar properties to those of PID control? Explain.
11. In a ship, it is common to have a unique compass to indicate the course.
However, it is important to know this information at several places in the ship.
Hence, it is common to transmit this information to exhibit it using a needle
instrument. The angular position of the needle is actuated using a DC motor by
using the information provided by the compass as the desired position. Design
a closed-loop control system such that the needle position tracks the orientation
provided by the compass according to the following specifications:
• When a step change of 8◦ appears in the orientation provided by the
compass, the system error decreases and remains at less than 1◦ in 0.3 s
or less and overshoot is less than or equal to 25%.
• When the orientation provided by the compass changes as a ramp of 5◦ per
second, the steady-state error must be 0.3◦ or less.
• There are no external disturbances.
Under which ship operating conditions may these situations appear? The
transfer function between the voltage applied to the motor and the needle
position in degrees is:
45.84 × 10−5
G(s) = .
s(4.4 × 10−9 s 2 + 308.5 × 10−9 s + 3.3 × 10−6 )
Hint.
(i) On the basis of the specifications indicated, choose a controller to design.
(ii) Using the first specification, determine the zone in the time domain where
318 5 Time Response-Based Design
the closed-loop system response must lay. (iii) Recall that, according to
Fig. 3.16, Chap. 3, the response of a second-order system remains between two
exponential functions depending on ζ and ωn . With this information and using
the desired damping, determine the zone on the complex plane s where the
dominant (complex conjugate) poles of the closed-loop system must be located.
(iv) Use the root locus rules presented in this chapter to find the controller
gains, ensuring that all the closed-loop poles are inside the desired zone in the
plane s. (v) Verify that the second specification is satisfied and, if this is not the
case, redesign the controller. (vi) Perform some simulations to corroborate that
all the requirements are satisfied.
References
1. G. W. Evans, The story of Walter R. Evans and his textbook Control-Systems Dynamics, IEEE
Control Systems Magazine, pp. 74–81, December 2004.
2. R. Kelly, V. Santibáñez, and A. Loría, Control of robot manipulators in joint space, Springer,
London, 2005.
3. R. Kelly and V. Santibáñez, Motion control of robot manipulators (in Spanish), Pearson
Prentice Hall, Madrid, 2003.
4. R. Kelly, PD control with desired gravity compensation of robotic manipulators: a review, The
International Journal of Robotics Research, vo. 16, No. 5, pp. 660–672, 1997.
5. K. Ogata, Modern control engineering, 4th edition, Prentice-Hall, Upper Saddle River, 2002.
6. N. S. Nise, Control systems engineering, 5th edition, John Wiley and Sons, New Jersey, 2008.
7. R. C. Dorf and R. H. Bishop, Modern control systems, 10th edition, Pearson Prentice-Hall,
2005.
8. B. C. Kuo, Automatic control systems, Prentice-Hall, 1995.
9. G. H. Hostetter, C. J. Savant, and R. T. Stefani, Design of feedback control systems, Holt,
Rinehart and Winston, 1982.
10. W. Ali and J. H. Burghart, Effects of lag controllers on the transient response, IEE Proceedings-
D, Control theory and applications, vol. 138, no. 2, pp. 119–122, March 1991.
Chapter 6
Frequency Response-Based Design
classical control. However, as each of these methods analyzes the same problem
from different points of view; each one of them provides information that can be
complementary to information provided by the other method. Thus, it is important
to understand both methods.
In this section, we present some experimental results obtained when using some
simple alternating current (AC) circuits. All of these circuits can be represented by
the general circuit in Fig. 6.1a. We are interested in observing the output voltage
v0 (t) at the circuit element designated as z2 when the voltage source delivers a
signal given as:
When using a scope to measure vi (t) and v0 (t), we observe a situation such as that
depicted in Fig. 6.1b, i.e., the output voltage is given as:
z2
(a)
A
B
tφ υ0 (t) t
υi (t)
T
(b)
6.1 Frequency Response of Some Electric Circuits 321
This means that both vi (t) and v0 (t) are sinusoidal functions of time, having
the same frequency. It is important to stress that, under the conditions shown in
Fig. 6.1b, φ is defined as negative, i.e., the output voltage, v0 (t), lags with respect to
the input voltage, vi (t). Experiments to be performed consist of measuring the input
and the output amplitudes, A and B, in addition to the time tφ , to compute φ, for
several frequencies ω. Then, the quantities B/A and φ are plotted as functions of the
frequency ω. These plots are intended to explain the meaning of the term frequency
response.
We first consider the AC circuit shown in Fig. 6.2a when R = 1000[Ohm] and
C = 0.1 × 10−6 [F]. Employing different values of frequency, ω, we obtain the
measurements shown in Table 6.1, which are plotted in Fig. 6.3 (continuous line).
The first of these plots represents B/A as a function of the frequency, whereas the
second plot represents φ as a function of the frequency ω. The quantity B/A is
called magnitude and φ is called phase.
From Fig. 6.3, we conclude that this circuit behaves as a low-pass filter and phase
lag is produced. This means that the low-frequency signals (when ω is close to zero)
are not attenuated or they are attenuated only a little, i.e., B/A ≈ 1, whereas the
high-frequency signals (when ω is large) are strongly attenuated, i.e., B/A ≈ 0.
Using the tension divider in the circuit shown in Fig. 6.2a, the following is found:
1
V0 (s) = sC
Vi (s),
R+ 1
sC
and rearranging:
V0 (s) a 1
= G(s) = , a= . (6.2)
Vi (s) s+a RC
a a a − jω a(a − j ω)
G(j ω) = = = ,
jω + a jω + a a − jω ω2 + a 2
√
a a 2 + ω2 a
|G(j ω)| = =√ , (6.3)
ω +a
2 2
ω + a2
2
322 6 Frequency Response-Based Design
(a)
(b)
(c)
(d)
6.1 Frequency Response of Some Electric Circuits 323
Table 6.1 Experimental data f [Hz] ω = 2πf [×105 rad/s] A [V] B [V] φ [◦ ]
for the resistor–capacitor
(RC) circuit in Fig. 6.2a 50 0.0031 4 4 0
60 0.0038 4 4 −2.3
70 0.0044 4 4 −2.5
80 0.0050 4 4 −2.8
90 0.0057 4 4 −3.8
100 0.0063 4 4 −4.3
200 0.0126 4 4 −8.5
300 0.0188 4 4 −12.9
400 0.0251 4 3.8 −15.8
500 0.0314 4 3.8 −19.8
600 0.0377 4 3.7 −23.7
700 0.0440 4 3.6 −27.7
800 0.0503 4 3.5 −31.6
900 0.0565 3.9 3.3 −35.6
1000 0.0628 3.9 3.2 −39.6
2000 0.1257 3.9 2.3 −57.6
3000 0.1885 3.9 1.7 −64.8
4000 0.2513 3.8 1.4 −74.8
5000 0.3142 3.8 1.1 −79.2
6000 0.3770 3.8 0.9 −73.4
7000 0.4398 3.8 0.8 −80.7
8000 0.5027 3.8 0.7 −74.7
9000 0.5655 3.8 0.6 −81
10000 0.6283 3.8 0.6 −79.8
20000 1.2566 3.8 0.3 −83.5
30000 1.8850 3.8 0.2 −82
40000 2.5133 3.9 0.1 −86
50000 3.1416 3.9 0.1 −87
Im(G(j ω)) −ω
G(j ω) = arctan = arctan . (6.4)
Re(G(j ω)) a
B
A
1
√
2
× 105
1
RC
φ
[°]
– 45
× 105
1
RC ω [rad/s]
Fig. 6.3 Experimental (continuous line) and theoretical (dashed line) data for the circuit in
Fig. 6.2a (see Table 6.1)
Hence, it is not a surprise that |G(j ω)| is given as the ratio of the output and the
input amplitudes. On the other hand, if it assumed that G(j ω), V0 (j ω), Vi (j ω) are
complex numbers, then the angle of V0 (j ω) must be given as the addition of the
angles of G(j ω) and Vi (j ω) because V0 (j ω) = G(j ω)Vi (j ω). This means that the
angle difference between Vi (j ω) and V0 (j ω) is equal to the angle of G(j ω).
In Fig. 6.3, the plot obtained (dashed line) using |G(j ω)| and φ defined in (6.3)
and (6.4) is shown. The closeness observed in this figure between the continuous line
and the dashed line is evidence that the analytical relationships obtained correctly
represent the experimental situation. Finally, from (6.5), (6.6), we realize that:
B 1
= √ = 0.7071,
A 2
φ = −45◦ ,
when ω = a = RC 1
, which is known as the corner frequency. Note that the phase of
G(j ω) takes values in the range [−90◦ , 0◦ ]. This means that the corner frequency
occurs when the phase is in the middle of its variation range and the output
amplitude is equal to the root–mean–square (RMS) value of the input amplitude.
6.1 Frequency Response of Some Electric Circuits 325
Consider the AC circuit shown in Fig. 6.2b when R = 1000[Ohm] and C = 0.1 ×
10−6 [F]. Employing different frequency values, ω, we obtain the measurements
shown in Table 6.2, which are plotted in Fig. 6.4 (continuous line). From Fig. 6.4, we
conclude that this circuit behaves as a high-pass filter and a phase lead is produced.
This means that the low-frequency signals (when ω is close to zero) are strongly
attenuated, i.e., B/A ≈ 0, whereas the high-frequency signals (when ω is large) are
not attenuated or they are attenuated just a little, i.e., B/A ≈ 1.
Table 6.2 Experimental data f [Hz] ω = 2πf [×105 rad/s] A [V] B [V] φ [◦ ]
for the RC circuit in Fig. 6.2b
50 0.0031 5.1 0.2 102.6
60 0.0038 5.1 0.24 97.2
70 0.0044 5.1 0.28 95.76
80 0.0050 5.1 0.32 97.92
90 0.0057 5.1 0.36 100.44
100 0.0063 5.1 0.4 90
200 0.0126 5.1 0.68 90.72
300 0.0188 5.1 1.0 84.24
400 0.0251 5.1 1.28 80.64
500 0.0314 5.1 1.56 79.2
600 0.0377 5.05 1.8 69.12
700 0.0440 5.1 2.4 70.56
800 0.0503 5.05 2.28 63.36
900 0.0565 5 2.7 58.32
1000 0.0628 5 2.77 60.48
2000 0.1257 4.96 3.88 41.76
3000 0.1885 4.96 4.32 30.24
4000 0.2513 4.6 3.92 24.76
5000 0.3142 4.88 4.44 18.72
6000 0.3770 4.92 4.72 16.41
7000 0.4398 4.92 4.76 13.1
8000 0.5027 4.92 4.76 12.67
9000 0.5655 4.84 4.56 11.01
10000 0.6283 4.92 4.72 9.36
20000 1.2566 4.92 4.84 0
30000 1.8850 4.92 4.92 0
40000 2.5133 4.92 4.92 0
50000 3.1416 5.2 5.2 0
326 6 Frequency Response-Based Design
B
A
1
√
2
× 105
1
RC
φ
[°]
45
× 105
1
RC ω [rad/s]
Fig. 6.4 Experimental (continuous) and theoretical (dashed) data for the circuit in Fig. 6.2b (see
Table 6.2)
Using the tension divider in the circuit shown in Fig. 6.2b the following is found:
R
V0 (s) = Vi (s),
R+ 1
sC
and rearranging:
V0 (s) s 1
= G(s) = , a= .
Vi (s) s+a RC
jω jω a − jω j ω(a − j ω)
G(j ω) = = = ,
jω + a jω + a a − jω ω2 + a 2
√
ω ω2 + a 2 ω
|G(j ω)| = =√ ,
ω +a
2 2
ω + a2
2
G(j ω) = 90◦ + arctan
−ω
.
a
6.1 Frequency Response of Some Electric Circuits 327
In Fig. 6.4, the plot obtained (dashed line) using the expressions for |G(j ω)| =
B
A and φ that have just been defined is shown. The closeness observed between
the continuous line and the dashed line is evidence that the analytical relationships
obtained correctly represent the experimental situation. Finally, note that:
B 1
= √ = 0.7071,
A 2
φ = +45◦ ,
when ω = a = RC 1
, which is known, again, as the corner frequency. Also note
that the phase of G(j ω) takes values in the range [0◦ , +90◦ ]. This means that the
corner frequency occurs when the phase is at the middle of its variation range and
the output amplitude is equal to the RMS value of the input amplitude.
Using the tension divider in the circuit shown in Fig. 6.2c yields:
1
V0 (s) = sC
Vi (s),
R + sL + 1
sC
and rearranging:
328 6 Frequency Response-Based Design
Table 6.3 Experimental data f [Hz] ω = 2πf [×105 rad/s] A [V] B [V] φ [◦ ]
for the
resistor–inductor–capacitor 100 0.0063 0.4 0.4 0
(RLC) circuit in Fig. 6.2c 500 0.0314 0.38 0.39 0
800 0.0503 0.36 0.38 0
900 0.0565 0.35 0.38 0
1000 0.0628 0.34 0.38 0
2000 0.1257 0.3 0.38 −5.4
3000 0.1885 0.29 0.5 −18.9
4000 0.2513 0.28 0.85 −54
4293 0.2697 0.28 0.925 −77.27
5000 0.3142 0.28 0.625 −126
6000 0.3770 0.28 0.31 −151.2
7000 0.4398 0.28 0.22 −157.5
8000 0.5027 0.28 0.16 −165.6
10000 0.6283 0.28 0.08 −171
20000 1.2566 0.27 0.02 −171
40000 2.5133 0.27 0.004 −187.2
B
A
× 105
ωr
φ
[°]
– 90
× 105
ωr
ω [rad/s]
Fig. 6.5 Experimental (continuous) and theoretical (dashed) data for the circuit in Fig. 6.2c (see
Table 6.3)
V0 (s) ωn2 1 R
= G(s) = 2 , ωn2 = , 2ζ ωn = .
Vi (s) s + 2ζ ωn s + ωn2 LC L
6.1 Frequency Response of Some Electric Circuits 329
ωn2
G(j ω) = ,
(j ω)2 + j 2ζ ωn ω + ωn2
2
ωn2 ωn − ω2 − j 2ζ ωn ω
= 2 ,
ωn − ω2 + j 2ζ ωn ω ωn2 − ω2 − j 2ζ ωn ω
ωn2 (ωn2 − ω2 − j 2ζ ωn ω)
= ,
(ωn2 − ω2 )2 + 4(ζ ωn ω)2
ωn2 (ωn2 − ω2 )2 + 4(ζ ωn ω)2 ωn2
|G(j ω)| = = ,
(ωn2 − ω2 )2 + 4(ζ ωn ω)2 (ωn2 − ω2 )2 + 4(ζ ωn ω)2
G(j ω) = arctan
−2ζ ωn ω
.
ωn2 − ω2
ωn2
B = A ,
(ωn2 − ω2 )2 + 4(ζ ωn ω)2
−2ζ ωn ω
φ = arctan .
ωn2 − ω2
In Fig. 6.5, the plot obtained (dashed line) using the expressions for |G(j ω)| = B
A
and φ that have just been defined is shown. The closeness observed between the
continuous and the dashed lines is evidence that the analytical relationships obtained
correctly represent the experimental situation. Note that:
B ω2 1 ωn 1 L
= n = = R = ,
A 2
4(ζ ωn ) 2 2ζ L
R C
φ = −90◦ ,
when ω = ωn = LC 1
, which is known as the corner frequency. We note, however,
that the amplitude maximum occurs when ω = ωr , which is known as the resonance
frequency satisfying ωr < ωn and ωr = ωn only when ζ = 0. Note that, according
to Table 6.3, B/A reaches its maximum when f = 4293[Hz], i.e., when ω =
0.2697 × 105 [rad/s]= ωr ≈ ωn . Thus, we can compute an approximate value for
inductance from these experimental data as:
1 1
L= ≈ = 13.7 × 10−3 [H], (6.7)
ωn2 C (0.2697 × 105 )2 (0.1 × 10−6 )
330 6 Frequency Response-Based Design
Table 6.4 Experimental data f [Hz] ω = 2πf [×105 rad/s] A [V] B [V] φ [◦ ]
for the RLC circuit in
Fig. 6.2d 100 0.0063 0.4 0.004 72
500 0.0314 0.38 0.012 99
800 0.0503 0.35 0.018 100.8
900 0.0565 0.34 0.018 97.2
1000 0.0628 0.34 0.024 90
2000 0.1257 0.3 0.04 79.2
3000 0.1885 0.29 0.09 64.8
4000 0.2513 0.29 0.22 28.8
4497 0.2826 0.29 0.26 0
5000 0.3142 0.26 0.2 −36
6000 0.3770 0.26 0.11 −59.4
7000 0.4398 0.26 0.08 −75.6
8000 0.5027 0.26 0.07 −79.2
10000 0.6283 0.26 0.045 −81
20000 1.2566 0.26 0.02 −79.2
40000 2.5133 0.26 0.01 −72
6.1 Frequency Response of Some Electric Circuits 331
B
A
× 105
ωr
φ
[°]
× 105
ωr
ω [rad/s]
Fig. 6.6 Experimental (continuous) and theoretical (dashed) data for the circuit in Fig. 6.2d (see
Table 6.4)
Using the tension divider in the circuit shown in Fig. 6.2d yields:
R
V0 (s) = Vi (s),
R + sL + 1
sC
and rearranging:
V0 (s) 2ζ ωn s 1 R
= G(s) = 2 , ωn2 = , 2ζ ωn = .
Vi (s) s + 2ζ ωn s + ωn2 LC L
j 2ζ ωn ω
G(j ω) = ,
+ j 2ζ ωn ω + ωn2
(j ω)2
2
j 2ζ ωn ω ωn − ω2 − j 2ζ ωn ω
= 2 ,
ωn − ω2 + j 2ζ ωn ω ωn2 − ω2 − j 2ζ ωn ω
j 2ζ ωn ω(ωn2 − ω2 − j 2ζ ωn ω)
= ,
(ωn2 − ω2 )2 + 4(ζ ωn ω)2
332 6 Frequency Response-Based Design
2ζ ωn ω (ωn2 − ω2 )2 + 4(ζ ωn ω)2 2ζ ωn ω
|G(j ω)| = = ,
(ωn − ω ) + 4(ζ ωn ω)
2 2 2 2
(ωn2 − ω2 )2 + 4(ζ ωn ω)2
G(j ω) = 90◦ + arctan
−2ζ ωn ω
.
ωn2 − ω2
In Fig. 6.6, the plot obtained (dashed line) using the expressions for |G(j ω)| = B
A
and φ that have just been defined is shown. The closeness observed between the
continuous and the dashed lines is evidence that the analytical relationships obtained
correctly represent the experimental situation. Note that:
B 2ζ ωn ω
= = 1,
A 4(ζ ωn ω)2
φ = 0◦ ,
when ω = ωn = 1
LC , which is known as the band center. We note that the
magnitude at this maximum does not depend on any circuit parameter and ωr = ωn
in this case. According to Table 6.4, the maximum value of B/A is obtained
experimentally when f = 4497[Hz], i.e., when ω = 0.2826 × 105 [rad/s]= ωn .
Hence, we can compute the value of the inductance from the experimental data as:
1 1
L= = = 12.5 × 10−3 [H], (6.8)
ωn2 C (0.2826 × 105 )2 (0.1 × 10−6 )
f(t)
– 2π –π π 2π t
–k
sin (ω1t)
sin (ω2t)
–k
t[s]
Fig. 6.9 Different approximations of f (t) shown in Fig. 6.7. Continuous f1 (t) = 4k
sin(t).
π
π sin(t) + 3 sin(3t) . Dash–dot f3 (t) = π sin(t) + 3 sin(3t) +
Dashed f2 (t) = 4k 1 4k 1 1
5 sin(5t)
6.2 The Relationship Between Frequency Response and Time Response 335
to complete the corresponding Fourier series, the resulting function approaches the
abrupt discontinuities that f (t) has at specific points. According to these ideas, the
following is concluded.
High-Frequency Components The larger the amplitude of the high-frequency
components, the faster the variations of the function in time. Very high-frequency
components imply discontinuity in time.
Noise is an undesirable fast-changing signal. This means that the noise has high-
frequency components.
Zero-Frequency Component A zero-frequency signal is a constant signal. This
can be concluded from:
Au cos(ωt) = Au = constant, if ω = 0.
υi(t)
the system response can be obtained by computing the response to each signal
composing the input and, finally, adding all these responses. According to this and
the above discussion, we arrive at the following conclusions, which are valid if G(s)
is stable.
• If u(t) is a step with magnitude A, i.e., the zero frequency component has ampli-
tude A, then the corresponding output y(t), in a steady state, is limt→∞ y(t) =
AG(j 0) (see (3.108)), i.e., y(∞) is equal to the system response to the zero
frequency component of the input. For instance, in the circuits studied in
Sects. 6.1.1, 6.1.2, 6.1.3, 6.1.4, we have |G(j 0)| = |G(j ω)|ω=0 = 1, |G(j 0)| =
|G(j ω)|ω=0 = 0, |G(j 0)| = |G(j ω)|ω=0 = 1 and |G(j 0)| = |G(j ω)|ω=0 = 0
respectively; hence, limt→∞ y(t) = A, limt→∞ y(t) = 0, limt→∞ y(t) = A,
limt→∞ y(t) = 0, respectively. See Figs. 6.11, 6.12, 6.13 and 6.14, where a step
signal is applied experimentally at the input of each one of these circuits.
It is interesting to realize that, as shown in Sect. 3.4, if u(t) is a step with
amplitude A, then the final value of the output, in a steady state, is computed
using the final value theorem, i.e.,:
A
lim y(t) = lim sY (s) = lim sG(s) = G(0)A,
t→∞ s→0 s→0 s
Fig. 6.11 Time response of the circuit in Fig. 6.2a when vi (t) is a step signal
6.2 The Relationship Between Frequency Response and Time Response 337
Fig. 6.12 Time response of the circuit in Fig. 6.2b when vi (t) is a step signal
Fig. 6.13 Time response of the circuit in Fig. 6.2c when vi (t) is a step signal
338 6 Frequency Response-Based Design
Fig. 6.14 Time response of the circuit in Fig. 6.2d when vi (t) is a step signal
• Suppose that u(t) is a step with amplitude A. In this case, u(t) possesses a
discontinuity at t = 0. As discussed in the previous section, the high-frequency
components produce such a discontinuity; hence, it is concluded that u(t)
possesses a large content of high-frequency components.
In the case of the circuits studied in Sects. 6.1.1, 6.1.3, and 6.1.4, the input
high-frequency components, u(t) = vi (t), are strongly attenuated, i.e., they have
only a very small effect on the output y(t) = v0 (t), because |G(j ω)| → 0 as
ω → ∞ (see Figs. 6.3, 6.5 and 6.6). Then, the output y(t) = v0 (t) does not
present any discontinuity at t = 0 (see Figs. 6.11, 6.13, and 6.14). Note that this
also means that the effect of noise on the output is also strongly attenuated in
these cases.
On the other hand, in the case of the circuit studied in Sect. 6.1.2, the
high-frequency components at the input, u(t) = vi (t), are not attenuated and
they appear identical at the output y(t) = v0 (t), because |G(j ω)| → 1 and
G(j ω) → 0 as ω → ∞ (see Fig. 6.4). Then, the output y(t) = v0 (t) presents
the same discontinuity that the input u(t) possesses at t = 0 (see Fig. 6.12).
Finally, we note that the above ideas on the relationship between the disconti-
nuity of the function in time and the high-frequency components is also supported
by the initial value theorem (see (3.5)). Let us apply this theorem to circuits
studied experimentally in Sect. 6.1. We recall that vi (t) is a step function with
the magnitude A. In the case of the electric circuit studied in Sect. 6.1.1, we have:
a A
v0 (0+ ) = lim s = 0.
s→∞ s+a s
6.2 The Relationship Between Frequency Response and Time Response 339
ωn2 A
v0 (0+ ) = lim s = 0.
s→∞ s 2 + 2ζ ωn s + ωn2 s
2ζ ωn s A
v0 (0+ ) = lim s = 0.
s→∞ s2 + 2ζ ωn s + ωn s
2
s A
v0 (0+ ) = lim s = A.
s→∞ s+a s
We stress that all signals are assumed to be zero for all t < 0 when using the
Laplace transform and that all initial conditions are assumed to be zero because
a transfer function representation of systems is considered. Hence, v0 (0+ ) = 0
implies that v0 (t) is continuous at t = 0 and v0 (0+ ) = A implies that v0 (t) has a
discontinuity of magnitude A, i.e., as large as the step applied at vi (t), at t = 0.
These results are corroborated experimentally in Figs. 6.11, 6.12, 6.13, and 6.14.
• A system becomes faster if it does not attenuate the high-frequency components.
However, if too high-frequency components are not attenuated, some problems
appear because of noise amplification. Hence, the frequency components that are
not to be attenuated are called the intermediate frequencies.
For instance, in the circuit studied in Sect. 6.1.1, this is achieved if the
parameter a = RC 1
> 0 is increased (see (6.2)). This can be understood by
observing Fig. 6.15 where it is shown that the value of |G(j ω)| can be increased
for larger frequencies if a larger value of a is employed. This is corroborated by
|G (j!)|
√
1= 2
0 a1 a2
!
a
Fig. 6.15 A larger value of a in s+a allows a greater effect of the intermediate frequencies and,
hence, a faster time response is accomplished
340 6 Frequency Response-Based Design
what was exposed in Sect. 3.1.1, Chap. 3, where it is explained that a system with
the transfer function G(s) = a/(s + a) is faster as a is increased.
Using similar arguments, we conclude that in the case of the electric circuit
studied in Sect. 6.1.3, a faster response is obtained if ωn = √ 1 is increased.
LC
Moreover, the presence of a resonance peak in Fig. 6.5 implies that a frequency
component at ω = ωr ≈ ωn is significantly amplified. This is observed as
a clear oscillation in Fig. 6.13 whose frequency is equal to ωr ≈ ωn . Hence,
if the frequency of this oscillation increases, then the rise time decreases (a
faster response is obtained). This corroborates the notion that a faster response is
obtained if ωr ≈ ωn is increased. According to these ideas, it is obvious that a
faster response is also produced in the electric circuit studied in Sect. 6.1.4 if ωn
is increased.
In arbitrary n−order systems G(s), the bandwidth, ωBW , is defined as the
frequency where |G(j ωBW )| = √1 |G(j 0)| = 0.7071|G(j 0)|, i.e., the frequency
2
where the system magnitude is 0.7071 times the magnitude at ω = 0. For systems
with a transfer function:
a
,
s+a
kdB = 20 log(k),
where log(k) stands for the decimal logarithm of k. The decimal logarithm of k is
defined as follows. If:
10z = k,
6.3 Common Graphical Representations 341
Bode diagrams are drawn on semilogarithmic axes: the horizontal axis (ω, in
[rad/s]) has a logarithmic scale whereas the vertical axis has a linear scale, in
decibels (dB) for the magnitude Bode diagram or in degrees for the phase Bode
diagram. An important concept in Bode diagrams is decade or dec. In Bode
diagrams, it is very important to analyze the frequency ω by decades. One decade
represents an increment of ten times in frequency. For instance, if ω1 = 2.5 and
ω2 = 25, then it is said that one decade exists between ω1 and ω2 .
The arbitrary n−order transfer function defined in (3.108) can be written as:
$j =m
bm j =1 (s − zj )
G(s) = $i=n , (6.11)
i=1 (s − pi )
For this reason, in Figs. 6.16 and 6.17, Bode diagrams of these factors are presented.
Recall that the magnitude Bode diagram represents the quantity:
as a function of the frequency ω. The phase Bode diagram represents the quantity:
Im(G(j ω))
φ = atan ,
Re(G(j ω))
|G(j!)|
[dB]
G(j!)
! [rad=s]
(a)
|G(j!)|
[dB]
G(j!)
! [rad=s]
(b)
|G(j!)|
[dB]
G(j!)
! [rad=s]
(c)
Fig. 6.16 Bode diagrams of first- and second-order factors in (6.12) . (a) G(s) = 1s . (b) G(s) = s.
(c) G(s) = s+a
a
6.3 Common Graphical Representations 343
|G(j!)|
[dB]
G(j!)
! [rad=s]
(a)
|G(j!)|
[dB]
G(j!)
! [rad=s]
(b)
|G(j!)|
[dB]
G(j!)
! [rad=s]
(c)
Fig. 6.17 Bode diagrams of first- and second-order factors in (6.12) (continued). (a) G(s) = s+a
a .
ωn2 s 2 +2ζ ωn s+ωn2
(b) G(s) = s 2 +2ζ ωn s+ωn2
. (c) G(s) = ωn2
344 6 Frequency Response-Based Design
On the other hand, if the factor in (6.12) contains poles, then the corresponding
Bode diagrams show that such a factor behaves as a low-pass filter and that a
phase lag is produced, i.e., the factor contributes with a negative phase. This means
that poles in a transfer function reduce the effects of noise. On the other hand,
as discussed in Sect. 5.1.1, an open-loop pole tends to deteriorate the closed-loop
stability. In Sect. 6.5, it is explained that this effect is due to the phase lag contributed
by a pole in the frequency response of the open-loop transfer function.
The frequency response plots of the arbitrary n−order minimum phase transfer
function defined in (6.11) are obtained as the combination of the factors in (6.12).
In the case of Bode diagrams, this combination process of first- and second-order
factors is very simple, as explained in the following. Note that the arbitrary n−order
transfer function, G(s), given in (6.11) can be written as:
k=r
G(s) = β Gk (s),
k=1
for some real constant β and some integer positive number r, where Gk (s), for
k = 1, . . . , r, has the form of one of the factors in (6.12). Then:
k=r
k=r
|G(j ω)| = β Gk (j ω) = |β| |Gk (j ω)|.
k=1 k=1
According to this, the decibels definition |G(j ω)|dB = 20 log(|G(j ω)|) and the
property log(xy) = log(x) + log(y), shown in (6.10), it is possible to write:
k=r
|G(j ω)|dB = 20 log(|β|) + 20 log(|Gk (j ω)|).
k=1
This means that the magnitude Bode diagram (the phase Bode diagram) of an
arbitrary n−order transfer function, G(s), can always be obtained as the addition of
the magnitude Bode diagrams (the phase Bode diagrams) of every first- and second-
order factor of G(s).2
2 Recall that given three complex numbers z, x, y such that z = xy, the angle of z is given as the
G
Im (G)
|G|
Re (G)
B
G= φ = Re(G) + j Im(G),
A
B B B
|G| = , Re(G) = cos(φ), Im(G) = sin(φ).
A A A
Given a transfer function G(s), the quantity G(j ω) is a complex number that can
be represented as in Fig. 6.18. The polar plot of G(j ω) is the curve obtained in the
plane shown in Fig. 6.18 as ω goes from −∞ to +∞. In polar plots, the magnitude
is no longer represented using decibels.
Note that the polar plot of the arbitrary n−order transfer function shown in (6.11)
cannot be obtained as the simple combination of the polar plots of the first- and
second-order factors shown in (6.12). To simplify this process, it is suggested to
first obtain the corresponding Bode diagrams and, from them, obtain the required
information to draw the corresponding polar plots for positive frequencies, i.e.,
when ω goes from 0 to +∞. The polar plots for negative frequencies, i.e., when
ω goes from −∞ to 0, are obtained from polar plots for positive frequencies just by
projecting, as in a mirror, the part of the curve on the upper half-plane to the bottom
half-plane and vice versa. This is the procedure that has been followed to obtain
the polar plots shown in Figs. 6.19 and 6.20, from the Bode diagrams in Figs. 6.16
and 6.17. The arrows in the polar plots indicate the sense where frequency increases
from ω = −∞, passing through ω = 0, to ω = +∞. Some examples of where
these ideas are applied are presented in the next section.
Example 6.1 (Resonance) Consider the mass-spring-damper system depicted in
Fig. 6.21. The transfer function in this case is the same as in Example 3.8 Chap. 3,
i.e.,:
kωn2
X(s) = G(s)F (s), G(s) = ,
s 2 + 2ζ ωn s + ωn2
K b 1
ωn = , ζ = √ , k= ,
m 2 mK K
6.3 Common Graphical Representations 347
Re (G(j!))
!→–∞
!→+∞
! → 0+
(a)
Im (G(j!))
!→+∞
Re (G(j!))
!= 0
!→–∞
(b)
Im (G(j!))
Re (G(j!))
!→–∞
!=0
!→+∞
(c)
348 6 Frequency Response-Based Design
Re (G(j!))
!=0
!→–∞
(a)
Im (G(j!))
³ = 0.1
0:3
Re (G(j!))
0:5
0:7
0:9 ! 2→ – ∞
!→+∞ !=0
(b)
where x = 0 is defined as the position when the system is at rest with f (t) = 0 under
the effect of the spring and weight of the mass. The situation shown in Fig. 6.21 is
equivalent to that of a car at rest on the floor: m stands for the car mass, K is the
suspension system stiffness, and b represents the effect of the dampers. Everyday
experience teaches us that, although heavy, a small car can be flipped over by a small
group of people if they apply a force as follows. The car is pushed up and then it is
allowed to move down. After bouncing on the floor it is pushed up again when the
car is moving upward. Although the applied force is always too small to flip over
the car, after applying the same force several times the car is finally flipped over.
This is a clear example of the resonance effects and this situation is analyzed in the
following.
6.3 Common Graphical Representations 349
x
m
K b
time
Fig. 6.22 The applied force and the resulting position of the body in Fig. 6.21 under resonance
conditions
The force applied by the people has a periodic form with a cosine fundamental
component. When this force is positive, the car is pushed upward. When it is
negative the car is allowed to fall down. The fact that this force is applied only
when the car moves upward implies that this cosine component has a frequency ω
that is equal to the car’s natural oscillation frequency ωn . If it is assumed that there is
no damper, b = 0, then ζ = 0. According to Fig. 6.17b, under these conditions, the
output x(t) (the car position) lags 90◦ with respect to the applied force. This means
that x(t) = B sin(ωt) if f (t) = A cos(ωt), for some positive constant B, if ω = ωn .
Then, according to Fig. 6.22, a maximal force is applied (f has a crest) exactly when
the car is moving upward (x is passing from a trough to a crest), which is in complete
agreement with the intuitive application of the force by people. Moreover, if ω = ωn
350 6 Frequency Response-Based Design
and ζ = 0 the oscillation amplitude B of the motion described by the car will grow
without limit, even when the amplitude of the force applied at the input A is small
(B = |G(ωn )|A and |G(ωn )| → ∞). This explains why the car can be flipped over.
An explanation from the point of view of physics is presented next to help to
understand why this happens. The system energy is given as the addition of the
kinetic energy and the potential energy (only due to the spring):
E = Ec + Ep ,
1 2 1
Ec = mẋ , Ep = Kx 2 .
2 2
The gravity effect is not taken into account because it has been assumed that x = 0
is the position when the body is at rest when f = 0 under the effects of the gravity
and the spring. As time increases, the variation of this energy is given as:
b K 1
ẍ = − ẋ − x + f,
m m m
yields:
Ė = −bẋ 2 + ẋf.
The mean energy delivered to the mechanical system with each oscillation period
T = 2π/ωn , is given as:
T
ωn AB
E= cos2 (ωn t)dt > 0.
T 0
Note that cos2 (ωn t) ≥ 0 for all t. On the other hand, when considering that
b = 0, it is assumed that there is no energy dissipation; hence, that all the energy
supplied to the system is stored as the total energy of the mass E = Ec + Ep .
Thus, this energy increases without limit as time increases. As x(t) and ẋ(t) are
sine functions of time, then the amplitude of these oscillations also grows without
limit, as described by Fig. 6.17b.
6.3 Common Graphical Representations 351
2. ζ > 0, f = A cos(ωn t). In this case b > 0 and, according to Fig. 6.17b,
the output x(t) converges (after the natural response becomes negligible) to
a function that lags at an angle 90◦ with respect to the applied force, i.e.,
x(t) = B sin(ωn t) y ẋ = ωn B cos(ωn t) for some positive B and, then:
Thus, the mean stored energy in the mechanical system during each oscillation
period is given as the subtraction of the mean supplied energy and the mean
dissipated energy, i.e.,:
T
1
E= [−bωn2 B 2 cos2 (ωn t) + ωn AB cos2 (ωn t)]dt,
T 0
−bωn2 B 2 + ωn AB T
= cos2 (ωn t)dt.
T 0
A A A kA
B= = √ = = . (6.13)
bωn K
2ζ mK m 2ζ K 2ζ
s+ 1
Gd (s) = T
, 0 < ξ < 1, T > 0. (6.14)
s+ 1
ξT
352 6 Frequency Response-Based Design
According to the properties in (6.10), the magnitude Bode diagram (in dB) of Gd (s)
in (6.14) is obtained as the addition of the magnitude Bode diagrams of two first-
order factors:
1
1
s+ 1
ξT
Gd (s) = T T
. (6.15)
1
ξT
1
T s+ 1
ξT
Bode Diagram
0
−2
−4
Magnitude (dB)
−6
−8
−10
−12
−14
−16
−18
−20
60
Phase (deg)
30
0
10−2 10−1 100 101 102
Frequency (rad/sec)
Fig. 6.24 Bode diagrams for Gd (s) in (6.14), when T = 4 and ξ takes the values
0.14, 0.2, 0.4, 0.7, and0.9. In the magnitude plot, ξ increases from bottom to top. In the phase
plot, ξ increases from top to bottom
Note that T = 4 and several values of 0 < ξ < 1 were used. The reader can verify
that the first corner frequency appears at ω = T1 = 0.25[rad/s] and the second corner
frequency appears at ω = ξ1T > 0.25[rad/s]. Also note that the high-frequency
1
gain is unitary, whereas the low-frequency gain T
1 = ξ decreases with ξ . This
ξT
corroborates Fig. 6.23.
On the other hand, the transfer function in (6.14) is very useful for designing a
special class of controllers known as lead compensators. This application, however,
is rendered easier if the following procedure is employed:
Ts +1
Gd (T s) = .
Ts + 1
ξ
1
z+1 ξ
Gd (T s) = Gd (z) = ξ . (6.16)
1 z + ξ1
354 6 Frequency Response-Based Design
0:9
0:7
0:4
0:2
ξ = 0 :14
ξ = 0 :14
0:2
0:4
0:7
0:9
!T
0:01 0:1 1 10 100 1000
Fig. 6.25 Bode diagrams for Gd (z) in (6.16), i.e., the normalized version of Gd (s) in (6.14)
Im (G d (j! ))
ξ 1 !→+∞
0 !=0 !→–∞
Re (G d (j! ))
Nyquist Diagram
0.5
0.4
0.3
0.2
Imaginary Axis
0.1
−0.1
−0.2
−0.3
−0.4
−0.5
−0.2 0 0.2 0.4 0.6 0.8 1 1.2
Real Axis
Fig. 6.27 Polar plot of Gd (s) in (6.14) when using the numerical values in Fig. 6.24
in the polar plots. Then, sketches representing the behavior at the intermediate
frequencies are drawn that satisfy the previously drawn sketches for zero and infinity
frequencies. Finally, the polar plots for negative frequencies, i.e., from ω = −∞ to
ω = 0, are symmetrical images with respect to the real axis of the plots for positive
frequencies. Compare the polar plot shown in Fig. 6.26 and the Bode diagrams in
Fig. 6.23.
Polar plots are drawn in MATLAB using the command “nyquist().” The polar
plot corresponding to the Bode diagrams in Fig. 6.24 is shown in Fig. 6.27. This
was achieved by executing the following MATLAB code in an m-file several times:
xi=0.9;%0.14 0.2 0.4 0.7 0.9
T=4;
gd=tf([1 1/T],[1 1/(T*xi)]);
356 6 Frequency Response-Based Design
figure(3)
nyquist(gd)
axis([-0.2 1.2 -0.5 0.5])
hold on
It is observed in Fig. 6.27 that, for each different value of ξ , the polar plot is
a circle crossing the positive real axis at two points: +1, i.e., the high-frequency
gain, and ξ , i.e., the low-frequency gain. This means that the external-most circle
corresponds to ξ = 0.14 and the internal-most circle corresponds to ξ = 0.9.
This corroborates the plot in Fig. 6.26. Note the arrow senses indicating that the
frequency ω increases from −∞ to +∞.
Ax γ k ρ
G(s)H (s) = , (6.17)
s + a s3
where the constants Ax , γ , k, a, ρ are all positive. Writing this transfer function in
terms of its fundamental factors, yields:
ρAx γ k a 1
G(s)H (s) = .
a s + a s3
According to the properties in (6.10), the magnitude Bode diagram of the factor s13
is a straight line with a slope of −60[dB/dec]. The Bode diagrams of G(s)H (s) and
its components are shown in Fig. 6.28. As explained in the previous example, the
polar plot in Fig. 6.29 can be easily obtained from the Bode diagrams in Fig. 6.28.
ω→+∞
ω→–∞ Re (G (jω ) H (jω ) )
ω = 0–
Nyquist Diagram
x 105
1
0.8
0.6
0.4
Imaginary Axis
0.2
−0.2
−0.4
−0.6
−0.8
−1
−1000 0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Real Axis
To verify these results, the polar plot of G(s)H (s) defined in (6.17) is presented
in Fig. 6.30 when using:
gamma=1.6406;
gh=tf(Ax*gamma*k*rho,[1 a 0 0 0])
figure(1)
nyquist(gh,{0.1,10})
It is important to learn to correctly interpret the polar plot in Fig. 6.30. Note that
neither infinite nor zero frequencies can be handled numerically by MATLAB in
this example because of the singularities appearing at these frequencies. Hence, the
polar plot in Fig. 6.30 is just a small part of the polar plot in Fig. 6.29, i.e., a small
part around the positive real axis close to the origin. Observe the sense of the arrows
in both figures.
Example 6.4 Following similar procedures to those described in the previous
examples, the Bode diagrams and the polar plots of the following transfer functions
can be obtained:
s+b k ρ
G(s)H (s) = Ax γ , (6.18)
s + c s(s + a) s 2
Ax γ s + b αkAθ ρ
G(s)H (s) = , (6.19)
Aθ s + c s + (a + kv kAθ )s + αkAθ s 2
2
!→+∞
!→–∞ Re (G (j!) H (j!) )
! = 0–
Routh’s stability criterion is a tool useful for determining whether a system has some
of its poles on the right half plane. If this is not the case, then all poles are located in
the left half-plane, which ensures system stability. Routh’s criterion must be applied
to the characteristic polynomial of the system under study and it is introduced as the
stability criterion for control systems when analyzed from the point of view of time
response. The reader is referred to Chap. 4 in the present book, or [5, 6], for further
information on Routh’s criterion.
Now, a new stability criterion is introduced for closed-loop control systems,
which is established in terms of its open-loop frequency response. This feature
360 6 Frequency Response-Based Design
Im (G (j!) H (j!) )
! = 0– !→+∞
!→–∞
! = 0+ Re (G (j!) H (j!) )
must be correctly understood because students often become confused asking the
following question: how is it possible to determine closed-loop stability from the
study of the open-loop frequency response? The answer to this question is given
in the present section and the tool solving this problem is known as the Nyquist
stability criterion.
G(s) = s − a,
where a is any constant number, real or complex. Note that this system only
possesses one zero at s = a. Consider a clockwise contour Γ on the plane s, around
the zero at s = a (see Fig. 6.35). When G(s) is evaluated on Γ , it means that s in
G(s) successively takes all values of s on Γ . Evaluate G(s) on Γ :
Im (s)
Re (s)
Im (G (s))
G (s)
Re (G (s))
– 2π
Fig. 6.36 A clockwise contour around the origin of the plane G(s)
1
G(s) = ,
s−a
362 6 Frequency Response-Based Design
Re (s)
where a is any constant number, real or complex. Note that this system only
possesses one pole at s = a. Consider a clockwise contour Γ on the plane s,
encircling the pole at s = a (see Fig. 6.37). Evaluate G(s) on Γ :
1 1
G(s) = = − θ, l = |s − a|, θ = (s − a).
l θ l
Note, again, that s −a can be represented by a vector from a to s. It is easy to realize
that each time the contour Γ is completed, the angle −θ has a positive increment
(counterclockwise) of +2π [rad]. On the other hand, as Γ does not pass through
s = a then 1/ l > 0 (it is finite) on the whole contour. This means that each time the
clockwise contour Γ is completed, the vector 1l − θ describes a counterclockwise
contour around the origin. As G(s) = 1l − θ , it is said that a counterclockwise
contour has been completed around the origin of the plane G(s), i.e., around G(s) =
0 (see Fig. 6.38).
Suppose that G(s) is only composed of n poles. From the above discussion,
it is not difficult to realize that when Γ encircles all these poles, then each time
the clockwise contour Γ is completed, n counterclockwise contours are completed
around the origin of the plane G(s).
C(s) G(s)
= .
R(s) 1 + G(s)H (s)
6.4 Nyquist Stability Criterion 363
+ 2π
Re (G (s))
–θ
1/l
G (s)
H(s)
Closed-loop stability is ensured if this transfer function is proven not to have any
poles on the right half-plane. The main idea is to investigate the existence of such
poles using a contour (path), as in the previous section. Suppose that a clockwise
closed path is employed such as that shown in Fig. 6.40. Note that this path encloses
G(s)
any pole or zero that the transfer function 1+G(s)H (s) might have on the right half-
plane. This closed path is known as the Nyquist path. Suppose that the transfer
G(s)
function 1+G(s)H (s) has p poles and z zeros on the right half-plane. According to
the previous section, if the Nyquist path is completed once, the number of clockwise
G(s)
rotations of the contour around the origin of the plane 1+G(s)H (s) is z − p, whereas
a negative result indicates counterclockwise rotations. Suppose that such a number
of rotations is z, i.e., z − p = z. This would imply that p = 0, i.e., that any
closed-loop pole is not placed on the right half-plane; hence, closed-loop stability
would be ensured. This is the fundamental idea behind the Nyquist stability criterion
presented next. However, some details have to be considered first.
Given a closed-loop system, the open-loop transfer function G(s)H (s) is known
G(s)
(the plant and the controller), but the closed-loop transfer function 1+G(s)H (s) is
unknown. This means that, despite the poles and zeros of G(s)H (s) being known,
G(s) G(s)
the poles of 1+G(s)H (s) are unknown. If the poles of 1+G(s)H (s) were known, then
the stability problem would be solved. Hence, one problem to be solved by the
Nyquist criterion is to determine closed-loop stability only from the knowledge of
G(s)
the open-loop transfer function. This means that the function 1+G(s)H (s) cannot be
evaluated on the Nyquist path as described in the previous paragraphs. This implies
364 6 Frequency Response-Based Design
+∞
r → ∞
0 Re (s)
–∞
G(s)
that the number of contours completed around the origin of the plane 1+G(s)H (s)
cannot be known; hence, such a method has to be modified. This is performed in the
next sections.
C(s) G(s)
= .
R(s) 1 + G(s)H (s)
• The closed-loop poles are the zeros of 1 + G(s)H (s). Recall that the closed-loop
poles are those values of s satisfying 1 + G(s)H (s) = 0.
• The poles of G(s)H (s) (the open-loop poles) are also poles of 1 + G(s)H (s).
Note that G(s)H (s) → ∞ implies that 1 + G(s)H (s) → ∞.
6.4 Nyquist Stability Criterion 365
Suppose that G(s)H (s) has P poles on the right half-plane (open-loop unstable
poles), i.e., according to the previous section, 1 + G(s)H (s) has P poles on the
right half-plane. Also suppose that the function 1 + G(s)H (s) has Z zeros on
the right half-plane (closed-loop unstable poles). Suppose that, once the Nyquist
path is completed, N contours around the origin of the plane 1 + G(s)H (s) are
completed, i.e., N = Z − P . If N = −P < 0, i.e., if P counterclockwise contours
are completed around the origin of the plane 1 + G(s)H (s), then the number of
closed-loop unstable poles is zero, Z = 0, and closed-loop stability is ensured.
The origin of the plane 1 + G(s)H (s) satisfies the condition 1 + G(s)H (s) = 0,
which is equivalent to G(s)H (s) = −1. Hence, the origin of the plane 1+G(s)H (s)
corresponds to the point (−1, j 0) on the plane G(s)H (s). This means that the
number N of contours around the origin of the plane 1+G(s)H (s) is identical to the
number of contours around the point (−1, j 0) on the plane G(s)H (s). This is very
convenient because it only requires us to know G(s)H (s), instead of 1+G(s)H (s),.
Finally, if the number of poles of G(s)H (s) is greater than or equal to its
number of zeros, then lims→∞ G(s)H (s) =constant. This means that the function
G(s)H (s) remains at a single point along the complete semicircular part of the
Nyquist path, which has an infinite radius. Then, the very interesting part of
G(s)H (s) is that obtained when the Nyquist path is on the imaginary axis, from
j ω = −j ∞ to j ω = +j ∞. Note that along this part of the Nyquist path, G(s)H (s)
becomes G(j ω)H (j ω), which represents the polar plot of the open-loop transfer
function. The above discussion allows us to establish the following result.
Nyquist Stability Criterion Special case when G(s)H (s) has neither poles nor
zeros on the imaginary axis.
Consider the closed-loop system shown in Fig. 6.39. If the open-loop transfer
function G(s)H (s) has P poles on the right half-plane s and lims→∞ G(s)H (s)
= constant, then closed-loop stability is ensured if the polar plot of G(j ω)H (j ω)
(when ω passes from −∞ to +∞) describes P counter clockwise contours around
the point (−1, j 0).
The key to remembering the Nyquist criterion is the following formula:
N =Z−P
where P represents the number of open-loop poles with a positive real part, Z
stands for the number of unstable closed-loop poles and N represents the number of
contours that the polar plot of G(j ω)H (j ω) describes around the point (−1, j 0),
when ω passes from −∞ to +∞. A positive N stands for clockwise contours,
whereas a negative N represents counterclockwise contours. Closed-loop stability
is ensured when Z = 0, i.e., when N = −P .
366 6 Frequency Response-Based Design
The trick of the closed path Γ introduced in Sect. 6.4.1 is valid only if such a closed
path completely encircles the corresponding poles and zeros. Hence, it cannot be
applied when one pole or zero is located on the path. Note that in the case when the
open-loop transfer function G(s)H (s) has poles or zeros on the imaginary axis the
Nyquist path passes through such poles or zeros; hence, the criterion established in
Sect. 6.4.4 cannot be applied. This problem is solved by defining a new path known
as the modified Nyquist path, which is shown in Fig. 6.41. This path is identical to
the Nyquist path introduced in Fig. 6.40 and the former only differs from the latter
at points containing poles or zeros of G(s)H (s) on the imaginary axis. The main
idea is to contour such points using a semicircular path with a very small radius
ε → 0, which describes an angle from −90◦ to +90◦ . The reason to include a very
small radius is to ensure that the modified Nyquist path completely encloses any
possible pole or zero (unknown) that could be located on the right half-plane close
to the imaginary axis. Thus, the general form of the Nyquist stability criterion can
be stated as follows.
Nyquist Stability Criterion General case when G(s)H (s) may have poles or
zeros on the imaginary axis.
Consider the closed-loop system shown in Fig. 6.39. If the open-loop transfer
function G(s)H (s) has P poles on the right half-plane s, then closed-loop stability
A system is said to be minimum phase if all its poles and zeros have a negative or
zero real part and its gain is positive. If this is not the case, the system is said to be
nonminimum phase. The Nyquist criterion is valid for closed-loop systems whose
open-loop transfer function is either minimum phase or nonminimum phase, i.e., it
is a result that can be applied to any case. However, the Nyquist stability criterion
is simplified if the system has a minimum phase open-loop transfer function, as
explained in the following.
If the open-loop system is minimum phase then P = 0; hence, closed-loop
stability is ensured if N = 0, then the Nyquist stability criterion is simplified as
follows:
Nyquist Stability Criterion for Open-Loop Minimum Phase Systems [10, 11]
Consider that the frequency ω only takes values from 0 to +∞. Draw the part of the
polar plot of G(s)H (s) corresponding to these frequencies. Suppose that this plot
represents a path where you walk from ω = 0 to ω → +∞. If the point (−1, j 0)
lies to the left of this path, then the closed-loop system in Fig. 6.39 is stable. If such
a point lies to the right, then the closed-loop system is unstable.
If the polar plot passes through the point (−1, j 0), it is said that the closed-loop
system is marginally stable, which means that there are some closed-loop poles with
a zero real part. It can be said that the closed-loop system is more stable, as the point
(−1, j 0) is farther from the polar plot of G(s)H (s)|s=j ω , but always to the left. The
stability margin is a concept introduced to measure the distance existing between
this point and the polar plot, i.e., the distance of a system to instability. There are
two ways of measuring this distance: the phase margin and the gain margin.
• Phase margin is the amount of phase lag required to be added at the crossover
frequency to take the closed-loop system to the edge of instability. The crossover
frequency, ω1 , is such that |G(j ω1 )H (j ω1 )| = 1. Let Kf and φ represent the
phase margin and the phase of G(j ω1 )H (j ω1 ) respectively, then:
Kf = 180◦ + φ.
368 6 Frequency Response-Based Design
1
Kg = ,
|G(j ω2 )H (j ω2 )|
Consider the water level system shown in Fig. 6.43. Note that a considerable
distance x exists between the tank and the position of the input valve whose opening
determines the input water flow qi . This means that if pipes have a cross-section area
A, then:
xA
T = ,
qi
is the time it takes for water to travel from the input valve to the tank. Hence, if
the input valve opening changes a little, then it takes time T for the corresponding
change in qi to arrive to the tank. The time T is known as time delay. From a
mathematical point of view, this fact is expressed by writing qi = qi (t − T ). The
Laplace transform of a delayed function qi (t − T ) is given by the second translation
theorem:
6.5 Stability Margins 369
(a) (b)
Im (G (j!) H (j!) )
!→+∞
1
! = 0+ –1 Kg Re (G (j!) H (j!) )
(c)
Im (G (j!) H (j!) )
1
Kg !→+∞
! = 0+
–1 Re (G (j!) H (j!) )
(d)
Fig. 6.42 Frequency response of G(j ω)H (j ω). The phase and gain margins are determined from
the frequency response of the open-loop transfer function . (a) Closed-loop stability. (b) Closed-
loop instability. (c) Closed-loop stability. (d) Closed-loop instability
370 6 Frequency Response-Based Design
According to Sect. 3.1.2 and (3.28), the mathematical model of the undelayed
water level system is:
k
H (s) = Qi (s),
s+a
thus, according to the theorem above, the model of the water level system when the
input is delayed becomes:
k e−T s
H (s) = Qi (s).
s+a
Note that, from the mathematical point of view, this model stands if either the input
or the output is the delayed variable. It is concluded that the time delay is considered
in a system just by including the factor e−T s in the corresponding transfer function
[9].
On the other hand, a time delay may also appear when using a digital computer to
implement a continuous time controller. In such a case, the time delay T represents
the time required to perform the computations involved in the control law. Thus, in
such a case, it suffices again to include the factor e−T s in the plant transfer function
[3], as the delay appears at the plant input.
Consider the open-loop transfer function of a system that includes a time delay
T as a result of the digital implementation of a continuous time controller, i.e.,:
To analyze the closed-loop stability, consider the magnitude and the phase of this
open-loop transfer function. Note that:
−T s
e = e−j T ω = |cos(ωT ) − j sin(ωT )| = 1.
s=j ω
6.6 The Relationship Between Frequency Response and Time Response Revisited 371
and:
− sin(ωT )
e−T s = e
−j T ω
= [cos(ωT ) − j sin(ωT )] = arctan
s=j ω cos(ωT )
= −ωT ,
sin(θ)
because tan(θ ) = cos(θ) . Suppose that an open-loop transfer function has been
designed to ensure closed-loop stability, i.e., to satisfy suitable stability margins.
Also, suppose that the controller is to be implemented using a digital computer.
To analyze the stability effects that the time delay, because of the real-time
computations required, has on the closed-loop system, consider the following. The
time delay has no effect on the magnitude of the open-loop transfer function, but
an additional phase lag of −ωT [rad] is included. Note that this phase lag has the
effect of reducing the phase margin; thus, attention must be paid to designing a
considerable phase margin rendering the closed-loop system robust with respect to
the digital computer-induced time delay.
As stated in Chap. 5, the time response of a control system is composed of two parts:
the transient response and the steady-state response. It is important to know how the
characteristics of these time responses relate to the characteristics of the frequency
response, to know what is to be modified in the latter to suitably design the former.
The most important points of this relationship are described in the following.
A closed-loop system with the transfer function:
C(s) G(s)
= M(s) = ,
R(s) 1 + G(s)H (s)
is shown in Fig. 6.44. In the following section, it is described how the frequency
response of the closed-loop transfer function, M(s), determines the properties of
the time response c(t). In the subsequent section, the way in which the frequency
response of the open-loop transfer function, G(s)H (s), determines the properties of
the time response c(t) is described.
R(jω) C(jω)
M°
ω
c(t)
r(t)
M(s)
0 t 0 t
The following discussion is based on Sect. 6.2.1 and it refers to the situation
illustrated in Fig. 6.45.
1. The resonant peak height Mr is inversely related to the damping coefficient, ζ :
the larger Mr , the smaller ζ (see Fig. 6.17b). Recall that a smaller damping ζ
produces a larger overshoot, Mp (%), in the time response when a step input is
applied. Hence, the overshoot is larger (and the system is more oscillatory), as
Mr is larger. Roughly speaking, when 1.0 < Mr < 1.4 (0[dB]< Mr < 3[dB]),
then damping is in the range 0.7 > ζ > 0.4 [5] pp. 571, [6] pp. 637.
2. The corner frequency indicates how fast the time response is [5] pp. 573, [6]
pp. 638. Recall that in a second-order system, the corner frequency is ωn , which,
when increased, reduces the rise time (see Sect. 3.3.1). In the case of a first-order
system the corner frequency is given as the absolute value of the system pole.
According to Sect. 3.1.1, the response time (the time constant) reduces if the
pole absolute value increases. In the case of an arbitrary n−order system, the
bandwidth is defined to describe how fast the time response is in terms of the
frequency response. The bandwidth is the frequency where the transfer function
magnitude reduces −3[dB] with respect to its magnitude at zero frequency. The
time response is faster as the bandwidth is larger.
3. The output in a steady state, c(∞), when a step with magnitude A is applied at
the input, is determined by the system response at zero frequency M(j ω)|ω=0 :
A
lim c(t) = lim sM(s) = M(0)A.
t→∞ s→0 s
6.6 The Relationship Between Frequency Response and Time Response Revisited 373
Bode Diagram
0
−5
−10
Magnitude (dB)
−15
−20
−25
−30
−35
−40
0
Phase (deg)
−45
−90
10−2 10−1 100 101 102
Frequency (rad/sec)
Example 6.5 To illustrate the above-mentioned ideas, in Figs. 6.46 and 6.47 the
Bode diagrams and the time response to a step input of the first-order transfer
function M(s) = s+a a
are presented. It is observed that, as predicted above, the
time response becomes faster as the bandwidth becomes larger.
In Figs. 6.48 and 6.49 the Bode diagrams and the time response to a step input
ω2
of the transfer function M(s) = s 2 +2ζ ωn s+ω2 are presented, when ωn = 5 is kept
n n
constant and different values for ζ are employed. Note that overshoot in the time
response becomes larger as the resonance peak also becomes larger, as predicted
above.
In Figs. 6.50 and 6.51 the Bode diagrams and the time response to a step input of
ω2
the transfer function M(s) = s 2 +2ζ ωn s+ω2 are presented, when ζ = 0.4 is kept
n n
constant and different values for ωn are employed. Note that the time response
becomes faster as the bandwidth becomes larger, as predicted above.
These results were obtained by executing the following MATLAB code in an
m-file:
%{
z=0.7;% 0.1 0.4 0.7
wn=5;
M=tf(wn^2,[1 2*z*wn wn^2]);
374 6 Frequency Response-Based Design
Step Response
1
0.9
0.8
0.7
0.6
Amplitude
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
Fig. 6.47 Response to an unit step input of the transfer function M(s) = a
s+a . Continuous: a = 1.
Dash–dot: a = 3. Dashed: a = 5
Bode Diagram
20
10
Magnitude (dB)
0
−10
−20
−30
−40
−50
−60
0
−45
Phase (deg)
−90
−135
−180
10−1 100 101 102
Frequency (rad/sec)
ωn2
Fig. 6.48 Bode diagrams of the transfer function M(s) = s 2 +2ζ ωn s+ωn2
when ωn = 5. Continuous:
ζ = 0.1. Dashed: ζ = 0.4. Dash–dot: ζ = 0.7
6.6 The Relationship Between Frequency Response and Time Response Revisited 375
Step Response
1.8
1.6
1.4
1.2
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5 4
Time (sec)
ωn2
Fig. 6.49 Response to a unit step input of the transfer function M(s) = s 2 +2ζ ωn s+ωn2
when ωn =
5. Continuous: ζ = 0.1. Dashed: ζ = 0.4. Dash–dot: ζ = 0.7
Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
−100
0
−45
Phase (deg)
−90
−135
−180
10−1 100 101 102 103
Frequency (rad/sec)
ωn2
Fig. 6.50 Bode diagrams of the transfer function M(s) = s 2 +2ζ ωn s+ωn2
when ζ = 0.4.
Continuous: ωn = 5. Dashed: ωn = 10. Dash–dot: ωn = 30
376 6 Frequency Response-Based Design
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
ωn2
Fig. 6.51 Response to an unit step input of the transfer function M(s) = s 2 +2ζ ωn s+ωn2
when
ζ = 0.4. Continuous: ωn = 5. Dashed: ωn = 10. Dash–dot: ωn = 30
figure(1)
bode(M,’k-.’)
grid on
hold on
figure(2)
step(M,’k-.’,4)
grid on
hold on
%}
%{
figure(3)
z=0.4;
wn=30; % 5 10 30
M=tf(wn^2,[1 2*z*wn wn^2]);
bode(M,’k-.’)
grid on
hold on
figure(4)
step(M,’k-.’,2.5)
grid on
hold on
%}
%%{
6.6 The Relationship Between Frequency Response and Time Response Revisited 377
figure(5)
a=3;% 1 5 3
M=tf(a,[1 a]);
bode(M,’k-.’)
grid on
hold on
figure(6)
step(M,’k-.’,5)
grid on
hold on
%}
Note that this code can be commented on in blocks. Enabling the corresponding
blocks and executing several times, the results above are obtained.
There is also a relationship between the frequency response of the open-loop transfer
function G(s)H (s) and the time response of the closed-loop system C(s)R(s) = M(s)
(see Fig. 6.52). This relationship is very important for designing feedback control
systems.
1. The phase margin Kf (measured on the system open-loop frequency response
characteristics) is related to the damping coefficient of the closed-loop system
according to the following table [5] pp. 570,[6] pp. 648:
Kf
Note that ζ ≈ 100 in the range 0 ≤ ζ ≤ 0.6. It must be stressed that
this relationship is computed for a second-order system without zeros. Although
differences are expected for higher order systems with zeros with respect to these
values, it is suggested to use these data as directives for design.
2. The larger the crossover frequency (measured on the open-loop frequency
response), the faster the closed-loop system time response [5], pp. 571. This can
be explained as follows. The crossover frequency is that where |G(j ω)H (j ω)| =
0[dB]. Generally, this magnitude increases to +∞[dB] as frequency decreases
to 0, and this magnitude decreases to −∞[dB] as frequency increases to +∞.
Hence, the closed-loop bandwidth is close to the crossover frequency. Thus, a
larger open-loop crossover frequency implies a larger closed-loop bandwidth,
i.e., as a faster closed-loop time response.
3. The steady-state error (closed-loop time response) is obtained from the open-
loop frequency response at zero frequency. For instance, if the reference input is
R(s) = A/s, then (see Sect. 4.4.1, Chap. 4):
378 6 Frequency Response-Based Design
GH °
!
M(s)
r(t) c(t)
G(s)
0 t 0 t
H(s)
A
ess = lim [r(t) − y(t)] = , kp = G(0)H (0) = G(j ω)H (j ω)|ω=0 .
t→∞ 1 + kp
Example 6.6 To illustrate the above-mentioned ideas, in Figs. 6.53 and 6.54 the
Bode diagrams of the open-loop transfer function G(s)H (s) = s(s+3)(s+5) k
are
presented in Fig. 6.52 and the closed-loop time response of M(s) in Fig. 6.52 when
a unit step reference is applied. Note that the phase plot remains the same for all
values of k in Fig. 6.53. Hence, it is easy to realize that the phase margin decreases
as k increases. Moreover, the phase margin becomes slightly negative for k = 145.
This explains why the time response in Fig. 6.54 becomes more oscillatory and,
eventually, unstable as k increases.
On the other hand, it is clear from Fig. 6.53 that the crossover frequency increases
as k increases. As a consequence, the closed-loop time response in Fig. 6.54
becomes faster as k increases. The graphical results above were obtained using the
following MATLAB code executed several times in an m-file:
k=145; % 15 55 95 145
denom=conv([1 0],[1 3]);
denom=conv([1 5],denom);
g=tf(k,denom);
6.6 The Relationship Between Frequency Response and Time Response Revisited 379
Bode Diagram
50
0
Magnitude (dB)
−50
−100
−150
−90
−135
Phase (deg)
−180
−225
−270
10−1 100 101 102 103
Frequency (rad/sec)
Fig. 6.53 Bode diagrams of the open-loop transfer function G(s)H (s) = s(s+3)(s+5)
k
in the
closed-loop system shown in Fig. 6.52. Continuous: k = 15. Dashed: k = 55. Dash–dot: k = 95.
Dotted: k = 145
Step Response
3
2.5
1.5
Amplitude
0.5
−0.5
−1
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (sec)
Fig. 6.54 Time response to a unit step reference of the closed-loop system M(s) in Fig. 6.52.
Continuous: k = 15. Dashed: k = 55. Dash–dot: k = 95. Dotted: k = 145
380 6 Frequency Response-Based Design
M=feedback(g,1,-1);
figure(1)
bode(g,’k:’)
grid on
hold on
figure(2)
step(M,’k:’,5)
grid on
hold on
Consider the DC motor model presented in (5.12), Chap. 5, which is rewritten here
for ease of reference:
k
θ (s) = I ∗ (s), (6.20)
s(s + a)
b nkm
a= > 0, k= > 0,
J J
where θ (s) and I ∗ (s) represent the position (output) and the commanded electric
current (input) respectively. The Bode diagrams of the following transfer function:
k
G(s) = , (6.21)
s(s + a)
are sketched in Fig. 6.55. Based on this result, the polar plot in Fig. 6.56 is obtained
when mapping the modified Nyquist path shown in Fig. 6.57. Note that G(s) has
a single pole at s = 0 and this is the reason for the semicircle with infinite radius
appearing in Fig. 6.56. This is explained as follows. The variable change s = ε φ
is first performed to rewrite (6.21) as:
k k k
G(s) = = = − φ.
ε φ(ε φ + a) ε φ(a) εa
Recalling that ε → 0 and φ passes from −90◦ to +90◦ as the contour around
s = 0 is performed (shown in Fig. 6.57), then the clockwise-oriented semicircle
with infinite radius in Fig. 6.56 is obtained. As the phase of G(j ω) asymptotically
tends toward −180◦ as ω → +∞, it is clear that the polar plot in Fig. 6.56 will
never encircle the point (−1, j 0) for any positive value of k and a. This means that
N = 0. Note that P = 0 because G(s) has no poles with a positive real part.
6.7 Analysis and Design Examples 381
ω→–∞
ω→+∞ Re (G (jω ))
ω = 0+
Suppose that a loop is closed around G(s) including a positive gain kp , to obtain
a proportional position control system. The gain kp > 0 has the following effects
on the open-loop frequency response:
• The phase for a given frequency does not change with kp .
• The magnitude increases proportionally to kp .
Thus, every point belonging to the polar plot of the open-loop transfer function
becomes farther from the origin, but keeps the same phase, as kp > 0 increases. This
means that the closed-loop system is stable for any positive kp because Z = N +
P = 0, but the polar plot in Fig. 6.56 becomes closer to the point (−1, j 0) as kp > 0
is chosen to be larger, i.e., the phase margin decreases. As a consequence, although
the time response becomes faster, it also becomes more oscillatory (as concluded in
Sect. 5.2.1). To achieve a time response that is as fast as desired and, simultaneously,
as damped as desired, a PD position controller is designed in the following. Note
382 6 Frequency Response-Based Design
ω = 0+
φ = + 90 s = εφ
ε
Re (s)
r→∞
ω = 0–
φ = – 90
–jω
that, according to (6.21), the plant system type is 1; hence, an additional integrator
is not required to achieve a zero steady-state error when the desired position is a
constant. This justifies the use of a PD controller instead of a PID controller.
Consider the DC motor model presented in (6.20) together with the following PD
controller:
de
i ∗ = kp e + kd , e = θd − θ.
dt
Use of the Laplace transform yields:
The closed-loop block diagram is shown in Fig. 6.58. The open-loop transfer
function is:
kp k
G(s)H (s) = kd s + . (6.22)
kd s(s + a)
6.7 Analysis and Design Examples 383
I ∗ (s) kp
= kd (s + b), b= , (6.23)
E(s) kd
s+b 1
= kd b = kd b s+1 .
b b
I ∗ (s)
= kd b(z + 1).
E(s)
The Bode diagrams of the factor z+1 are shown in Fig. 6.59. Note that the horizontal
axes of these Bode diagrams represent the variable b1 ω (see Example 6.2). Hence,
the open-loop transfer function, given in (6.22), can be rewritten as:
k
G(s)H (s) = kd b(z + 1) . (6.24)
s(s + a)
Bode Diagram
25
20
Magnitude (dB)
15
10
System: gc
Frequency (rad/sec): 0.882
5 Magnitude (dB): 2.5
0
90
Phase (deg)
45
System: gc
Frequency (rad/sec): 0.882
Phase (deg): 41.4
0
10−1 100 101
Frequency (rad/sec)
Fig. 6.59 Bode diagrams of the factor z + 1, where z = b1 s. The horizontal axis stands for b1 ω
384 6 Frequency Response-Based Design
Bode Diagram
20
15
10 System: gh
Frequency (rad/sec): 25.9
Magnitude (dB)
−165
Phase (deg)
−170
−175 System: gh
Frequency (rad/sec): 25.9
Phase (deg): −174
−180
101 102
Frequency (rad/sec)
Consider the DC motor experimentally studied in Chap. 11. The numerical values
of this motor are:
k = 675.4471, a = 2.8681.
k
Using these data, the Bode diagrams of the factor s(s+a) are obtained and they are
shown in Fig. 6.60. It is observed that the crossover frequency is ω1 = 25.9[rad/s]
and the phase at this frequency is −174◦ , which corresponds to a phase margin of
+6◦ . As this phase margin is small, the time response is very oscillatory when using
a proportional controller with kp = 1, as shown in Fig. 6.61. Note that the rise time
is tr = 0.0628[s] and overshoot is Mp = 83%. A PD controller is designed in
the following such that the close-loop time response has the same rise time tr =
0.0628[s], but overshoot is reduced to Mp = 20%. To maintain the same response
time, it is proposed to maintain the same crossover frequency, i.e.,:
ω1 = 25.9[rad/s]. (6.25)
θ
[rad]
t[s]
Fig. 6.61 Time response of the closed-loop system shown in Fig. 6.58, when kp = 1, kd = 0,
k = 675.4471 and a = 2.8681
Table 6.5 Relationship between the phase margin (open-loop) and the damping coefficient of a
closed-loop second-order system without zeros
Kf [◦ ] 0 11 23 33 43 52 59 65 70 74 76
ζ 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
%
&
& ln2 Mp(%)
& 100
ζ =' ,
Mp(%)
ln2 100 + π2
ζ = 0.4559 is obtained. Using linear interpolation in Table 6.5, it is found that this
damping corresponds to the phase margin:
Kf = +47.5◦ . (6.26)
As the phase margin of the uncompensated motor model is +6◦ , then the controller
is required to contribute the phase lead +47.5◦ − 6◦ = 41.5◦ . In Fig. 6.59, it is
observed that this happens when b1 ω = 0.882. Hence, the parameter b is found by
forcing this to occur when ω = ω1 = 25.9[rad/s], i.e.,:
386 6 Frequency Response-Based Design
ω
b= = 29.3984.
0.882 ω=25.9
where, according to Fig. 6.59, |z + 1|dB = 2.5[dB]. Hence, solving for kd and
performing the corresponding computations the following is found:
1 −2.5
kd = 10 20 = 0.0255.
b
Finally, using (6.23):
kp = bkd = 0.7499.
The Bode diagrams of the compensated open-loop transfer function (see (6.22)) are
shown in Fig. 6.62. It can be verified that the crossover frequency is ω = 25.9[rad/s]
and the phase at this frequency is −132◦ , which corresponds to a phase margin of
+48◦ . This means that the frequency response specifications, established in (6.25)
and (6.26), have been accomplished. On the other hand, in Fig. 6.63, the time
response of the corresponding closed-loop system is shown, when the desired
position is a unit step. It is observed that the rise time is 0.0612[s] and overshoot
is 30%. Although these values are not identical to tr = 0.0628[s] and Mp = 20%,
which were specified at the beginning, they are relatively close. This difference is
attributed to the zero present in the closed-loop transfer function (contributed by
the PD controller) as it has an important effect on the transient response, which has
not been precisely quantified. Recall that Table 6.5, which has been employed to
determine the required phase margin, is precise only for second-order closed-loop
systems with no zeros.
If it is desired to exactly satisfy the proposed time response specifications, the
reader may proceed to redesign: propose a little larger phase margin to reduce
overshoot and repeat the procedure. However, instead of this, in the following
section, it is explained how to proceed to achieve a different desired rise time.
Figures 6.59 to 6.63 were drawn using the following MATLAB code in an m-file:
gc=tf([1 1],1);
figure(1)
bode(gc,{0.1,10})
grid on
k=675.4471;
6.7 Analysis and Design Examples 387
Bode Diagram
60
50
40
Magnitude (dB)
30
20 System: ghcomp
10 Frequency (rad/sec): 25.9
Magnitude (dB): 0.0325
0
−10
−20
−90
Phase (deg)
−120
System: ghcomp
Frequency (rad/sec): 25.8
Phase (deg): −132
−150
100 101 102
Frequency (rad/sec)
Fig. 6.62 Bode diagrams of the transfer function in (6.22), when kd = 0.0255, kp = 0.7499,
k = 675.4471 and a = 2.8681
a=2.8681;
g=tf(k,[1 a 0]);
figure(2)
bode(g,{10,100})
grid on
M=feedback(g,1,-1);
figure(3)
step(M,1)
grid on
kp=0.7499;
kd=0.0255;
PD=tf([kd kp],1);
figure(4)
bode(PD*g,{1,100})
grid on
M=feedback(PD*g,1,-1);
figure(5)
step(M)
grid on
388 6 Frequency Response-Based Design
θ
[rad]
t[s]
Fig. 6.63 Time response of the closed-loop system shown in Fig. 6.58, when kd = 0.0255, kp =
0.7499, k = 675.4471 and a = 2.8681
k kp
G(s)H (s) = kd (s + b) , b= . (6.27)
s(s + a) kd
k = 675.4471, a = 2.8681,
k
and only the factor s(s+a) , the crossover frequency is ω1 = 25.9[rad/s]. Moreover,
the closed-loop rise time is tr = 0.0628[s] and overshoot is Mp = 83% when a
proportional controller with unitary gain kp = 1 is employed. In the following, a
PD controller is designed to accomplish half of the above rise time and an overshoot
of 20%, i.e.,
0.0628
tr = = 0.0314[s], Mp = 20%. (6.28)
2
6.7 Analysis and Design Examples 389
It has been already stated that reducing the rise time, i.e., rendering the time response
faster, requires the crossover frequency ω1 to be increased. However, a mathematical
expression has not yet been defined relating the rise time to the crossover frequency.
Next, it is explained how to select ω1 to obtain a particular tr .
First, consider the closed-loop system in Fig. 6.64. The open-loop transfer
function is:
kp k
G(s) = , (6.29)
s(s + a)
The Bode diagrams of (6.29) are depicted in Fig. 6.65, whereas the Bode diagrams
of (6.30) are depicted in Fig. 6.17b. According to the latter figure, the transfer
function in (6.30) has a unit magnitude when ω → 0. This can be explained from
G(s)
the expression 1+G(s) and Fig. 6.65, noting that |G(j ω)| → +∞ when ω → 0.
G(j ω)
This means that the closed-loop transfer function 1+G(j ω) → 1 when ω → 0.
On the other hand, according to Fig. 6.17b, the magnitude of the transfer function
in (6.30) tends toward zero when ω → +∞. Again, this can be explained using the
390 6 Frequency Response-Based Design
G(s)
expression and Fig. 6.65, noting that |G(j ω)| → 0 when ω → +∞. This
1+G(s)
G(j ω)
means that the closed-loop transfer function 1+G(j ω) → 0 when ω → +∞.
According to these ideas, the corner frequency that the transfer function in (6.30)
has at ω = ωn (see Fig. 6.17b) must occur approximately
at the crossover frequency
G(j ω)
in Fig. 6.65 (when |G(j ω)| = 1; hence, 1+G(j ω) = 0.5 ≈ 0.7071, which
corresponds to −3[dB]). This observation allows us to conclude that ωn in Fig. 6.17b
increases if ω1 , measured in Fig. 6.65, also increases.
On the other hand, according to:
1 1 − ζ2
tr = π − arctan , ωd = ωn 1 − ζ 2 ,
ωn 1 − ζ 2 ζ
if it is desired to reduce the rise time by half (neglecting the effect of the damping
variation) then ωn must be increased twice. This means that, according to the above
discussion, the crossover frequency ω1 must also be increased twice.
Hence, if tr = 0.0628[s] when ω1 = 25.9[rad/s], the following:
ω1 = 51.8[rad/s], (6.31)
Kf = +47.5◦ . (6.32)
k
G(s)H (s) = kd b(z + 1) ,
s(s + a)
k
where kd b(z+1) = kd s +kp , with b = kpd and z = b1 s, represents the PD controller.
The Bode diagrams of the factor z + 1 are shown in Fig. 6.67. Recall that the
horizontal axis in these diagrams corresponds to b1 ω (see Example 6.2). The required
phase lead +44.5◦ appears when b1 ω = 0.982. As this phase lead must occur when
the frequency is equal to the desired crossover frequency ω = 51.8[rad/s], then:
ω
b= = 52.8033.
0.982 ω=51.8
6.7 Analysis and Design Examples 391
Bode Diagram
60
50
40
Magnitude (dB)
30
20
10 System: gh
Frequency (rad/sec): 51.8
0
Magnitude (dB): −12
−10
−20
−30
−40
−90
Phase (deg)
−120
−150
System: gh
Frequency (rad/sec): 51.7
Phase (deg): −177
−180
100 101 102
Frequency (rad/sec)
where, according to Fig. 6.67, |z + 1|dB = 2.95[dB] must be used. Thus, solving for
kd and performing the corresponding computations, it is found that:
1 12−2.95
kd = 10 20 = 0.0537.
b
kp
Finally, the use of b = kd yields:
kp = bkd = 2.8347.
392 6 Frequency Response-Based Design
Bode Diagram
25
20
Magnitude (dB)
15
10
System: gc
Frequency (rad/sec): 0.983
5 Magnitude (dB): 2.95
0
90
Phase (deg)
45
System: gc
Frequency (rad/sec): 0.982
Phase (deg): 44.5
0
10−1 100 101
Frequency (rad/sec)
Fig. 6.67 Bode diagrams of the factor z + 1. The horizontal axis represents b1 ω
The Bode diagrams of the open-loop transfer function of the compensated system
shown in (6.27) are presented in Fig. 6.68. There, it can be verified that the crossover
frequency is ω = 51.8[rad/s] and the phase at this frequency is −132◦ , which
corresponds to a phase margin of +48◦ . This means that the desired frequency
response characteristics established in (6.31), (6.32), have been accomplished. On
the other hand, the time response of the corresponding closed-loop system is shown
in Fig. 6.69 when the reference of the position is a unit step. It can be observed that
the rise time is 0.03[s] and overshoot is 31%. Although these values are not exactly
equal to tr = 0.0314[s] and Mp = 20%, they are considered to be close enough. The
reason for the difference in overshoot and the way of reducing it has been already
explained in Sect. 6.7.1.
Figures 6.66 to 6.69 were drawn using the following MATLAB code executed in
an m-file:
k=675.4471;
a=2.8681;
g=tf(k,[1 a 0]);
figure(1)
bode(g,{1,100})
6.7 Analysis and Design Examples 393
Bode Diagram
30
25
20
Magnitude (dB)
15
10
System: ghcomp
5 Frequency (rad/sec): 51.9
Magnitude (dB): −0.0529
0
−5
−10
−90
Phase (deg)
−120
System: ghcomp
Frequency (rad/sec): 51.8
−150 Phase (deg): −132
−180
101 102
Frequency (rad/sec)
Fig. 6.68 Bode diagrams of the transfer function in (6.27), when kd = 0.0537, kp = 2.8347,
k = 675.4471 and a = 2.8681
grid on
gc=tf([1 1],1);
figure(2)
bode(gc,{0.1,10})
grid on
kp=2.8347;
kd=0.0537;
PD=tf([kd kp],1);
figure(3)
bode(PD*g,{10,100})
grid on
M=feedback(PD*g,1,-1);
figure(4)
step(M)
grid on
394 6 Frequency Response-Based Design
θ
[rad]
t[s]
Fig. 6.69 Time response of the closed-loop system in Fig. 6.58, when kd = 0.0537, kp = 2.8347,
k = 675.4471 and a = 2.8681
Consider the DC motor model presented in (5.12), Chap. 5, which is rewritten here
for ease of reference:
k
θ (s) = I ∗ (s), (6.33)
s(s + a)
b nkm
a= > 0, k= > 0,
J J
where θ (s) and I ∗ (s) stand for the position (output) and the commanded electric
current (input) respectively. In this section, the following PID position controller is
designed:
t
de
i ∗ = kp e + kd + ki e(r)dr, e = θd − θ,
dt 0
where θd is the desired position and the constants kp , kd , and ki are known as
the proportional, derivative, and integral gains, respectively. Use of the Laplace
transform yields:
6.7 Analysis and Design Examples 395
θd(s) + kp k
s2+ k s+ k i
d d
k θ(s)
kd s(s+a)
s
–
E(s)
I ∗ (s) = kp E(s) + kd sE(s) + ki ,
s
ki
= kp + kd s + E(s),
s
kp ki
s2 + kd s + kd
= kd E(s).
s
Then, the closed-loop system is represented by the block diagram in Fig. 6.70. The
open-loop transfer function is:
kp ki
s2 + kd s + kd k
G(s)H (s) = kd . (6.34)
s s(s + a)
Note that the system type is 2; hence, a zero steady-state error is ensured if the
desired position is either a step or a ramp. Moreover, as explained in Sects. 5.2.5
and 5.3, if the desired position is a step and a constant external torque disturbance
appears, a zero steady-state error is still ensured. These are the reasons for designing
a PID position controller for a DC motor.
Defining:
kp ki
s2 + s+ = (s + z1 )(s + z2 ) = s 2 + (z1 + z2 )s + z1 z2 ,
kd kd
it is concluded that:
kp ki
= z1 + z2 , = z1 z 2 . (6.35)
kd kd
In Fig. 6.71, the polar plot of (6.34) is sketched, when mapping the modified Nyquist
path shown in Fig. 6.57. Note that there are two poles at s = 0; hence, a contour
must be described around the origin of the plane s, as explained in Sect. 6.7.1. This
is the reason for the circumference with the infinite radius in Fig. 6.71. Furthermore,
it is not difficult to realize that, for 0 < ω < +∞, the polar plot of the factor s 2 (s+a)
k
◦
is similar to that shown in Fig. 6.56, but rotated 90 clockwise (counterclockwise
396 6 Frequency Response-Based Design
Im (G (jω ) H (jω ) )
–
+ 180° ω = 0 ω→+∞
–180° ω=0 + –1 ω→–∞ Re (G (jω ) H (jω ) )
r→∞
Fig. 6.71 Polar plot of (6.34) when mapping the modified Nyquist path shown in Fig. 6.57
for −∞ < ω < 0). Hence, the phase lead contributed by the second-order factor
k
s 2 + kpd s + kkdi must modify the polar plot as in Fig. 6.71. This achieves closed-loop
stability because P = 0, N = 0, and Z = N + P = 0.
Recall that the design based on frequency response relies on satisfying two
conditions: the desired crossover frequency and the desired phase margin. As has
been seen in the previous sections, these conditions are satisfied by suitably selecting
two controller parameters. In the present problem, a PID controller must be designed
that possesses three parameters or gains. Hence, the problem can be solved by
proposing an arbitrary value for one of these gains, whereas the other two must
be found by satisfying the crossover frequency condition and the phase margin
condition. Thus, the following design criterion is proposed:
z1 = a, (6.36)
because this simplifies the open-loop transfer function shown in Fig. 6.34 as follows:
k
G(s)H (s) = kd (s + z2 ) . (6.37)
s2
It must be stressed that the cancellation of factors s + z1 and s + a is valid because
both of them represent poles and zeros with a negative real part because a > 0 and
z1 > 0. Performing some additional algebra in (6.37) the following is found:
s + z2 k 1 k k
G(s)H (s) = kd z2 =kd z2 s + 1 2 =kd z2 (z + 1) 2 , (6.38)
z2 s 2 z2 s s
6.7 Analysis and Design Examples 397
Bode Diagram
60
50
40
Magnitude (dB)
30
20
10 System: gh
Frequency (rad/sec): 51.9
0
Magnitude (dB): −12
−10
−20
−30
−40
−179
−179.5
Phase (deg)
−180 System: gh
Frequency (rad/sec): 51.7
Phase (deg): −180
−180.5
−181
100 101 102
Frequency (rad/sec)
where z = z12 s has been defined. The factor sk2 now represents the uncompensated
plant whose Bode diagrams are shown in Fig. 6.72 when employing the numerical
values of the DC motor experimentally controlled in Chap. 11, i.e.,:
k = 675.4471.
It is observed that the magnitude and the phase are −12[dB] and −180◦
respectively when the frequency is 51.8[rad/s]. According to Sect. 6.7.2, use of the
following crossover frequency is proposed:
ω1 = 51.8[rad/s], (6.39)
Kf = +47.5◦ , (6.40)
to achieve a rise time tr = 0.0314[s] and an overshoot 20%. Hence, the controller
defined by kd z2 (z + 1) must contribute a +47.5◦ phase lead and +12[dB] as
magnitude when the frequency is 51.8[rad/s]. It is observed in Fig. 6.73 that the
398 6 Frequency Response-Based Design
Bode Diagram
25
20
Magnitude (dB)
15
10
System: gc
Frequency (rad/sec): 1.09
5 Magnitude (dB): 3.4
0
90
Phase (deg)
45 System: gc
Frequency (rad/sec): 1.09
Phase (deg): 47.4
0
10−1 100 101
Frequency (rad/sec)
Fig. 6.73 Bode diagrams of the factor z + 1. The horizontal axis represents 1
z2 ω
factor z + 1 contributes a +47.4◦ phase when z12 ω = 1.09 (see Example 6.2). As
this must occur when ω = 51.8[rad/s], then:
ω
z2 = = 47.5229.
1.09 ω=51.8
where, according to Fig. 6.73, |z + 1|dB = 3.4[dB] must be used. Hence, solving for
kd and performing the corresponding computations the following is found:
1 12−3.4
kd = 10 20 = 0.0566.
z2
Finally, use of (6.35), (6.36) and a = 2.8681 (see Chap. 11) yields:
6.7 Analysis and Design Examples 399
Bode Diagram
30
25
20
Magnitude (dB)
15
10
System: ghcomp
5 Frequency (rad/sec): 51.8
Magnitude (dB): 0.0218
0
−5
−10
−90
Phase (deg)
−120
System: ghcomp
Frequency (rad/sec): 51.7
−150 Phase (deg): −133
−180
101 102
Frequency (rad/sec)
Fig. 6.74 Bode diagrams of the transfer function in (6.34), when kd = 0.0566, kp = 2.8540,
ki = 7.7196 k = 675.4471 and a = 2.8681
The Bode diagrams of the compensated system open-loop transfer function shown
in (6.34) are presented in Fig. 6.74. Here, it can be verified that the crossover
frequency is ω = 51.8[rad/s] and the phase at this frequency is −133◦ , which
corresponds to a phase margin of +47◦ . This means that the frequency response
specifications established in (6.39) and (6.40) are satisfied. On the other hand, in
Fig. 6.75 the corresponding closed-loop time response is shown when the reference
of the position is a unit step. There, a rise time of 0.0291[s] and an overshoot of
33% are measured. Although these values are not identical to tr = 0.0314[s] and
Mp = 20%, they are close enough. The reason for the difference between the
desired overshoot and the achieved overshoot in addition to the way in which to
improve it have been explained in Sect. 6.7.1.
Figures 6.72 to 6.75 were drawn executing the following MATLAB code in an
m-file:
k=675.4471;
a=2.8681;
z1=a;
400 6 Frequency Response-Based Design
θ
[rad]
t[s]
Fig. 6.75 Time response of the closed-loop system shown in Fig. 6.70, when kd = 0.0566, kp =
2.8540, ki = 7.7196 k = 675.4471 and a = 2.8681
g=tf(k,[1 0 0]);
figure(1)
bode(g,{1,100})
grid on
gc=tf([1 1],1);
figure(2)
bode(gc,{0.1,10})
grid on
kp=2.854;
ki=7.7196;
kd=0.0566;
PID=tf([kd kp ki],[1 0]);
g=tf(k,[1 a 0]);
figure(3)
bode(PID*g,{10,100})
grid on
M=feedback(PID*g,1,-1);
figure(4)
step(M)
grid on
6.7 Analysis and Design Examples 401
Consider the PI velocity control closed-loop system shown in (3.136), Sect. 3.8.4:
b n2 km ke n km kp n k m ki n km kp n km ki 1
ω̈+ + + ω̇+ ω= ω̇d + ωd − Ṫp .
J JR JR JR JR JR J
(6.41)
Define:
b n2 km ke n km
α= + , β= .
J JR JR
Hence, (6.41) can be written as:
1
ω̈ + (α + βkp ) ω̇ + βki ω = βkp ω̇d + βki ωd − Ṫp .
J
Suppose that ωd and Tp are no longer step signals, but they are more elaborate
functions of time. Adding and subtracting some terms in the previous expression,
the following is found:
d2 d 1
2
(ω − ωd ) + (α + βkp ) (ω − ωd ) + βki (ω − ωd ) = −ω̈d − α ω̇d − Ṫp .
dt dt J
Defining the tracking error as e = ω − ωd yields:
1
ë + (α + βkp ) ė + βki e = −ω̈d − α ω̇d − Ṫp .
J
Using the Laplace transform, assuming all the initial conditions to be zero, and using
superposition, the following is found:
Note that G1 (s) and G2 (s) are stable transfer functions if α + βkp > 0 and
βki > 0. The magnitude Bode diagram of G1 (s) is depicted in Fig. 6.76. Note
that lims→∞ G1 (s) = 1; hence, the high-frequency magnitude of this Bode plot is
0[dB]. On the other hand, G1 (s) has a zero at s = 0, thus, a +20[dB/dec] slope is
observed as ω → 0. This slope increases to +40[dB/dec] when the zero at s = −α
402 6 Frequency Response-Based Design
+ 40dB=dec
α
20 log βki
+ 20dB=dec
√
appears. As a complex conjugate pole pair appears at ω = βki , contributing with
an additional slope of −40[dB/dec], any increment
√ of the magnitude Bode plot is
canceled out, remaining constant for ω ≥ βki . Finally, by writing:
− J1 s 1 βki
G2 (s) = =− s 2 .
s + (α + βkp )s + βki
2 Jβki s + (α + βkp )s + βki
6.7 Analysis and Design Examples 403
– 20dB=dec
1
20 log Jβk
i + 20dB=dec
Xd(s) k ρ X(s)
Ax γ
+ s ( s+a ) s2
–
1
Note that, because of the factor Jβk i
, attenuation for all frequencies is achieved as
ki is chosen to be large. However, kp must also be large as ki is large to avoid a large
resonant peak. Thus, the effect of fast-changing external torque disturbances can be
attenuated by using large values for both kp and ki .
Consider the block diagram in Fig. 6.78, where Ax , a, ρ, γ , and k are positive
constants. The open-loop transfer function is given as:
ρAx γ k a 1
G(s)H (s) = . (6.44)
a s + a s3
404 6 Frequency Response-Based Design
jω
ω = 0+
φ = + 90 s = εφ
ε
Re (s)
r→∞
ω = 0–
φ = – 90
–jω
Im (G (jω ) H (jω ) )
+270°
ω = 0+
r→∞
ω→+∞
–270°
ω = 0–
Fig. 6.80 Polar plot of G(s)H (s) in (6.44) along the modified Nyquist path shown in Fig. 6.79
This open-loop transfer function has three poles at the origin, i.e., on the
imaginary axis of the complex plane s. Hence, the modified Nyquist path shown
in Fig. 6.79 must be used. The polar plot of G(s)H (s), given in (6.44), obtained
along the modified Nyquist trajectory is shown in Fig. 6.80. This is explained as
follows.
6.7 Analysis and Design Examples 405
The polar plot of (6.44) is depicted in Fig. 6.29. To take into account the contour
around s = 0, included in the modified Nyquist path, proceed as follows. First,
perform the variable change s = ε φ in the transfer function in (6.44) to obtain:
ρAx γ k 1
G(s)H (s) = − 3φ.
ε φ + a ε3
ρAx γ k
G(s)H (s) = − 3φ = β1 − 3φ,
aε3
This explains the two circles with infinite radius appearing in Fig. 6.80, which,
according to (6.45), are clockwise-oriented as ω passes from ω = 0− to ω = 0+ .
Note that P = 0 because G(s)H (s), given in (6.44), has no zeros with a positive
real part, and N = 2 because the polar plot in Fig. 6.80 encircles the point (−1, j 0)
twice clockwise each time that the modified Nyquist path is completed once in the
indicated orientation. Hence, the application of the Nyquist stability criterion yields
Z = N + P = 2, which indicates that there are two closed-loop poles on the right
half-plane and, thus, the closed-loop system in Fig. 6.78 is unstable. Moreover, as
the circumferences in Fig. 6.80 have infinite radius, this result does not change if the
following gain is chosen to be small:
ρAx γ k
, (6.46)
a
selecting, for instance, γ to be small. This is because β1 tends toward infinity for
any finite value in (6.46) as ε → 0; hence, P = 0, N = 2, and Z = 2 still stand.
Now consider the block diagram in Fig. 6.81, where δ and c are positive
constants. This block diagram is motivated by the intention to achieve closed-loop
stability using a PD controller with the transfer function (γ s+γ δ). However, instead
Xd(s) X(s)
k ρ
Ax γ s+δ
+ s+c s ( s+a ) s2
–
Im (G (jω ) H (jω ) )
–270°
ω = 0+
–1 ω→+∞
+270°
ω = 0–
Fig. 6.82 Polar plot of G(s)H (s) in (6.47) obtained along the modified Nyquist path shown in
Fig. 6.79
of a PD controller a phase lead compensator with a transfer function γ s+δ s+c , where
δ < c, is proposed, as this class of controller attenuates the noise amplified by a PD
controller. The open-loop transfer function is given in this case as:
ρAx γ δk s + δ c a 1
G(s)H (s) = . (6.47)
ac δ s + c s + a s3
This open-loop transfer function also has three poles at the origin, i.e., on the
imaginary axis of the complex plane s; hence, the modified Nyquist path shown in
Fig. 6.79 must be considered. The polar plot of G(s)H (s), given in (6.47), obtained
along the modified Nyquist path is shown in Fig. 6.82. This is explained as follows.
The polar plot of (6.47) is depicted in Fig. 6.32. To take into account the contour
around s = 0 included in the modified Nyquist path, proceed as follows. First,
perform the variable change s = ε φ in the transfer function (6.47) to obtain:
ε φ + δ 1
G(s)H (s) = ρAx γ k − 3φ.
(ε φ + c)(ε φ + a) ε3
ρAx γ kδ
G(s)H (s) = − 3φ = β2 − 3φ,
acε3
6.7 Analysis and Design Examples 407
where β2 = ρAacεx γ kδ
3 → +∞ is a very large constant because ε → 0. On the other
hand, φ varies from −90◦ (when ω = 0− ) to +90◦ (when ω = 0+ ). Then:
β2 + 270◦ , when ω = 0−
G(s)H (s) = β2 − 3φ = . (6.48)
β2 − 270◦ , when ω = 0+
This explains the presence of the circles with infinite radius in Fig. 6.82, which,
according to (6.48), are clockwise-oriented as ω passes from ω = 0− to ω = 0+ .
Note that, again, P = 0, N = 2 and Z = N + P = 2. Hence, there are two
closed-loop poles with a positive real part and the closed-loop system is unstable.
Furthermore, recalling the reasoning in the previous example, it is concluded that
the instability cannot be eliminated by using small values for the constant:
ρAx γ kδ
. (6.49)
ac
Hence, the use of a phase lead compensator is not enough to achieve closed-
loop stability. Careful reasoning must be performed. Recall that, in Sect. 6.5, it was
shown that the introduction of an open-loop pole (with a negative real part) results
in a closed-loop system that approaches =instability. Moreover, this effect increases
as that pole is placed closer to the origin. Now, observe that the transfer functions
in (6.44) and (6.47) have three poles at the origin. Thus, it is reasonable to wonder
whether the instability problems that we have found are due to the fact that the
open-loop transfer function has too many poles at the origin.
Consider the block diagram in Fig. 6.83, where α, Aθ , kv , b and c are positive
k
constants. The internal loops around the transfer function s(s+a) are intended to
move one of poles at the origin to the left. Also note that the lead compensator is
given as:
s+b
Gc (s) = γ , 0 < b < c. (6.50)
s+c
The transfer function between points 1 and 2 in Fig. 6.83 is given as:
Xd(s) + + ρ X(s)
γ s+b k
Ax α
s+c s(s+a) s2
+
– – –
kvs Aθ
Aθ
Im (G (jω ) H (jω ) )
ω = 0–
+180° ω→+∞
–180° + –1 ω→–∞ Re (G (jω ) H (jω ) )
ω=0
r→∞
Fig. 6.84 Polar plot of G(s)H (s) in (6.51) obtained on the modified Nyquist path shown in
Fig. 6.79
αk
Gm (s) = .
s2 + (a + kv kAθ )s + αkAθ
Ax ρ γ b s + b c αkAθ 1
G(s)H (s) = . (6.51)
cAθ b s + c s + (a + kv kAθ )s + αkAθ s 2
2
Note that this open-loop transfer function has two poles at the origin, i.e., on the
imaginary axis of the complex plane s; hence, the modified Nyquist path shown
in Fig. 6.79 must be considered. In Fig. 6.84 the polar plot of G(s)H (s) is shown,
given in (6.51), obtained on the modified Nyquist path. This is explained as follows.
The polar plot of (6.51) is shown in Fig. 6.34. To take into account the contour
around s = 0 included in the modified Nyquist path, proceed as follows. First,
perform the variable change s = ε φ in the transfer function (6.51) to obtain:
ε φ + b αk 1
G(s)H (s) = Ax ρ γ − 2φ.
ε φ + c ε2 2φ + (a + kv kAθ )ε φ + αkAθ ε2
Ax ρ γ b
G(s)H (s) = − 2φ,
cAθ ε2
where β3 = AcAx ρ γ b
2 → +∞ is a very large constant because ε → 0. On the other
θε
hand, φ varies from −90◦ (when ω = 0− ) to +90◦ (when ω = 0+ ). Then:
6.7 Analysis and Design Examples 409
β3 + 180◦ , when ω = 0−
G(s)H (s) = β3 − 2φ = . (6.52)
β3 − 180◦ , when ω = 0+
This explains the presence of the circumference with an infinite radius in Fig. 6.84,
which, according to (6.52), is clockwise-oriented as ω passes from ω = 0− to ω =
0+ . Note that, now, P = 0, N = 0 and Z = N + P = 0. Thus, there is no
closed-loop pole with a positive real part and the closed-loop system is stable.
Finally, note that the system type is 2, which ensures a zero steady-state error if
either a step or a ramp reference is employed and any external disturbance is not
assumed to appear. This explains why a controller with integral action, i.e., neither
a PI nor a PID controller, is not considered at this point. See Sect. 14.5, Chap. 14,
for a case where a PI controller is included in a ball and beam control system.
The constants α and kv are gains of the controller to be designed; hence, a criterion is
required to select them. However, this criterion depends on some constraints present
in practice, i.e., it is defined on the basis of the actual experimental prototype to be
controlled. In Chap. 14, this criterion is defined and it is explained how the above
values for α and kv have been selected. The Bode diagrams of the following transfer
function are shown in Fig. 6.85:
Ax ρ αkAθ 1
, (6.54)
Aθ s + (a + kv kAθ )s + αkAθ s 2
2
which have been obtained using the values in (6.53). The phase is about −182◦
when the magnitude is 0[dB] (when ω ≈ 2.1[rad/s]). This means that the phase
margin is negative; hence, the closed-loop system obtained with (6.54) as the open-
loop transfer function would be unstable. To stabilize the closed-loop system, the
compensator shown in (6.50) is included, i.e., the open-loop transfer function of the
compensated system is that presented in (6.51).
The compensator in (6.50) is designed by requiring Mp (%) = 20%. Then, using:
%
&
& ln2
Mp (%)
& 100
ζ =' ,
Mp (%)
ln2 100 + π2
410 6 Frequency Response-Based Design
Bode Diagram
30
20
System: gh
Magnitude (dB)
−10
−20
−30
−180
−182 System: gh
Frequency (rad/sec): 1.71
−184
Phase (deg)
ζ = 0.4559 is found. Using Table 6.5 and linear interpolation, it is found that the
following phase margin is required:
Kf = +47.5◦ .
3 The frequency where the compensated open-loop system must have a magnitude of 0[dB].
6.7 Analysis and Design Examples 411
Bode Diagram
0
−2
−4
System: gc
Magnitude (dB)
−10
−12
−14
−16
−18
−20
60
System: gc
Phase (deg)
0
10−2 10−1 100 101 102 103
Frequency (rad/sec)
Ts +1
Gd (T s) = , ξ = 0.14. (6.55)
Ts + 1
ξ
ξ = 0.14 is chosen because it is observed in Fig. 6.86 that this value forces the
compensator in (6.55) to produce a maximal phase lead of 49◦ ≈ 48.5◦ . This occurs
when ωT = 2.67, which also contributes a magnitude of −8.55[dB]. The value for
T is computed as:
2.67 2.67
T = = = 1.5614,
ω1 1.71
s + 0.6404
Gd (s) = .
s + 4.5746
if b = 0.6404 and c = 4.5746 are selected. The compensator Gc (s) must contribute
a magnitude of −4.2[dB] when ω = 1.71[rad/s]. According to (6.56), this number
is given as the sum, in decibels, of the magnitude of the transfer function Gd (s) at
ω = 1.71[rad/s], i.e., −8.55[dB], and the gain γ in decibels:
Solving for γ :
8.55−4.2
γ = 10 20 = 1.6406.
s + 0.6404
Gc (s) = 1.6406 . (6.57)
s + 4.5746
The Bode plots of the compensated system (6.51) using the controller (6.57) are
presented in Fig. 6.87. Note that the crossover frequency is about ω = 1.71[rad/s]
and the phase margin is about 47.5◦ , which corroborates that the design specifica-
Bode Diagram
100
50 System: ghctrl
Frequency (rad/sec): 1.71
Magnitude (dB): −0.0219
Magnitude (dB)
−50
−100
−150
−200
−90
System: ghctrl
Phase (deg)
−270
−360
10−2 10−1 100 101 102 103
Frequency (rad/sec)
Fig. 6.87 Bode diagrams of the compensated ball and beam system
6.7 Analysis and Design Examples 413
Step Response
1.4
System: M
1.2 Time (sec): 1.72
Amplitude: 1.3
1
System: M
Time (sec): 0.927
Amplitude: 1
Amplitude
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6
Time (sec)
Fig. 6.88 Time response x(t) of system in Fig. 6.83 when xd = 1[m]
tions are satisfied. In Fig. 6.88 the time response of the closed-loop system shown
in Fig. 6.83 is presented when a step reference is applied and (6.57), (6.53), are
employed. Note that the overshoot is Mp (%) = 30% instead of the desired value of
20%.
Recall that Table 6.5 has been employed to find the required phase margin to
achieve a 20% overshoot and that this table is exact only for second-order closed-
loop systems without zeros. Note that the closed-loop system that has been designed,
see Fig. 6.83, is fifth order with a zero. This explains the difference between the
desired 20% overshoot and the achieved 30% overshoot. On the other hand, the rise
time is tr = 0.927[s]. Also note that the system reaches a steady state in about 5[s],
which is a good time for the ball and beam system that we present in Chap. 14.
Figures 6.85 to 6.88 are drawn using the following MATLAB code in an m-file:
k=10.7219;
a=0.98;
Ao=1;
Ax=1;
rho=4.7;
alpha=30;
kv=0.35;
g=tf(Ax*alpha*rho*k,[1 a+kv*k*Ao alpha*k*Ao 0 0]);
figure(1)
bode(g,{0.5,10})
grid on
xi=0.14;
414 6 Frequency Response-Based Design
116137 k
G(s)H (s) = , (6.58)
s3 + 72.54s 2 − 1250s − 9.363 × 104
116137 k
= ,
(s − 35.7377)(s + 36.5040)(s + 71.7721)
116137 k 35.7377 36.5040 71.7721
= .
(35.7377)(36.5040)(71.7721) (s − 35.7377) (s + 36.5040) (s + 71.7721)
For this example, it is important to find the frequency response characteristics of the
following transfer function:
a
G1 (s) = , a > 0.
s−a
a −ω
= √ arctan ,
ω2 + a 2 −a
a −ω
|G1 (j ω)| = √ , G1 (j ω) = arctan .
ω2 + a 2 −a
Thus:
The Bode diagrams in Fig. 6.89 are obtained using this information and the results
in Sect. 6.3. The polar plot in Fig. 6.90 is obtained using these Bode diagrams. It is
stressed that it is also correct to say that:
Im (G (j!) H (j!) )
!=0 !→+∞
–1 !→–∞ 0 Re (G (j!) H (j!) )
As a consequence, in this case, the phase Bode diagram shifts upward 360◦ with
respect to the phase Bode diagram shown in Fig. 6.89. However, the reader can
verify that the polar plot in both cases is identical to that shown in Fig. 6.90. Thus,
the analysis presented in the following to study the effect of a compensator is valid
for both cases. The Bode diagrams in Fig. 6.89 and the polar plot in Fig. 6.90 can
also be drawn using MATLAB, as shown in Figs. 6.91 and 6.92. Note that the phase
lead due to the pole at s = 35.73, which is shown in Fig. 6.89, cannot be appreciated
in Fig. 6.91 owing to the presence of the pole at s = −36.50.
From Figs. 6.90 and 6.92, note that the distance from any point on the polar
plot to the origin is larger as k is larger. Hence, for small k, N = 0, and for large
k, N = 1. The number of open-loop poles with a positive real part is P = 1.
Then, according to the Nyquist criterion the number of unstable closed-loop poles
is Z = P +N > 0. This means that the closed-loop system is unstable for any k > 0.
In the following, it is shown that this problem can be solved if a suitable phase lead
is included, i.e., if one zero is included in the open-loop transfer function.
Consider the following open-loop transfer function:
116137(s + b)
G(s)H (s) = k 3 , (6.59)
s + 72.54s 2 − 1250s − 9.363 × 104
116137(s + b)
=k ,
(s − 35.7377)(s + 36.5040)(s + 71.7721)
116137 k b 35.7377 36.5040 71.7721 s + b
= ,
(35.7377)(36.5040)(71.7721) (s − 35.7377) (s + 36.5040) (s + 71.7721) b
where b is some positive constant. If b < 35.7377 is chosen, then the Bode diagrams
in Fig. 6.93 are obtained in addition to the polar plot in Fig. 6.94. This means that,
6.7 Analysis and Design Examples 417
116137
Fig. 6.91 Bode diagrams of s 3 +72.54s 2 −1250s−9.363×104
116137
.
s 3 + 72.54s 2 − 1250s − 9.363 × 104
Note that the phase margin4 being negative; hence, the closed-loop system is
unstable. As explained above, closed-loop stability can be achieved if sufficient
phase lead is produced by including the factor:
4 According to Sect. 6.5, the phase margin and the gain margin are defined for minimum phase
systems and, although the system studied here is non-minimum phase, (because of the unstable
pole at s = 35.7377), the term phase margin is used to indicate the comparison of the system
phase with respect to the fundamental phase −180◦ .
418 6 Frequency Response-Based Design
Nyquist Diagram
0.4
0.3
0.2
Imaginary Axis
0.1
−0.1
−0.2
−0.3
−0.4
−1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0
Real Axis
Fig. 6.92 Polar plot drawn with MATLAB for G(s)H (s) in (6.58)
Also, the closed-loop time response can be rendered faster if a large enough
crossover frequency is accomplished. These features can be achieved if k and b
are suitably selected. Using b =31.2463 and k =0.0396 computed in Sect. 5.2.6,
the following is obtained. For ω =38.5[rad/s], the magnitude and the phase are
−5.85[dB] and −208◦ respectively in Fig. 6.91. It is shown in Fig. 6.95 that, at the
same frequency, the magnitude and the phase are 5.87[dB] and 50.9◦ for the factor
in (6.60). It is shown in Fig. 6.96 that this allows the transfer function G(s)H (s)
6.7 Analysis and Design Examples 419
Im (G (jω ) H (jω ) )
ω=0 ω→–∞
–1 0 ω→+∞
Re (G (jω ) H (jω ) )
without zeros this would correspond to a closed-loop damping factor of 0.2, i.e., a
large overshoot should appear. However, in Fig. 6.98 the closed-loop time response
is shown when G(s)H (s) in (6.59) with b =31.2463, k =0.0396, is placed in the
direct path, unit-negative feedback is used and the reference is a unit step. Note
that only a small overshoot is observed. This can be explained by recalling that
G(s)H (s) has no pole at s = 0 in this case. Hence, attention must be paid to these
cases. Moreover, in Fig. 6.99, the Bode diagrams of the corresponding closed-loop
transfer function are shown. It is observed that no resonant peak is observed; hence,
it is concluded that only a small overshoot might appear, as verified in Fig. 6.98.
Finally, the steady-state error is computed as ess = 1+k A
p
, where A = 1 and
kp = G(j ω)H (j ω)|ω=0 ≈ −1.5171, because |G(j ω)H (j ω)|ω=0 ≈ 3.62[dB],
and G(j ω)H (j ω)|ω=0 = −180◦ , as observed in Fig. 6.96. Thus, ess = −1.934,
which explains the final response of ≈ 2.87 in Fig. 6.98. A steady-state error that is
different from zero is the reason why a zero reference was used in Sect. 5.2.6.
All of the figures in this example that have been drawn using MATLAB were
executed using the following code in an m-file:
6.7 Analysis and Design Examples 421
Nyquist Diagram
0.5
0.4
0.3
0.2
Imaginary Axis
0.1
−0.1
−0.2
−0.3
−0.4
−0.5
−1.6 −1.4 −1.2 −1 −0.8 −0.6 −0.4 −0.2 0
Real Axis
Fig. 6.97 Polar plot of G(s)H (s) in (6.59) when b =31.2463, k =0.0396
Step Response
3
2.5
2
Amplitude
1.5
0.5
0
0 0.05 0.1 0.15 0.2 0.25
Time (sec)
Fig. 6.98 Closed-loop time response when the reference is an unit step
Bode Diagram
10
0
Magnitude (dB)
−10
−20
−30
−40
−50
0
−45
Phase (deg)
−90
−135
−180
100 101 102 103
Frequency (rad/sec)
bode(gh)
grid on
gc=tf(0.0396*[1 31.2463],1);
figure(3)
bode(gc)
grid on
figure(4)
bode(gh*gc)
grid on
figure(5)
nyquist(gh*gc)
M=feedback(gc*gh,1,-1)
figure(6)
step(M)
grid on
figure(7)
bode(M)
grid on
6.8 Case Study 423
11613700
G(s) = .
s 3 + 2739s 2 − 1250s − 3.536 × 106
(s + z1 )(s + z2 ) k
G(s)H (s) = kd ,
s s 3 + 2739s 2 − 1250s − 3.536 × 106
(s + z1 )(s + z2 ) k
= kd , (6.62)
s (s + 35.9)(s − 35.9)(s + 2739)
k = 11613700.
A PID controller must be designed such that the closed-loop system is stable. As
explained in Sect. 6.7.3, we can propose the following:
z1 = 35.9, (6.63)
and proceed to compute the two remaining PID controller gains such that the
crossover frequency and the phase margin conditions are satisfied. Thus, the open-
loop transfer function simplifies to:
k
G(s)H (s) = kd (s + z2 ) ,
s(s − 35.9)(s + 2739)
or:
k
G(s)H (s) = kd z2 (z + 1) , (6.64)
s(s − 35.9)(s + 2739)
424 6 Frequency Response-Based Design
where z = z12 s has been defined. It is important to stress that the cancellation of the
terms s + z1 and s + 35.9 is valid because these terms represent poles and zeros with
a negative real part as 35.9 > 0 and z1 > 0. In Fig. 6.100, the Bode diagrams of the
transfer function:
k
G0 (s) = , (6.65)
s(s − 35.9)(s + 2739)
are depicted. There, the results in Sect. 6.7.6 are employed to obtain the Bode
a
diagrams of a nonminimum phase factor of the form s−a with a > 0. Using
Fig. 6.100, the polar plot in Fig. 6.101 is obtained. It is important to stress that the
transfer function in (6.65) has one pole at the origin; hence, the modified Nyquist
path shown in Fig. 6.57 must be employed. According to this, a contour around
s = 0 must be performed as follows. The variable change s = ε φ must be used
in (6.65):
k k
G0 (ε φ) = = ,
ε φ(ε φ − 35.9)(ε φ + 2739)
ε φ(−35.9)(2739)
k k (−φ − 180◦ ),
= −φ =
ε(−35.9)(2739) ε(35.9)(2739)
[°]
6.8 Case Study 425
Im ( G 0 (jω ))
ω = 0+ –270o
–1 ω→+∞
ω→–∞
Re ( G 0 (jω ))
r→∞
–90o
ω = 0–
Fig. 6.101 Polar plot of (6.65) when mapping the modified Nyquist path shown in Fig. 6.57
recalling that ε → 0. This explains the infinite radius circumference passing from
−90◦ , when ω = 0− , to −270◦ , when ω = 0+ (see Fig. 6.57). It is clear in Fig. 6.101
that N = 1 and, as P = 1 (see (6.65)), then Z = N + P = 2, and the closed-loop
system would be unstable. Because of this, to achieve closed-loop stability using
the open-loop transfer function (6.64) (with a PID controller), the factor kd z2 (z +
1) must contribute enough phase lead to obtain a polar plot such as that shown
in Fig. 6.102. In such a case N = −1 and P = 1, i.e., Z = N + P = 0 and
the closed-loop system would be stable. The Bode diagrams of (6.65) are shown
in Fig. 6.103. The magnitude and the phase are observed to be 0[dB] and −212◦
respectively, when the frequency is 60[rad/s]. It is proposed to maintain the same
crossover frequency:
ω1 = 60[rad/s], (6.66)
Kf = +20◦ . (6.67)
As the plant to control is naturally unstable, the main objective is to ensure closed-
loop stability without defining any other specification, such as rise time or overshoot.
5 Although the phase margin was introduced in Sect. 6.5 for minimum phase systems, this concept
is also applicable in this example
426 6 Frequency Response-Based Design
–1 !→–∞
!→+∞
Re(G(j!)H(j!))
r→∞
! = 0– –90o
Bode Diagram
50
0
System: gh
Magnitude (dB)
Frequency (rad/sec): 60
−50 Magnitude (dB): 0.0673
−100
−150
−200
−180
Phase (deg)
System: gh
−225 Frequency (rad/sec): 60.1
Phase (deg): −212
−270
100 101 102 103 104 105
Frequency (rad/sec)
Bode Diagram
40
35
30
Magnitude (dB)
25
20
15
System: Adel
10 Frequency (rad/sec): 1.28
Magnitude (dB): 4.24
5
0
90
Phase (deg)
45 System: Adel
Frequency (rad/sec): 1.28
Phase (deg): 52
0
10−2 10−1 100 101 102
Frequency (rad/sec)
Fig. 6.104 Bode diagrams of the factor z + 1. The horizontal axis represents 1
z2 ω
Hence, the controller defined by kd z2 (z + 1) must contribute +52◦ phase lead and
0[dB] magnitude when the frequency is 60[rad/s]. It is observed in Fig. 6.104 that
the factor z + 1 contributes +52◦ phase when z12 ω = 1.28 (see Example 6.2). As
this must occur when ω = 60[rad/s], then:
ω
z2 = = 46.875.
1.28 ω=60
On the other hand, the desired crossover frequency is ω = 60[rad/s]. This requires
the controller to contribute, at this frequency, a magnitude of 0[dB] to achieve
a magnitude 0[dB] for the compensated system at the crossover frequency. This
implies that:
where, according to Fig. 6.104, |z + 1|dB = 4.24[dB] must be used. Hence, solving
for kd and performing the corresponding computations:
428 6 Frequency Response-Based Design
1 −4.24
kd = 10 20 = 0.0131.
z2
are shown in Fig. 6.105. There, it can be verified that the crossover frequency is
ω = 60[rad/s] and the phase at this frequency is −160◦ , which corresponds to a
phase margin +20◦ . Thus, the desired frequency response specifications established
in (6.66) and (6.67) have been accomplished. Finally, in Fig. 6.106, the time
response is shown
when the reference is a unit step and a loop is closed around
G(s)H (s) = kp + kd s + ksi s 3 +2739s 2 −1250s−3.536×10
k
6 . It is observed that the rise
time is 0.0166[s] and overshoot is 89%. As stated before, no effort has been made
to achieve particular values for either the rise time or the overshoot, i.e., the only
Bode Diagram
50
System: gh
Frequency (rad/sec): 60
Magnitude (dB)
−50
−100
−90
−135
Phase (deg)
System: gh
−180 Frequency (rad/sec): 60
Phase (deg): −160
−225
−270
100 101 102 103 104 105
Frequency (rad/sec)
Fig.
6.105 Bode diagrams of the transfer function in (6.62), i.e., G(s)H (s) =
ki
kp + kd s + s s 3 +2739s 2 −1250s−3.536×106 with kd = 0.0131, kp = 1.0838, ki = 22.0341
k
6.8 Case Study 429
Step Response
2
1.8 System: M
Time (sec): 0.0449
Amplitude: 1.89
1.6
1.4
1.2 System: M
Amplitude
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7
Time (sec)
ki = 22.0341
objective has been to ensure closed-loop stability. However, a way of improving the
performance is presented in the following. At this point, the reader is advised to see
Example 8.4, in Chap. 8.
The Bode diagrams shown in Fig. 6.103 are depicted again in Fig. 6.107.
However, this time ω1 = 344[rad/s] is selected as the new desired crossover
frequency because the phase at this frequency, i.e., −193◦ , is maximal. Hence, it
is expected that using the same phase lead as before, i.e., 52◦ , a larger phase margin
is accomplished. Thus, using the same data shown in Fig. 6.104 the following is
found that:
ω
z2 = = 268.75
1.28 ω=344
On the other hand, to render ω = 344[rad/s] to be the new crossover frequency, the
magnitude of the controller is required to be +29[dB] when ω = 344[rad/s]. This
means that
1 29−4.24
kd = 10 20 = 0.0644.
z2
430 6 Frequency Response-Based Design
Bode Diagram
50
0
Magnitude (dB)
−50 System: g
Frequency (rad/s): 344
Magnitude (dB): −29
−100
−150
−200
−180
System: g
Phase (deg)
−270
100 101 102 103 104 105
Frequency (rad/s)
Bode Diagram
100
50
Magnitude (dB)
System: GH
Frequency (rad/s): 344
Magnitude (dB): −0.0646
0
−50
−100
−90
−135
Phase (deg)
System: GH
Frequency (rad/s): 342
−180 Phase (deg): −141
−225
−270
100 101 102 103 104 105
Frequency (rad/s)
ki
Fig. 6.108 Bode diagrams of G(s)H (s) = kp + kd s + s
k
s 3 +2739s 2 −1250s−3.536×106
, when
kd = 0.0644, kp = 19.6089, ki = 621.0041
bode(g0,{1,1e5})
grid on
gc=tf([1 1],1);
figure(2)
bode(gc,{0.01,100})
grid on
kp=1.0838;
ki=22.0341;
kd=0.0131;
PID=tf([kd kp ki],[1 0]);
g=tf(k,[1 2739 -1250 -3.536e6]);
figure(3)
bode(PID*g,{1,1e5})
grid on
M=feedback(PID*g,1,-1);
figure(4)
step(M)
grid on
432 6 Frequency Response-Based Design
Step Response
1.5
System: M
Time (seconds): 0.00859
Amplitude: 1.44
1
System: M
Time (seconds): 0.00406
Amplitude
Amplitude: 1
0.5
0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
Time (seconds)
ki = 621.0041
kp=19.6089;
ki=621.0041;
kd=0.0644;
PID=tf([kd kp ki],[1 0]);
figure(5)
bode(PID*g,{1,1e5})
grid on
M=feedback(PID*g,1,-1);
figure(6)
step(M)
grid on
6.9 Summary
6.11 Exercises
1. Investigate how to compute the steady-state error for step, ramp, and parabola
references from the open-loop system Bode diagrams.
2. Consider the integrator system:
t
y(t) = k u dt,
0
y(t) = k u̇(t).
Suppose that u(t) is a square wave, with a period equal to 2, which is equal
to unity during the first half-period and zero during the second half-period.
6.11 Exercises 435
Perform some simulations employing different values for a from almost zero
to very large values. Observe the resulting waveform of y(t) in each case. Why
do you think y(t) is very different from u(t) when a is very close to zero? Why
do you think y(t) looks very similar to u(t) as a becomes too large? Can you
explain this behavior from the point of view of the frequency response of the
a
transfer function s+a ?
4. There is a fundamental result in linear systems theory stating that given a
periodic function of time u(t) and a linear system Y (s) = G(s)U (s) with all
poles of G(s) having a strictly negative real part, then y(t), in a steady state,
is a periodic function of time with the same period as u(t), but, possibly, with
a different waveform [7], pp. 389 (see also Exercise 15, Chap. 3). Does the
example in Exercise 3, in this chapter, suggest to you some explanation of why
u(t) and y(t) may not have the same waveform? What is the main property that
determines that the waveforms of u(t) and y(t) are similar or different?
5. Consider the following differential equation:
ÿ + ωn2 y = ωn2 u.
ÿ + 2ζ ωn ẏ + ωn2 y = ωn2 u,
V (s) kωn2 s
= 2 , (6.69)
I (s) s + 2ζ ωn s + ωn2
where ωn = √ 1 , ζ = 2R 1
C , k = L. Plot the corresponding Bode diagrams
L
LC
when ζ is close to zero (how can this be possible in practice?) and verify that
436 6 Frequency Response-Based Design
L R C V(s)
Headphones
+ vo
vi R
–
–
Bode Diagram
25
20
Magnitude (dB)
15
10
−5
45
Phase (deg)
−45
−90
10−4 10−3 10−2 10−1 100 101 102 103
Frequency (rad/sec)
Vi (s) and Vo (s) are the Laplace transforms of voltages delivered by the
generator and measured by the DC voltmeter respectively. Note that this
transfer function must have a unit gain at zero frequency because this is
the frequency of a DC signal, i.e., when a DC voltmeter correctly measures
voltage. Also note that the value of ωn gives information on what is the
maximal frequency where the DC voltmeter delivers a correct measurement.
This part of the result is highly dependent on the ability of the scope and the
DC voltmeter to deliver the same voltage measurements at low frequencies.
6.11 Exercises 439
Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
−60
Phase (deg)
−70
−80
−90
10−1 100 101 102 103
Frequency (rad/s)
11. Draw the Bode diagrams and the polar plots of the following systems:
12. The Bode diagrams of a plant are depicted in Fig. 6.114. Find the corresponding
transfer function. Assume that a sine function with 5 as amplitude and 10[rad/s]
as frequency is applied at the input of this system. State the amplitude and phase
of the output signal. Now assume that the above plots are the Bode diagrams of
an open-loop transfer function G(s); hence, the same input signal that was used
G(s)
before is now used as the reference of the closed-loop system 1+G(s) . State the
amplitude and the phase at the output.
13. Sketch the Bode diagrams for small frequencies, corresponding to systems type
0, type 1, and type 2. Perform the same with polar plots.
440 6 Frequency Response-Based Design
Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
0
−45
Phase (deg)
−90
−135
−180
10−1 100 101 102
Frequency (rad/s)
(a)
Step Response
1.6
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 2 4 6 8 10 12
Time (seconds)
(b)
Fig. 6.115 (a) Bode diagrams and (b) time responses of two different systems
6.11 Exercises 441
Bode Diagram
50
Magnitude (dB)
−50
180
135
Phase (deg)
90
45
0
10−1 100 101 102
Frequency (rad/s)
14. The Bode diagrams and the time responses, when a unitary step input is applied,
are depicted in Fig. 6.115 for two different open-loop systems. State which one
of the step responses corresponds to each one of the Bode plots.
15. Of the Bode diagrams in Fig. 6.116, state which is the corresponding transfer
function and sketch the corresponding time response when the input is a step.
16. The Bode diagrams of two different open-loop systems are depicted in
Fig. 6.117a. The time responses in Fig. 6.117b are obtained when the loop
is closed, with unit feedback around each one of the systems in Fig. 6.117a,
and a step is applied as a reference. State which time response corresponds to
each Bode diagram.
442 6 Frequency Response-Based Design
Bode Diagram
40
20
Magnitude (dB)
−20
−40
−60
−90
Phase (deg)
−135
−180
10−1 100 101 102
Frequency (rad/s)
(a)
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3 3.5
Time (seconds)
(b)
Fig. 6.117 (a) Open-loop Bode diagrams and (b) closed-loop time response to a step input of two
different systems
References 443
References
1. E. Kreyszig, Advanced engineering mathematics, Vol. 1, 3rd. edition, John Wiley and Sons,
New Jersey, 1972.
2. C. Ray Wylie, Advanced engineering mathematics, McGraw-Hill, New York, 1975.
3. G. F. Franklin, J. D. Powell, and M. L. Workman, Digital control of dynamic systems, Second
edition, Addison-Wesley, USA, 1994.
4. H. P. Hsu, Fourier analysis, Simon & Schuster, New York, 1970.
5. K. Ogata, Modern control engineering, 4th edition, Prentice-Hall, Upper Saddle River, 2002.
6. N. S. Nise, Control systems engineering, 5th. edition, John Wiley and Sons, New Jersey, 2008.
7. C.-T. Chen, Linear system theory and design, Holt, Rinehart, and Winston, New York, 1984.
8. The Thomas Alva Edison Foundation, The Thomas Edison book of easy and incredible
experiments, John Wiley and Sons, New Jersey, 1988.
9. R. C. Dorf and R. H. Bishop, Modern control systems, 10th edition, Pearson Prentice-Hall,
2005.
10. B. C. Kuo, Automatic control systems, Prentice-Hall, 1995.
11. G. H. Hostetter, C. J. Savant, and R. T. Stefani, Design of feedback control systems, Holt,
Rinehart, and Winston, 1982.
Chapter 7
The State Variables Approach
The design methods presented in Chaps. 5 and 6 constitute what is now known as
classical control. One of the features of classical control is that it relies on the so-
called input–output approach, i.e., the use of a transfer function. This means that
a transfer function is like a black box receiving an input and producing an output,
i.e., nothing is known about what happens inside the black box. On the contrary, the
state variable approach allows us to study what happens inside the system.
The study of the state variable approach is a complex subject involving the
use of advanced mathematical tools. However, the aim in this chapter is not to
present a detailed formal exposition of this approach, but merely to present the basic
concepts allowing its application to control simple plants. Thus, only controllable
and observable, single-input single-output plants are considered.
di
L = u − R i − n ke θ̇ , (7.1)
dt
J θ̈ = −b θ̇ + n km i. (7.2)
Note that each one of these differential equations has an effect on the other. It is said
that these differential equations must be solved simultaneously. One useful way of
studying this class of differential equations is the state variables approach. The state
variables are defined as follows.
Definition 7.1 ([1], pp. 83) If the input u(t) is known for all t ≥ t0 , the state
variables are the set of variables the knowledge of which at t = t0 allows us to
compute the solution of the differential equations for all t ≥ t0 .
Note that this definition of the state variables is ambiguous. Although this may
seem to be a drawback, it becomes an advantage because this allows us to select the
state variables that are most convenient. According to this, although several criteria
are proposed in the literature to select the state variables, it must be understood that
no matter how they are selected they must be useful in solving the corresponding
differential equations at any future time. In this chapter, the state variables are
selected using the following criterion.
Criterion 7.1 Identify the unknown variable in each one of the differential equa-
tions involved. Identify the order of each differential equation and designate it as r.
Select the state variables as the unknown variable and its first r − 1 time derivatives
in each one of the differential equations involved. It is also possible to select some
of these variables multiplied by some nonzero constant.
It is common to use n to designate the number of state variables. On the other
hand, the state is a vector whose components are given by each one of the state
variables. Hence, the state is a vector with n components. According to this criterion,
the state variables selected for equations (7.1), (7.2) are i, θ , θ̇ , i.e., n = 3 and the
state is given as:
⎡ ⎤ ⎡ ⎤
x1 i
⎣
x = x2 = θ ⎦ .
⎦ ⎣
x3 θ̇
Using this nomenclature, the differential equations in (7.1), (7.2), can be written as:
L ẋ1 = u − R x1 − n ke x3 ,
J ẋ3 = −b x3 + n km x1 ,
i.e.,:
⎡ ⎤ ⎡ ⎤
x1 (u − R x1 − n ke x3 )/L
d ⎣ ⎦ ⎣ ⎦,
x2 = x3
dt
x3 (−b x3 + n km x1 )/J
ẋ = Ax + Bu,
⎡ R ⎤ ⎡ ⎤
− L 0 − nLke 1
L
A = ⎣ 0 0 1 ⎦, B = ⎣ 0 ⎦.
n km
J 0 −J
b
0
7.1 Definition of State Variables 447
y = Cx, C = [0 1 0].
ẋ = Ax + Bu, (7.3)
y = Cx, (7.4)
is known as a linear, time invariant, dynamical equation (A, B, and C are constant
matrices and vectors). The expression in (7.3) is known as the state equation and
the expression in (7.4) is known as the output equation.
Although the state equation in (7.3) has been obtained from a single input
differential equation, i.e., u is an scalar, it is very easy to extend (7.3) to the case
where there are p inputs: it suffices to define u as a vector with p components, each
one of them representing a different input, and B must be defined as a matrix with
n rows and p columns. On the other hand, it is also very easy to extend the output
equation in (7.4) to the case where there are q outputs: merely define y as a vector
with q components, each one representing a different output, and C must be defined
as a matrix with q rows and n columns.
Note that a state equation is composed of n first-order differential equations. A
property of (7.3), (7.4), i.e., of a linear, time invariant dynamical equation, is that the
right-hand side of each one of the differential equations involved in (7.3) is given as
a linear combination of the state variables and the input using constant coefficients.
Also note that the right-side of (7.4) is formed as the linear combination of the state
variables using constant coefficients.
A fundamental property of linear, time invariant dynamical equations is that
they satisfy the superposition principle, which is reasonable as this class of
state equations is obtained, as explained above, from linear, constant coefficients
differential equations, which, according to Sect. 3.7, also satisfy the superposition
principle.
Example 7.1 Consider the mechanical system shown in Fig. 7.1. The corresponding
mathematical model was obtained in Example 2.4, Chap. 2, and it is rewritten here
for ease of reference:
b K1 K2 1
ẍ1 + (ẋ1 − ẋ2 ) + x1 + (x1 − x2 ) = F (t), (7.5)
m1 m1 m1 m1
b K3 K2
ẍ2 − (ẋ1 − ẋ2 ) + x2 − (x1 − x2 ) = 0. (7.6)
m2 m2 m2
448 7 The State Variables Approach
Note that there are two second-order differential equations. This means that only
four state variables exist: the unknown variable in each one of these differential
equations, i.e., x1 and x2 , and the first time derivative of each one of these unknown
variables, i.e., ẋ1 and ẋ2 :
⎡ ⎤ ⎡ ⎤
x1 x1
⎢ x2 ⎥ ⎢ x2 ⎥
x=⎢ ⎥ ⎢ ⎥
⎣ x3 ⎦ = ⎣ ẋ1 ⎦ , u = F (t).
x4 ẋ2
Using this nomenclature, the differential equations in (7.5), (7.6), can be rewritten
as:
b K1 K2 1
ẍ1 = ẋ3 = − (x3 − x4 ) − x1 − (x1 − x2 ) + u,
m1 m1 m1 m1
b K3 K2
ẍ2 = ẋ4 = (x3 − x4 ) − x2 + (x1 − x2 ),
m2 m2 m2
i.e.,:
⎡ ⎤ ⎡ ⎤
x1 x3
d ⎢ ⎥ ⎢ ⎥
⎢ x2 ⎥ = ⎢
⎢
x4 ⎥
⎥. (7.7)
dt ⎣ x3 ⎦ ⎣ − m1 (x3 − x4 ) − m1 x1 − m1 (x1 − x2 ) + m1 u ⎦
b K1 K2 1
K3 K2
m2 (x3 − x4 ) − m2 x2 + m2 (x1 − x2 )
b
x4
ẋ = Ax + Bu,
⎡ ⎤ ⎡ ⎤
0 0 1 0 0
⎢ 1 ⎥ ⎢ 0 ⎥
⎢ 0 0 0 ⎥ ⎢ ⎥
A = ⎢ K1 K K2 b ⎥, B = ⎢ 1 ⎥. (7.8)
⎣ − m1 − m12 m1 − mb1 m1 ⎦ ⎣ m1 ⎦
K2 K3
m2 −K
m2 −
2
m2
b
m2 − mb2 0
On the other hand, the output equation depends on the variable to be controlled. For
instance, if it is desired to control the position of mass 1, then:
y = Cx = x1 , C = [1 0 0 0],
7.1 Definition of State Variables 449
y = Cx = x2 , C = [0 1 0 0].
Example 7.2 A mechanism known as ball and beam is studied in Chap. 14. In that
chapter, the corresponding mathematical model is obtained and presented in (14.8).
This model is rewritten here for ease of reference:
X(s) ρ k
= 2, θ (s) = I ∗ (s).
θ (s) s s(s + a)
Using the inverse Laplace transform, the corresponding differential equations can
be obtained, i.e.,:
ẍ = ρθ, θ̈ + a θ̇ = ki ∗ . (7.9)
As there are two second-order differential equations, then there are four state
variables: the unknown variable in each differential equation, i.e., x and θ , and the
first time derivative of each unknown variable, i.e., ẋ and θ̇ :
⎤ ⎡ ⎤
⎡
z1 x
⎢ z2 ⎥ ⎢ ẋ ⎥
z=⎢ ⎥ ⎢ ⎥
⎣ z3 ⎦ = ⎣ θ ⎦ , u = i∗.
z4 θ̇
Using this nomenclature, the differential equations in (7.9) can be rewritten as:
i.e.,:
⎡⎤ ⎡ ⎤
z1 z2
d ⎢ ⎥ ⎢
⎢ z2 ⎥ = ⎢ ρz3 ⎥
⎥.
⎣ ⎦ ⎣ ⎦ (7.10)
dt z3 z4
z4 −az4 + ku
ż = Az + Bu
⎡ ⎤ ⎡ ⎤
010 0 0
⎢0 0 ρ 0 ⎥ ⎢0⎥
A=⎢ ⎣0 0 0 1 ⎦,
⎥ B=⎢
⎣0⎦.
⎥ (7.11)
0 0 0 −a k
450 7 The State Variables Approach
As explained in Chap. 14, the variable to be controlled is x; thus, the output equation
is given as:
y = Cz = x = z1 , C = [1 0 0 0].
ẋ = Ax + Bu.
The control objective for this plant can be stated by defining a constant desired state
vector x ∗ and ensuring that limt→∞ x(t) = x ∗ . This means that x(t) must converge
to the constant x ∗ , which implies that limt→∞ ẋ(t) = ẋ ∗ = 0, i.e., the control
problem has a solution if, and only if, there is a pair (x ∗ , u∗ ) such that:
ẋ ∗ = Ax ∗ + Bu∗ = 0, (7.12)
Mimicking (7.12), to obtain the possible operation points, find all possible solutions
of:
⎡ ⎤ ⎡ ⎤
0 z2∗
⎢0⎥ ⎢ ρz3∗ ⎥
⎢ ⎥=⎢ ⎥.
⎣0⎦ ⎣ z4∗ ⎦
0 ∗
−az4 + ku∗
7.2 The Error Equation 451
It is clear that:
⎡ ⎤ ⎡ ⎤
z1∗ c
⎢ z2 ⎥ ⎢ 0 ⎥
∗ ⎥ ⎢
z∗ = ⎢ ⎥
⎣ z∗ ⎦ = ⎣ 0 ⎦ , u∗ = 0,
3
z4∗ 0
where c is any real constant because no constraint is imposed on z1∗ . Once the
operation points (z∗ , u∗ ) are defined, the error state is given as:
⎡ ⎤ ⎡ ⎤
e1 z1 − c
⎢ e2 ⎥ ⎢ z2 ⎥
e=⎢ ⎥ ∗ ⎢
⎣ e3 ⎦ = z − z = ⎣ z3 ⎦ .
⎥ (7.13)
e4 z4
The error equation is obtained differentiating the error state once, i.e.,:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤
ė1 ż1 − ż1∗ ż1 z2
⎢ ė2 ⎥ ⎢ ż2 − ż∗ ⎥ ⎢ ż2 ⎥ ⎢ ρz3 ⎥
ė = ⎢ ⎥ ⎢ 2⎥ ⎢ ⎥ ⎢
⎣ ė3 ⎦ = ⎣ ż3 − ż∗ ⎦ = ⎣ ż3 ⎦ = ⎣
⎥.
⎦
3 z4
ė4 ż4 − ż4∗ ż4 −az4 + ku
ė = Ae + Bv,
Mimicking (7.12), to obtain the possible operation points find all the possible
solutions of:
⎡ ⎤ ⎡ ⎤
0 x3∗
⎢0⎥ ⎢ x4∗ ⎥
⎢ ⎥=⎢ ⎥
⎢
⎣ 0 ⎦ ⎣ − (x − x ) − x − (x − x ) + u ⎥
b ∗ ∗ K 1 ∗ K2 ∗ ∗ 1 ∗
⎦
,
m1 3 4 m1 1 m1 1 2 m1
∗ ∗ K 3 ∗ K ∗ ∗
m2 (x3 − x4 ) − m2 x2 + m2 (x1 − x2 )
b 2
0
K1 ∗ K2 ∗ 1 ∗
− x − (x − x2∗ ) + u = 0,
m1 1 m1 1 m1
K3 ∗ K2 ∗
− x + (x − x2∗ ) = 0.
m2 2 m2 1
Solving these expressions, it is found that the operation points are given as:
⎡ ⎤ ⎡ K2 +K3 ∗ ⎤
x1∗ x
⎢ K2 2 ⎥
⎢ x ∗⎥
⎢ c ⎥ (K1 + K2 )(K2 + K3 )
x∗ = ⎢ 2⎥
⎣ x∗ ⎦ = ⎢ ⎥, ∗
u = − K2 x2∗ ,
3 ⎣ 0 ⎦ K2
x4∗ 0
(7.14)
where c is any real constant. Once the operation points (x ∗ , u∗ ) are defined, the
error state is given as:
⎡ ⎤ ⎡ ⎤
e1 x1 − x1∗
⎢ e2 ⎥ ⎢ x2 − x ∗ ⎥
e=⎢ ⎥ ∗ ⎢
⎣ e3 ⎦ = x − x = ⎣ x3 ⎦ .
2⎥ (7.15)
e4 x4
The error equation is obtained differentiating the error state once, i.e.,:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤
ė1 ẋ1 − ẋ1∗ ẋ1
⎢ ė2 ⎥ ⎢ ẋ2 − ẋ ∗ ⎥ ⎢ ẋ2 ⎥
ė = ⎢ ⎥ ⎢ 2⎥
⎣ ė3 ⎦ = ⎣ ẋ3 ⎦ = ⎣ ẋ3 ⎦
⎢ ⎥
1 ∗ K2 ∗ K2 ∗ K3 ∗ K2 ∗ K2 ∗
Adding and subtracting terms K m1 x1 , m1 x2 , m1 x1 and m2 x2 , m2 x2 , m2 x1 in the
third row and fourth row respectively of the last expression and using (7.14), (7.15),
yields:
⎡ ⎤
e3
⎢ ⎥
⎢ e4 ⎥
ė = ⎢ b K1 K2 ∗ ⎥.
⎣ − m1 (e3 − e4 ) − m1 e1 − m1 (e1 − e2 ) + m1 (u − u ) ⎦
1
K3 K2
m2 (e3 − e4 ) − m2 e2 + m2 (e1 − e2 )
b
ė = Ae + Bv,
Nonlinear state equations are frequently found. These are state equations given as:
fi (x, u) = 3 sin(x3 ) + x1 u2 ,
e x1
fi (x, u) = ,
5x2
fi (x, u) = u21 .
It is important to stress that the notation fi (x, u) means that the i−th component
of vector f is in general a function of the components of the state vector x and the
input vector u. However, as shown in the previous examples, it is not necessary for
fi (x, u) to be a function of all the state variables and all the inputs. Moreover, it is
also possible that fi (x, u) is not a function of any state variable, but it is a function
454 7 The State Variables Approach
of some of the inputs and vice versa. A state equation of the form (7.16) possessing
the above features is known as a nonlinear time invariant state equation, i.e., it has
no explicit dependence on time.
The study of nonlinear state equations is much more complex than the study
of linear state equations. However, most physical systems are inherently nonlinear,
i.e., their models have the form given in (7.16). Hence, suitable analysis and design
methodologies must be developed for this class of state equations. One of the
simplest methods is to find a linear state equation, such as that in (7.3), which is
approximately equivalent to (7.16). The advantage of this method is that the linear
state equations such as that in (7.3) can be studied much more easily. Hence, the
analysis and design of controllers for (7.16) are performed on the basis of the much
simpler model in (7.3). Although this method is very useful, it must be stressed that
its main drawback is that the results obtained are only valid in a small region around
the point where the linear approximation is performed. These ideas are clarified in
the following sections.
ẋ = f (x), (7.17)
where the constant m represents the slope of h(x), i.e., the derivative of f (x)
evaluated at the equilibrium point x ∗ . Then, from the first expression:
h (x )
f (x )
f (x *)
x* x
f (x) ≈ m(x − x ∗ ) + f (x ∗ ).
f (x) ≈ m(x − x ∗ ).
ẋ = m(x − x ∗ ).
ż = m z, (7.19)
ẋ = f (y). (7.21)
Following the ideas in the previous section, it is desired to approximate the nonlinear
function f (y) by a function h(y) that is tangent to f (y) at the operation point y ∗
defined as:
∗
x
y∗ = .
u∗
h(y) = M(y − y ∗ ) + f (y ∗ ),
∂f (y)
where M = ∂y y=y ∗ is a constant matrix defined as:
⎡ ∂f ⎤
1 (x,u) ∂f1 (x,u) ∂f1 (x,u) ∂f1 (x,u) ∂f1 (x,u) ∂f1 (x,u)
∂x1 ∂x2 ... ∂xn ∂u1 ∂u2 ... ∂up
⎢ ⎥
⎢ ∂f2 (x,u) ∂f2 (x,u)
... ∂f2 (x,u) ∂f2 (x,u) ∂f2 (x,u)
... ∂f2 (x,u) ⎥
⎢ ∂x1 ∂x2 ∂xn ∂u1 ∂u2 ∂up ⎥
M=⎢ .. .. .. .. .. .. ⎥ .
⎢ ..
.
..
. ⎥
⎣ . . . . . . ⎦
∂fn (x,u) ∂fn (x,u) ∂fn (x,u) ∂fn (x,u) ∂fn (x,u) ∂fn (x,u)
∂x1 ∂x2 ... ∂xn ∂u1 ∂u2 ... ∂up x=x ∗ ,u=u∗
ẋ = M(y − y ∗ ) + f (y ∗ ).
7.3 Approximate Linearization 457
ż = Az + Bv, (7.22)
⎡ ∂f1 (x,u) ∂f1 (x,u) ∂f1 (x,u) ⎤
∂x ∂x2 ... ∂xn
⎢ ∂f2 (x,u)
1
∂f2 (x,u) ∂f2 (x,u) ⎥
⎢ ∂x1 ... ⎥
A=⎢ ⎥
∂x2 ∂xn
⎢ .. .. .. .. ⎥ , (7.23)
⎣ . . . . ⎦
∂fn (x,u) ∂fn (x,u) ∂fn (x,u)
...
∂x1 ∂x2 ∂xn x=x ∗ ,u=u∗
⎡ ∂f ⎤
1 (x,u) ∂f1 (x,u) ∂f1(x,u)
...
⎢ ∂f2∂u 1 ∂u2 ∂up
⎥
⎢ (x,u) ∂f2 (x,u)
... ∂f2 (x,u) ⎥
⎢ ∂u1 ∂u2 ∂up ⎥
B=⎢ .. .. .. ⎥ , (7.24)
⎢ ..
. ⎥
⎣ . . . ⎦
∂fn (x,u) ∂fn (x,u) ∂fn (x,u)
∂u1 ∂u2 ... ∂up x=x ∗ ,u=u∗
The feature that renders this differential equation nonlinear is the function sin(θ )
representing the effect of gravity. As it is a second-order differential equation, then
only two state variables exist: the unknown θ and its first-time derivative θ̇ :
x1 θ
x= = , u = T (t).
x2 θ̇
Using this nomenclature, the differential equation in (7.25) can be written as:
b g 1
θ̈ = ẋ2 = − 2
x2 − sin(x1 ) + 2 u,
ml l ml
i.e.,
d x1 x2
= g .
dt x2 − ml 2 x2 − l sin(x1 ) +
b 1
ml 2
u
ẋ = f (x, u)
f1 (x, u) x2
f (x, u) = = g .
f2 (x, u) − mlb 2 x2 − l sin(x1 ) +
1
ml 2
u
Note that in this case, it is not possible to obtain the linear form ẋ = Ax + Bu
because of the function sin(θ ). To obtain a linear approximation for this nonlinear
state equation, the operation points are first obtained, i.e., those pairs (x ∗ , u∗ )
satisfying f (x ∗ , u∗ ) = [0 0]T :
∗ ∗ x2∗ 0
f (x , u ) = = .
− mlb 2 x2∗ − g
l sin(x1∗ ) + 1 ∗
ml 2
u 0
This means that the input at the operation point depends on the pendulum position at
the operation point. This is because, to maintain the pendulum at rest, it is necessary
to have an input that exactly compensates for the effect of gravity. To continue, a
particular value for x1∗ must be selected. Two cases are considered here:
• When x1∗ = 0, x2∗ = 0, u∗ = 0. Using (7.22), (7.23), (7.24), the following is
found:
ż = Az + Bv,
7.3 Approximate Linearization 459
∂f1 (x,u) ∂f1 (x,u)
0 1
A= ∂x1 ∂x2 = ,
∂f2 (x,u) ∂f2 (x,u) − gl cos(x1 ) − mlb 2
∂x1 ∂x2 x=x ∗ ,u=u∗ x1 =x2 =u=0
0 1
= g ,
− l − mlb 2
∂f1 (x,u)
0
B= ∂u
∂f2 (x,u) = 1 ,
∂u x=x ∗ ,u=u∗ ml 2
g b 1
ż1 = z2 , ż2 = − z1 − 2 z2 + 2 v.
l ml ml
Combining these first-order differential equations the following linear, second-
order differential equation with constant coefficients is obtained:
b g 1
z̈1 + 2
ż1 + z1 = v. (7.26)
ml l ml 2
This differential equation can be analyzed using the concepts studied in Sects. 3.3
(complex conjugate roots with a negative or zero real part), 3.4.2 (real and
repeated negative roots) and 3.4.1 (real, different and negative roots), Chap. 3,
as it corresponds to a differential equation with the form:
ÿ + 2ζ ωn ẏ + ωn2 y = kωn2 v,
where:
b g 1
y = z1 , 2ζ ωn = , ωn2 = , k= ,
ml 2 l mgl
ż = Az + Bv,
∂f1 (x,u) ∂f1 (x,u)
0 1
A= ∂x1 ∂x2 = g ,
∂f2 (x,u) ∂f2 (x,u) − l cos(x1 ) − mlb 2
∂x1 ∂x2 x=x ∗ ,u=u∗ x1 =±π,x2 =u=0
0 1
= g ,
l − mlb 2
460 7 The State Variables Approach
∂f1 (x,u)
0
B= ∂u
∂f2 (x,u) = 1 ,
∂u x=x ∗ ,u=u∗ ml 2
g b 1
ż1 = z2 , ż2 = z1 − 2 z2 + 2 v.
l ml ml
Combining these first-order differential equations the following linear, second-
order differential equation with constant coefficients is obtained:
b g 1
z̈1 + ż1 − z1 = v. (7.27)
ml 2 l ml 2
This differential equation can be analyzed using the concepts studied in
Sect. 3.4.1, Chap. 3 (real, different roots, one positive and the other negative, see
Example 3.11) as it corresponds to a differential equation of the form:
ÿ + cẏ + dy = ev,
where:
b g 1
y = z1 , c= ≥ 0, d=− < 0, e= .
ml 2 l ml 2
Note that, according to (7.26) and Sect. 3.3, Chap. 3, the pendulum oscillates with a
natural frequency given as ωn = gl when operating around x1∗ = 0, x2∗ = 0, u∗ =
0. This means that a longer pendulum oscillates slower whereas a shorter pendulum
oscillates faster. These observations are useful, for instance, when it is desired to
adjust the rate of a clock that leads or lags in time. Moreover, rearranging (7.26) the
following is found:
T (t)
7.4 Some Results from Linear Algebra 461
Some results that are useful for studying the state variables approach are presented
in this section.
Fact 7.1 ([1], chapter 2) Let w1 , w2 , . . . , wn , be n vectors with n compo-
nents. These vectors are linearly dependent if, and only if, there exist n scalars
α1 , α2 , . . . , αn , not all zero such that:
α1 w1 + α2 w2 + · · · + αn wn = 0, (7.29)
where zero at the right represents a vector with n zero components. If the only way
of satisfying the latter expression is that α1 = α2 = · · · = αn = 0, then it is said
that w1 , w2 , . . . , wn , are linearly independent vectors.
462 7 The State Variables Approach
In the simplest version of the linear dependence of vectors, two vectors with two
components are linearly dependent if they are parallel. This can be shown as follows.
Let w1 and w2 be two vectors, each one having n = 2 components. These vectors
are linearly dependent if there are two constants α1 = 0 and α2 = 0 such that:
α1 w1 + α2 w2 = 0,
Note that α1 cannot be zero for obvious reasons. On the other hand, if α2 is zero,
then w1 = 0 is the only solution in this case that is not of interest. Hence, it is
assumed that both α1 = 0 and α2 = 0. Thus, as the factor − αα21 is a scalar (positive
or negative), the above means that w1 and w2 are vectors with the same direction,
i.e., they are parallel.1
In the case of three or more vectors, linear dependence means that one of vectors
can be computed as the addition of the other vectors when suitably affected by
factors αi (this is what is known as a linear combination of vectors), i.e.,:
α2 α3
w1 = − w2 − w3 ,
α1 α1
1 Some authors use the term antiparallel to indicate that two vectors have the same direction but
the opposite sense. In this book, the term parallel is employed to designate two vectors with the
same direction no matter what their senses are.
7.4 Some Results from Linear Algebra 463
det(λI − E) = 0,
Ē = P EP −1 , (7.30)
where P is an n × n constant and nonsingular matrix, then both matrices, E and Ē,
possess identical eigenvalues. This means that:
Note that (7.31) has been retrieved in the last expression, which verifies that result.
Fact 7.8 ([4], pp. 334)) Let E and F be two n × n matrices with F = E T . The
eigenvalues of F are identical to eigenvalues of E.
The following is useful for explaining the above.
Fact 7.9 ([2], pp. 504) The determinant of a matrix E is equal to the addition of
the products of the elements of any row or column of E and their corresponding
cofactors.
Fact 7.10 ([2], pp. 507) If det(D) is any determinant and det(G) is the determinant
whose rows are the columns of det(D), then det(D) = det(G).
According to the above, det(λI − E) can be computed using, for instance, the first
column of matrix λI −E, whereas det(λI −F ) can be computed using, for instance,
the first row of matrix λI − F . Note that the first column of λI − E is equal to the
first row of λI − F as (λI − E)T = λI − F because F = E T . Similarly, the
rows of the cofactor of entry at row i and column 1 in matrix λI − E are equal to
the columns of the cofactor of entry at row 1 and column i in matrix λI − F . This
shows that E and F have the same characteristic polynomial, i.e.,:
det(λI − E) = det(λI − F )
ẋ = ax + bu, x, u ∈ R.
7.5 Solution of a Dynamical Equation 465
where X(s), U (s), stand for Laplace transforms of x and u respectively. This can
be written as follows:
b x(0)
X(s) = U (s) + . (7.35)
s−a s−a
0 1 1
L eat = = G(s), (7.36)
s−a
t
b
L g(t − τ )bu(τ )dτ = U (s), (convolution),
0 s−a
g(t) = L−1 {G(s)} ,
The solution of the state equation in (7.33) is similar to this last equation and we
just need to use matrix notation, i.e., the solution of (7.33) is [1], pp. 142:
t
x(t) = eAt x(0) + eA(t−τ ) Bu(τ )dτ, x ∈ R n , u ∈ R, (7.37)
0
c eλt ,
where c and d are real constants, are included in at least one of the entries of
matrix eAt .
• If λ =√a ± j b is a complex eigenvalue of matrix A that repeats r times, where
j = −1, a is a (positive, negative or zero) real number and b is a strictly
positive real number, then each one of the following functions of time:
c0 eat sin(bt), , c1 teat sin(bt), c2 t 2 eat sin(bt), . . . , cr−1 t r−1 eat sin(bt),
d0 eat cos(bt), , d1 teat cos(bt), d2 t 2 eat cos(bt), . . . , dr−1 t r−1 eat cos(bt),
(7.38)
ẋ = Ex, (7.40)
y = Cx,
7.6 Stability of a Dynamical Equation 467
then limt→∞ xi (t) = 0 for all i = 1, 2, . . . , n, for any initial state. According to the
solution in (7.37), the solution of (7.40) is obtained by defining u = 0 and A = E
in (7.37), i.e.,:
lim t j ept = 0,
t→∞
ẋ = Ax + Bu, x ∈ R n , u ∈ R, (7.41)
y = Cx, y ∈ R, (7.42)
that are employed throughout this chapter are controllability and observability.
7.7.1 Controllability
Definition 7.2 ([1], pp. 176) A state equation is controllable at t0 if there exists a
finite time t1 > t0 such that given any states x0 and x1 exists and input u that is
applied from t = t0 to t = t1 transfers the state from x0 at t = t0 to x1 at t = t1 .
Otherwise, the state equation is not controllable.
Note that this definition does not specify the trajectory to be tracked to transfer
the state from x0 to x1 . Furthermore, it is not necessary for the state to stay at x1
for all t > t1 . Also note that controllability is a property that is only concerned with
the input, i.e., with the state equation, and the output equation is not considered.
Finally, this definition is very general as it also considers the possibility that the
state equation is time variant, i.e., that the entries of A and B are functions of time.
In the case of a time-invariant state equation, such as that shown in (7.41), i.e.,
when all entries of A and B are constant, if the state equation is controllable then
it is controllable for any t0 ≥ 0 and t1 is any value such that t1 > t0 . This means
that the transference from x0 to x1 can be performed in any nonzero time interval.
This allows us to formulate a simple way of checking whether a state equation is
controllable:
Theorem 7.2 ([6], pp. 145) The state equation in (7.41) is controllable if, and only
if, any of the following equivalent conditions are satisfied (see Exercises 10 and 11
at the end of this Chapter):
1. The following n × n matrix:
t T t T
Wc (t) = eAτ BB T eAτ dτ = eA(t−τ ) BB T eA(t−τ ) dτ,
0 0
(7.43)
The reason for this result can be explained as follows. The following input:
T
u(t) = −B T eA(t1 −t) Wc−1 (t1 )[eAt1 x0 − x1 ] (7.45)
to obtain:
=e At1
x(0)
t1 T
− eA(t1 −τ ) BB T eA(t1 −τ ) dτ Wc−1 (t1 )[eAt1 x0 − x1 ],
2 0 34 5
Wc (t1 )
= x1 .
Note that this result needs the n × n matrix Wc (t), defined in (7.43), to be
nonsingular, which is true for any t1 = t > 0 if the state equation is controllable.
The fact that t1 is any positive time means that the state may go from x0 to x1 in any
nonzero time interval.
On the other hand, the equation in (7.43) can be corroborated as follows. Defining
v = t − τ:
t T τ =t T
e A(t−τ ) T
BB e A(t−τ )
dτ = eA(t−τ ) BB T eA(t−τ ) dτ,
0 τ =0
v=0 T
= eAv BB T eAv (−dv),
v=t
v=t T
= eAv BB T eAv dv,
v=0
470 7 The State Variables Approach
7.7.2 Observability
The reason for this result is explained as follows. Consider the solution given
in (7.39) and define:
Note that, according to (7.49), the function y(t) can be computed from the
exclusive knowledge of the input and the output. Multiplying both sides of (7.48)
T
by eAt C T and integrating on [0, t1 ] it is found that:
t1 T t1
T
eAt C T CeAt dt x(0) = eAt C T y(t)dt.
0 0
2 34 5
Wo (t1 )
If the matrix Wo (t1 ) is nonsingular, which is true if the system is observable, then
the initial state x(0) = x0 can be uniquely computed as:
t1 T
x0 = Wo−1 (t1 ) eAt C T y(t)dt.
0
Note that this result needs the n×n matrix Wo (t) defined in (7.46) to be nonsingular,
which is true for any t1 = t > 0 if the dynamical equation is observable. The fact
that t1 is any positive time means that the state x0 can be computed with information
obtained from the input and the output in any nonzero time interval.
Finally, the fact that the rank of matrix in (7.47) is n and the nonsingularity of
Wo (t) are equivalent conditions is very useful, as it is easier to check (7.47) to have
rank n than the nonsingularity of Wo (t).
Example 7.6 One way of estimating the actual state x(t) (not the initial state x(0))
is using input and output measurements in addition to some of their time derivatives.
It is shown in the following that a necessary condition for this is, again, that the
matrix in (7.47) has the rank n. Consider the dynamical equation in (7.41), (7.42).
The first n − 1 time derivatives of the output are computed as:
y = Cx,
ẏ = C ẋ = CAx + CBu,
ÿ = CAẋ + CB u̇ = CA2 x + CABu + CB u̇,
y (3) = CA2 ẋ + CAB u̇ + CB ü = CA3 x + CA2 Bu + CAB u̇ + CB ü,
..
.
y (i) = CAi x + CAi−1 Bu + CAi−2 B u̇ + · · · + CBu(i−1) ,
472 7 The State Variables Approach
..
.
y (n−1) = CAn−1 x + CAn−2 Bu + CAn−3 B u̇ + · · · + CBu(n−2) ,
where the exponent between brackets stands for the order of a time derivative. Using
matrix notation:
Ẏ = Dx(t) + U̇ ,
where:
⎡ ⎤ ⎡ ⎤
y C
⎢ ⎥ ⎢ ⎥
⎢ ẏ ⎥ ⎢ CA ⎥
⎢ ⎥ ⎢ ⎥
⎢ ÿ ⎥ ⎢ CA2 ⎥
Ẏ = ⎢
⎢ y (3)
⎥,
⎥ D=⎢
⎢ CA3
⎥,
⎥
⎢ ⎥ ⎢ ⎥
⎢ .. ⎥ ⎢ .. ⎥
⎣ . ⎦ ⎣ . ⎦
y (n−1) CAn−1
⎡ ⎤
0
⎢ ⎥
⎢ CBu ⎥
⎢ ⎥
⎢ CABu + CB u̇ ⎥
U̇ = ⎢
⎢ CA2 Bu + CAB u̇ + CB ü
⎥.
⎥
⎢ ⎥
⎢ .. ⎥
⎣ . ⎦
CAn−2 Bu + CAn−3 B u̇ + · · · + CBu(n−2)
Thus, if the matrix in (7.47) has the rank n, then the n × n matrix D is invertible and
the actual state can be computed as:
i.e., by only employing input and output measurements in addition to some of their
time derivatives. A drawback of (7.50) is that measurements of any variable have
significant noise content in practice and this problem becomes worse as higher
order time derivatives are computed from these measurements. This is the reason
why (7.50) is not actually employed in practice to compute x(t) and asymptotic
methods such as that presented in Sect. 7.12 are preferred.
ẋ = Ax + Bu, (7.51)
y = Cx,
7.8 Transfer Function of a Dynamical Equation 473
where X(s), Y (s), U (s) represent the Laplace transform of the state vector x, the
scalar output y, and the scalar input u respectively, whereas x(0) is the initial value
of the state x. Recall that, given a vectorial function of time x = [x1 , x2 , . . . , xn ]T ,
its Laplace transform is obtained by applying this operation to each entry of the
vector, i.e., [3], chapter 4:
⎡ ⎤
L {x1 }
⎢ L {x2 } ⎥
⎢ ⎥
X(s) = ⎢ . ⎥ .
⎣ .. ⎦
L {xn }
Note that the transfer function G(s) given in (7.55) is a scalar. Now, proceed to
analyze this transfer function. In the following, it is assumed that n = 3 for ease of
exposition of ideas, i.e., that A is an 3 × 3 matrix, I is the 3 × 3 identity matrix, and
B and C are column and row vectors respectively, with 3 components:
⎡ ⎤ ⎡ ⎤
a11 a12 a13 b1 . /
A = ⎣ a21 a22 a23 ⎦ , B = ⎣ b2 ⎦ , C = c1 c2 c3 .
a31 a32 a33 b3
The reader can verify that the same procedure is valid from any arbitrary n. First,
compute the matrix:
⎡ ⎤
s − a11 −a12 −a13
sI − A = ⎣ −a21 s − a22 −a23 ⎦ ,
−a31 −a32 s − a33
474 7 The State Variables Approach
⎡ ⎤T
Cof11 Cof12 Cof13
Adj (sI − A) = Cof T (sI − A) = ⎣ Cof21 Cof22 Cof23 ⎦ , (7.56)
Cof31 Cof32 Cof33
with Cof (sI −A) the cofactors matrix of sI −A, and Cofij = (−1)i+j Mij with Mij
the (n − 1) × (n − 1) determinant (2 × 2 in this case) resulting when eliminating the
i−th row and the j −th column from the determinant of matrix sI − A [2], chapter
10. Explicitly computing these entries, it is realized that Cofij is a polynomial in s
whose degree is strictly less than n = 3. On the other hand, solving through the first
row it is found that:
s − a22 −a23 −a21 −a23
det(sI − A) = (s − a11 )
+ a12
−a32 s − a33 −a31 s − a33
−a21 s − a22
−a13 ,
−a31 −a32
are given as the division of two polynomials in s such that the degree of the
polynomial at the numerator is strictly less than n = 3 and the polynomial at the
denominator is det(sI − A), which has the degree n = 3.
On the other hand, the product (sI − A)−1 B is a column vector with n = 3
components. Each one of these components is obtained as:
⎡ ⎤ ⎡ ⎤
d1 I nv11 b1 + I nv12 b2 + I nv13 b3
(sI − A)−1 B = ⎣ d2 ⎦ = ⎣ I nv21 b1 + I nv22 b2 + I nv23 b3 ⎦ .
d3 I nv31 b1 + I nv32 b2 + I nv33 b3
According to the previous discussion on the way in which the entries I nvij of
matrix (sI − A)−1 are given, and resorting to the addition of fractions with the
same denominator, it is concluded that each one of the entries di of the column
vector (sI − A)−1 B is also given as a division of two polynomials in s such that
the polynomial at the numerator has a degree strictly less than n = 3 whereas the
polynomial at the denominator is det(sI − A), whose degree equals n = 3. Finally,
the following is found:
C(sI − A)−1 B = c1 d1 + c2 d2 + c3 d3 .
7.8 Transfer Function of a Dynamical Equation 475
Reasoning as before, the following is concluded, which is valid for any arbitrary n:
Fact 7.11 ([1], chapters 6, 7) The transfer function in (7.55) is a scalar, which is
given as the division of two polynomials in s such that the degree of the polynomial
at the numerator is strictly less than n and the polynomial at the denominator, given
as det(sI − A), has the degree n, i.e.,
Y (s)
= G(s) + D,
U (s)
ẋ = Ax + Bu,
y = Cx + Du,
J θ̈ + bθ̇ = n km i ∗ ,
476 7 The State Variables Approach
To obtain the corresponding transfer function, the following cases are considered:
• The output is the position, i.e., y = θ = x1 = Cx, where C = [1 0]. Then:
. / 1 s+ b
1 0
G(s) = C(sI − A)−1 B = 1 0 J
nkm ,
s(s + Jb ) 0 s J
nkm
G(s) = J
.
s(s + Jb )
has the rank n = 2 because its determinant is unity, i.e., it is different from zero.
7.8 Transfer Function of a Dynamical Equation 477
means that besides the knowledge of velocity, it is necessary to know the initial
position θ (0), which is also unknown. Thus, the system is not observable when the
output is velocity. However, as previously stated, if controlling the velocity is the
only thing that matters, then this can be performed without any knowledge of the
position. Observability is important in other classes of problems that are studied
later in Sects. 7.12 and 7.13.
Finally, the reader can verify the correctness of the above results by comparing
the transfer functions obtained with those in Chaps. 10 and 11.
478 7 The State Variables Approach
bm s m + bm−1 s m−1 + · · · + b1 s + b0
Y (s) = U (s).
s n + an−1 s n−1 + · · · + a1 s + a0
1
V (s) = U (s), (7.61)
s n + an−1 s n−1 + · · · + a1 s + a0
to write:
Applying the inverse Laplace transform to (7.61) and solving for the highest order
time derivative:
where V (s) = L {v}. According to Sect. 7.1, define the state variables as the
unknown variable in (7.63), v, and its first n − 1 time derivatives:
On the other hand, using the inverse Laplace transform in (7.62), the following is
obtained:
If it is assumed that m takes its maximal value, i.e., m = n − 1 (recall that n > m)
then (7.64) can be used to write:
It has been shown in Sect. 7.8 that any controllable single-input single-output
dynamical equation (7.51) can be written as the transfer function in (7.58). Note that
requiring observability is merely to ensure that no pole-zero cancellation is present
in (7.58). On the other hand, it has been shown in Sect. 7.9 that the transfer function
in (7.58) can be written as the dynamical equation in (7.67). This means that any
of the dynamical equations in (7.51) or (7.67) can be obtained from the other, i.e.,
these dynamical equations are equivalent.
480 7 The State Variables Approach
In the following, it is shown how to obtain (7.51) from (7.67) and vice versa,
without the necessity of the intermediate step of a transfer function. Consider the
single-input single-output dynamical equation in (7.51) and define the following
linear transformation:
x̄ = P x, (7.68)
where P is an n × n constant matrix defined from its inverse matrix as [1], chapter
7:
. /
P −1 = q1 · · · qn−2 qn−1 qn , (7.69)
qn = B,
qn−1 = AB + an−1 B,
qn−2 = A2 B + an−1 AB + an−2 B,
..
.
q1 = An−1 B + an−1 An−2 B + · · · + a1 B,
det(sI − A) = s n + an−1 s n−1 + · · · + a1 s + a0 .
It is important to stress that the matrix P −1 is invertible, i.e., its inverse matrix
P always exists if the matrix defined in (7.44) has the rank n [1], chapter 7,
or equivalently if (7.51) is controllable. This can be explained as follows. If
the matrix defined in (7.44) has the rank n, i.e., all its columns are linearly
independent, then when adding its columns as in the previous expressions defining
vectors q1 , . . . , qn−2 , qn−1 , qn , the columns q1 , . . . , qn−2 , qn−1 , qn are linearly
independent (see fact 7.1). This means that the determinant of P −1 is different from
zero; hence, its inverse matrix P exists.
Using (7.68) in (7.51), i.e., x̄˙ = P ẋ, it is found that:
The matrix Ā and the vectors B̄, C̄ in (7.70) are given as in the controllability
canonical form (7.67) no matter what the particular form of A, B and C is, as
long as the matrix defined in (7.44) has the rank n. A formal proof for this latter
statement requires mathematical tools that are outside of the scope of this book;
hence, it is not presented. The reader is advised to see [1] for a complete solution to
this problem. The reader can also verify these ideas by proposing numerical values
for the matrices A, B, and C, and performing the corresponding computations. The
above means that each one of the dynamical equations (7.51) and (7.67) can be
obtained from the other and the relationship among the matrices involved is given
7.10 Equivalent Dynamical Equations 481
in (7.70), i.e., these dynamical equations are equivalent. Note that the fundamental
condition for the existence of this equivalence is that the matrix defined in (7.44)
has the rank n [1], chapter 5. This is summarized as follows:
Theorem 7.4 ([1], chapter 7) If (7.51) is controllable, then this dynamical equa-
tion is equivalent to (7.67) through the linear transformation (7.68), (7.69), i.e.,
through (7.70).
Example 7.8 The linear approximate model of a mechanism known as the Furuta
pendulum is obtained in Chap. 15. This model is presented in (15.17), (15.18), and
it is rewritten here for ease of reference:
ż = Az + Bv, (7.71)
⎡ ⎤ ⎡ ⎤
01 0 0 0
⎢ −gm21 l12 L0 ⎥ ⎢ J1 +m1 l12 ⎥
⎢0 0 0⎥ ⎢ I (J +m l 2 )+J m L2 ⎥ km
⎢ I0 (J1 +m1 l12 )+J1 m1 L20 ⎥
A=⎢ ⎥, B=⎢
⎢
0 1 1 1 1 1 0 ⎥
⎥ r .
⎢0 0 0 1⎥ ⎣ 0 ⎦ a
⎣ (I0 +m1 L20 )m1 l1 g
⎦ −m1 l1 L0
00 0 I0 (J1 +m1 l12 )+J1 m1 L20
I0 (J1 +m1 l1 )+J1 m1 L0
2 2
To render the algebraic manipulation easier, the following constants are defined:
Thus, the dynamical equation in (7.71) is controllable for any set of the Furuta
pendulum parameters. This result does not change if the mechanism is large or
small, heavy or light. This also means that the matrix P introduced in (7.68)
is nonsingular and it is computed in the following using (7.69). To simplify the
computations, the following numerical values are employed:
482 7 The State Variables Approach
Hence:
⎡ ⎤ ⎡ ⎤
01 0 0 0
⎢ 0 0 −35.81 0 ⎥ ⎢ 13.4684 ⎥
A=⎢
⎣0 0
⎥, B=⎢ ⎥.
0 1⎦ ⎣ 0 ⎦
0 0 72.90 0 −12.6603
With these data, the roots of the characteristic polynomial det(λI − A) are found to
be:
λ1 = 0, λ2 = 0, λ3 = 8.5381, λ4 = −8.5381.
a3 = 0, a2 = −72.9, a1 = 0, a0 = 0. (7.72)
hence:
⎡ ⎤
−0.0019 0 −0.0020 0
⎢ 0 −0.0019 0 −0.0020 ⎥
P =⎢
⎣
⎥.
⎦ (7.73)
0 0 −0.0790 0
0 0 0 −0.0790
Note that these matrices have exactly the same form as that presented in (7.67) for
Ā = P AP −1 and B̄ = P B. The above computations have been performed by
executing the following MATLAB code in an m-file:
clc
A=[0 1 0 0;
0 0 -35.81 0;
0 0 0 1;
0 0 72.90 0];
B=[0;
13.4684;
0;
-12.6603];
U=[B A*B A^2*B A^3*B];
det(U)
v=eig(A)
f=conv([1 -v(1)],[1 -v(2)]);
g=conv(f,[1 -v(3)]);
h=conv(g,[1 -v(4)]);
a3=h(2);
a2=h(3);
a1=h(4);
a0=h(5);
q4=B;
q3=A*B+a3*B;
q2=A^2*B+a3*A*B+a2*B;
q1=A^3*B+a3*A^2*B+a2*A*B+a1*B;
invP=[q1 q2 q3 q4]
P=inv(invP)
Ab=P*A*invP
Bb=P*B
In this section, it is assumed that the plant to be controlled is given in terms of the
error equation (see Sect. 7.2), i.e., given a plant as in (7.51), it is assumed that the
state x stands for the state error. Hence, the control objective is defined as ensuring
that the state error tends toward zero as time increases, i.e., limt→∞ x(t) = 0.
Consider the single-input state equation in (7.51), in closed-loop with the
following controller:
. /
K = k 1 k 2 . . . kn ,
ẋ = (A − BK)x. (7.75)
This state equation has no input like that in (7.40). Hence, the stability criterion
for (7.40) can be applied to (7.75). This means that the vector x(t), the solution
of (7.75), satisfies limt→∞ x(t) = 0 if, and only if, all eigenvalues of the matrix
A − BK have a strictly negative real part. However, from the point of view of a
practical application, this is not enough as a good closed-loop performance is also
required. It is important to stress that the waveform of the solution x(t) of (7.75)
depends on the exact location of the eigenvalues of the matrix A − BK. Hence, it
must be possible to arbitrarily assign the eigenvalues of the matrix A − BK. As the
row vector K can be chosen as desired, it is of interest to know how to choose K
such that the eigenvalues of A − BK are assigned as desired. The solution to this
problem is presented in the following.
Consider the linear transformation (7.68), (7.69), and substitute it in (7.75) to
obtain:
where Ā and B̄ are given as in (7.70) and (7.67). Note that K̄ x̄ is a scalar given as:
, which, according to (7.67), only affects the last row of (7.76); hence, the following
can be written:
Note that, according to (7.70) and (7.76), the following can be written:
Ā − B̄ K̄ = P AP −1 − P BKP −1 = P (A − BK)P −1 ,
i.e., the matrices Ā − B̄ K̄ and A − BK satisfy (7.30); hence, they possess identical
eigenvalues. According to previous sections, the eigenvalues λ of Ā − B̄ K̄ satisfy:
where λ̄i , i = 1, . . . , n stand for the desired eigenvalues and these are proposed
by the designer. It is stressed that when a complex conjugate desired eigenvalue is
proposed, then its corresponding complex conjugate pair must also be proposed.
This is to ensure that all the coefficients āi , i = 0, 1, . . . , n − 1 are real, which
also ensures that all the gains K̄ and K are real. The following is the procedure [1],
chapter 7, suggested to compute the vector of the controller gains K, which assigns
the desired eigenvalues for the closed-loop matrix A − BK.
• Check that the state equation in (7.51) is controllable. If this is the case, proceed
as indicated in the remaining steps. Otherwise, it is not possible to proceed.
• Find the polynomial:
• Propose the desired closed-loop eigenvalues λ̄1 , λ̄2 , . . . , λ̄n . If some of them are
complex, then also propose its corresponding complex conjugate pair as one of
the desired eigenvalues.
486 7 The State Variables Approach
• Compute:
n
(λ − λ̄i ) = λn + ān−1 λn−1 + · · · + ā1 λ + ā0 .
i=1
• Compute:
. /
K̄ = ā0 − a0 ā1 − a1 . . . ān−1 − an−1 .
(λ − λ̄1 )(λ − λ̄2 )(λ − λ̄3 )(λ − λ̄4 ) = λ4 + ā3 λ3 + ā2 λ2 + ā1 λ + ā0 ,
Using these values and those obtained in (7.72), K̄ is computed according to (7.77),
i.e.,:
. /
K̄ = 846 2594 1933.3 113.5 .
Finally, using this and matrix P shown in (7.73) the vector of the controller gains K
is computed using K = K̄P :
. /
K = −1.5997 −4.9138 −154.4179 −14.1895 .
0.8
0.6
rad
0.4
0.2
0
0 1 2 3 4 5 6 7 8 9 10
Fig. 7.5 Simulation result for the state z1 of the Furuta pendulum
4
rad/s
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.3
0.2
rad
0.1
0
−0.1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
2
0
rad/s
−2
−4
−6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t [s]
Fig. 7.6 Simulation results for the Furuta pendulum. Top: z2 . Middle: z3 . Bottom: z4
488 7 The State Variables Approach
u(1)+u(2)+u(3)+u(4) -K
A ⇒ A, B ⇒ B, [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1] ⇒ C, [0; 0; 0; 0] ⇒ D,
and [0 0 0.3 0] as initial conditions. To obtain these results, one has to proceed
as follows: (1) Execute the above MATLAB code to compute all the required
parameters. (2) Run the simulation in Fig. 7.7. (3) Execute the following MATLAB
code in an m-file:
nn=length(States(:,1));
n=nn-1;
Ts=1/n;
t=0:Ts:1;
figure(1)
subplot(3,1,1)
plot(t,States(:,1),’b-’);
ylabel(’rad’)
figure(2)
subplot(3,1,1)
plot(t,States(:,2),’b-’);
ylabel(’rad/s’)
subplot(3,1,2)
plot(t,States(:,3),’b-’);
ylabel(’rad’)
subplot(3,1,3)
plot(t,States(:,4),’b-’);
ylabel(’rad/s’)
xlabel(’t [s]’)
At this point, Figs. 7.5 and 7.6 are drawn.
7.12 State Observers 489
In this section, it is assumed again that the plant to be controlled is given in terms of
the error equation (see Sect. 7.2), i.e., given a plant as in (7.51), it is assumed that the
state x stands for the error state. Hence, the control objective is defined as ensuring
that the state error tends toward zero as time increases, i.e., limt→∞ x(t) = 0.
As pointed out in Sect. 7.1, the state x is composed of variables that are internal
to the system; hence, they are not known in general. On the other hand, the
output y represents a variable that is always known. This means that the practical
implementation of the controller (7.74) is only possible if the complete state is
measured. Because of this, it is important to know an estimate of the state x(t),
which is represented by 6 x (t), allowing a controller to be constructed of the form:
lim 6
x (t) = x(t).
t→∞
6̇
x = (A − LC)6
x + Ly + Bu, (7.79)
x̃˙ = Ax − (A − LC)6
x − Ly.
Using y = Cx:
Using the results in Sect. 7.6, it is concluded that limt→∞ x̃(t) = 0; hence,
limt→∞ 6 x (t) = x(t) if, and only if, all the eigenvalues of matrix A − LC have
strictly negative real parts. Hence, the only problem that remains is how to select
490 7 The State Variables Approach
the gain column vector L such that all the eigenvalues of matrix A − LC have
strictly negative real parts and that they can be arbitrarily assigned. This problem is
solved as follows:
Theorem 7.5 ([1], pp. 358) The state of the dynamical equation in (7.51) can be
estimated using the observer in (7.79) and all the eigenvalues of matrix A − LC can
be arbitrarily assigned, if, and only if, (7.51) is observable.
Again, the complex eigenvalues must appear as complex conjugate pairs. To
explain the above result, the following theorem is useful.
Theorem 7.6 ([1], pp. 195) Consider the following dynamical equations:
ẋ = Ax + Bu, (7.80)
y = Cx,
ż = −AT z + C T u, (7.81)
γ = B z,
T
x̃˙ = Ax̃, x̃ = x − 6
x.
7.13 The Separation Principle 491
If all the eigenvalues of the matrix A have negative real parts, then limt→∞ x̃(t) = 0
is ensured and the observer works. However, this result is very limited because it is
constrained to be used only with plants that are open-loop asymptotically stable.
Moreover, even in such a case, the convergence speed of x̃ → 0 depends on the
eigenvalue locations of the open-loop plant, i.e., it is not possible to render such a
convergence arbitrarily fast. Note that, according to the previous arguments in this
section, these drawbacks are eliminated when using the observer in (7.79). Also see
Example 7.6.
ẋ = Ax + Bu, (7.82)
y = Cx,
and an observer:
6̇
x = (A − LC)6
x + Ly + Bu, (7.83)
u = −K6
x = −(k16
x1 + k26
x2 + · · · + kn6
xn ), (7.84)
the question arises regarding how the stability of the closed-loop sys-
tem (7.82), (7.83), (7.84), is affected, i.e., it is important to verify whether ensuring
that limt→∞ 6 x (t) = x(t) and limt→∞ x(t) = 0 are enough to ensure stability
observer
492 7 The State Variables Approach
of the complete closed-loop system. The answer to this question is known as the
separation principle, which claims the following:
Fact 7.12 ([1], pp. 367) The eigenvalues of the closed-loop system (7.82), (7.83),
(7.84), are the union of the eigenvalues of matrices A − BK and A − LC.
This means that the eigenvalues of the observer are not affected by the feedback
in (7.84) and, at least in what concerns the eigenvalues, there is no difference
between feeding back the estimate 6 x (t) and feeding back the actual state x(t).
However, the reader must be aware that the system’s transient response is often
different if x(t) is employed or 6
x (t) is employed to compute the input. The important
fact is that both limt→∞ 6 x (t) = x(t) and limt→∞ x(t) = 0 are still true and the
complete closed-loop system is stable. Thus, the design of the vector of controller
gains K and the vector of gains L for the observer can be performed independently
of each other.
Example 7.10 Consider the DC motor in Example 7.7, i.e., consider the dynamical
equation:
where it is assumed that the output is the position whereas velocity cannot be
measured; hence, it shall be estimated using an observer. Suppose that it is desired to
control the motor to reach a constant position, i.e., the desired values of the position
and velocity are:
x1d = θd , x2d = 0,
where θd is a constant representing the desired position and the desired velocity is
zero because the desired position is constant. Defining the state variables as:
and computing x̃˙1 = ẋ1 − ẋ1d = x2 = x̃2 , x̃˙2 = ẋ2 = θ̈ , the following dynamical
equation is obtained:
where γ is the new output and the matrix A and vectors B, C, are defined as
in (7.85). Note that the measured output is now the position error γ = x̃1 . From this
point on, the numerical values of the motor controlled in Chap. 11 are considered,
i.e.,:
7.13 The Separation Principle 493
nkm b
k= = 675.4471, a= = 2.8681. (7.87)
J J
The corresponding observer is designed in the following. In the Example 7.7, it was
shown that the dynamical equation in (7.85) is observable; hence, the dynamical
equation in (7.86) is also observable. According to theorem 7.6, this implies that
pairs (−AT , C T ) and (AT , C T ) are controllable, i.e., that the following matrices
have the rank n = 2:
. / . /
C T −AT C T , C T AT C T ,
because the sign “−” of the matrix A does not affect the linear independence of
these columns (see Sect. 7.4). Using the numerical values in (7.87), the roots of the
polynomial det(λI − AT ) are computed:
λ1 = 0, λ2 = −2.8681.
(λ − λ1 )(λ − λ2 ) = λ2 + a1 λ + a0 ,
a1 = 2.8681, a0 = 0. (7.88)
q2 = C T ,
q1 = AT C T + a1 C T .
Using the numerical values in (7.87), (7.88), in addition to the matrix A and vector
C defined in (7.85) the following is obtained:
2.8681 1.0000
P −1 = ,
1.0000 0
hence:
0 1.0000
P = . (7.89)
1.0000 −2.8681
494 7 The State Variables Approach
Using these data and values in (7.88), the vector of gains K̄ is computed according
to (7.77):
. /
K̄ = 15000 247 .
Using this and the matrix P shown in (7.89), the vector of the controller gains K is
computed as K = K̄P and it is assigned L = K T :
247
L= . (7.91)
14291
On the other hand, using a similar procedure to those in examples 7.14.1 and 7.14.2,
it is found that the vector of the controller gains:
. /
K = 1.6889 0.0414 , (7.92)
assigns at:
the eigenvalues of the matrix A − BK. Note that the gains in (7.92) are identical
to the proportional and velocity feedback gains for the controller designed and
experimentally tested in Sect. 11.2.1 Chap. 11, where the closed-loop poles are
assigned at the values in (7.93). The above computations have been performed by
executing the following MATLAB code in an m-file:
clc
k=675.4471;
a=2.8681;
A=[0 1;
0 -a];
B=[0;
k];
7.13 The Separation Principle 495
C=[1 0];
v=eig(A’);
h=conv([1 -v(1)],[1 -v(2)]);
a0=h(3);
a1=h(2);
q2=C’;
q1=A’*C’+a1*C’;
invP=[q1 q2]
P=inv(invP)
lambda1d=-150;
lambda2d=-100;
hd=conv([1 -lambda1d],[1 -lambda2d]);
a0b=hd(3);
a1b=hd(2);
Kb=[a0b-a0 a1b-a1];
K=Kb*P;
L=K’
v=eig(A);
h=conv([1 -v(1)],[1 -v(2)]);
a0=h(3);
a1=h(2);
q2=B;
q1=A*B+a1*B;
invP=[q1 q2]
P=inv(invP)
lambda1d=-15.4+30.06*j;
lambda2d=-15.4-30.06*j;
hd=conv([1 -lambda1d],[1 -lambda2d]);
a0b=hd(3);
a1b=hd(2);
Kb=[a0b-a0 a1b-a1];
K=Kb*P
F=[L B];
Finally, it is stressed that the observer to construct is given as:
1
0.5
0
−0.5
rad
−1
−1.5
−2
−2.5
0 0.05 0.1 0.15 0.2 0.25 0.3
100
50
rad/s
−50
−100
0 0.05 0.1 0.15 0.2 0.25 0.3
t [s]
Fig. 7.9 Simulation results. Use of the observer in (7.94) to control a DC motor Top figure:
continuous x̃1 , dashed z1 Bottom figure: continuous x̃2 = x2 , dashed z2
where L and K take the values indicated in (7.91) and (7.92). Note that the controller
must employ z1 , i.e., the estimate of x̃1 , despite x̃1 being a known measured variable.
This is because the theory above assumes that the whole state is to be estimated and
fed back. In this respect, it is worth saying that the so-called reduced-order observers
also exist that estimate only the unknown part of the estate if the other states are
known. The reader is referred to [1] for further details.
In Fig. 7.9, some simulation results are shown when using the observer in (7.94)
and the feedback in (7.95) together with the gains in (7.91) and (7.92) to control a
DC motor whose parameters are shown in (7.87). The desired position is θd = 2, the
observer initial conditions are z(0) = [0 0]T , whereas θ (0) = 0 (i.e., x̃1 (0) = −2)
and θ̇ (0) = 2. It is observed that the estimates z1 and z2 asymptotically converge to
the real values x̃1 and x2 and that both x̃1 and x2 converge to zero, i.e., θ converges
to θd . It is interesting to realize that this convergence is achieved before the motor
finishes responding. This has been accomplished by selecting the eigenvalues of the
matrix A − LC (shown in (7.90)) to be much faster than the eigenvalues assigned to
the matrix A − BK (shown in (7.93)). This is a criterion commonly used to assign
the eigenvalues for an observer.
In Fig. 7.10 the MATLAB/Simulink diagram used to perform the above simula-
tions is presented. Block step represents θd = 2. Block DC motor has the following
parameters:
7.13 The Separation Principle 497
Step
Add
Scope
Estados
Observer
Fcn Gain
u(1)+u(2) -K
Fig. 7.10 MATLAB/Simulink diagram for use of the observer in (7.94) to control a DC motor
A ⇒ A, B ⇒ B, [1 0; 0 1] ⇒ C, [0; 0] ⇒ D,
and [0 2] as initial conditions. The observer block has the following parameters:
A − L ∗ [1 0] ⇒ A, F ⇒ B, [1 0; 0 1] ⇒ C, [0 0; 0 0] ⇒ D,
ż = Az + Bw, (7.96)
⎡ ⎤ ⎡ ⎤
0 1 0 0
km
A = ⎣ d 11 mg 0 0⎦, B = ⎣ d 12 ⎦ .
R
d 21 mg 0 0 d 22
a = d 11 mg, b = d 21 mg,
km km
c = d 12 , d = d 22 .
R R
The following matrix has the form:
⎤ ⎡
. 0c 0 /
Co = B AB A2 B = ⎣ c 0 ac ⎦ .
d 0 bc
where:
−1 d 11 d 12 1 d22 −d12
D = = ,
d 21 d 22 d11 d22 − d12 d21 −d21 d11
, which correspond to parameters of the inertia wheel pendulum that is built and
experimentally controlled in Chap. 16. Thus:
⎡ ⎤ ⎡ ⎤
0 1.0000 0 0
A = ⎣ 86.5179 0 0⎦, B = ⎣ −1.2758 ⎦ .
−86.5179 0 0 245.6998
Using these data, the roots of the polynomial det(λI − A) are found to be:
λ1 = 0, λ2 = 9.3015, λ3 = −9.3015.
(λ − λ1 )(λ − λ2 )(λ − λ3 ) = λ3 + a2 λ2 + a1 λ + a0 ,
a2 = 0, a1 = −86.5179, a0 = 0. (7.97)
i.e.,
⎡ ⎤
0 −910.6662 −4.7287
P = 10−5 × ⎣ −78379.7677 0 0 ⎦. (7.98)
0 −78379.8067 −0.0002
Finally, to verify the expressions in (7.70), the following products are performed:
⎡ ⎤ ⎡ ⎤
0 1.0000 0 0
P AP −1 = ⎣ −0.0000 0 1.0000 ⎦ , PB = ⎣0⎦.
0 86.5179 0 1
Note that these matrices have exactly the forms shown in (7.67) for Ā = P AP −1
and B̄ = P B.
500 7 The State Variables Approach
Now, the vector of controller gains K is computed. It is desired that using the
controller (7.74) (with x = z and u = w), the eigenvalues of matrix A − BK
are assigned at:
These data and the values obtained in (7.97) are employed to compute the vector of
the gains K̄ according to (7.77):
. /
K̄ = 183.44 440.91 12.23 .
Finally, using this and the matrix P shown in (7.98) the vector of the controller gains
K is computed using K = K̄P as:
. /
K = −345.5910 −11.2594 −0.0086 ,
which, except for some rounding errors, is the vector of the controller gains used
to experimentally control the inertia wheel pendulum in Chap. 16. Some simulation
results are presented in Fig. 7.11 where z1 (0) = 0.3 and z2 (0) = z3 (0) = 0 were
set as initial conditions. It is observed that the state variables converge to zero, as
desired. These simulations were performed using the MATLAB/Simulink diagram
shown in Fig. 7.12. The inertia wheel pendulum block has the following parameters:
A ⇒ A, B ⇒ B, [1 0 0; 0 1 0; 0 0 1] ⇒ C, [0; 0; 0] ⇒ D,
and [0.3 0 0] as initial conditions. The results in Fig. 7.11 were obtained following
these steps: 1) Execute the following MATLAB code in an m-file to obtain all the
above computations:
clc
A=[0 1 0;
86.5179 0 0;
-86.5179 0 0];
B=[0;
-1.2758;
7.14 Case Study: The Inertia Wheel Pendulum 501
0.6
0.4
rad
0.2
0
−0.2
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0
rad/s
−2
−4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1500
1000
rad/s
500
0
−500
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
t [s]
Fig. 7.11 Simulation results when using the gain vector K = [−345.5910 − 11.2594 − 0.0086]
to control the inertia wheel pendulum. Top: z1 . Middle: z2 . Bottom: z3
Fig. 7.12
MATLAB/Simulink diagram
used to simulate the control of
the inertia wheel pendulum IWP Scope
u(1)+u(2)+u(3) -K
245.6998];
U=[B A*B A^2*B];
det(U)
v=eig(A);
f=conv([1 -v(1)],[1 -v(2)]);
h=conv(f,[1 -v(3)]);
a2=h(2);
a1=h(3);
a0=h(4);
q3=B;
502 7 The State Variables Approach
q2=A*B+a2*B;
q1=A^2*B+a2*A*B+a1*B;
invP=[q1 q2 q3]
P=inv(invP)
Ab=P*A*invP
Bb=P*B
lambda1d=-5.8535+17.7192*j;
lambda2d=-5.8535-17.7192*j;
lambda3d=-0.5268;
fd=conv([1 -lambda1d],[1 -lambda2d]);
hd=conv(fd,[1 -lambda3d]);
a2b=hd(2);
a1b=hd(3);
a0b=hd(4);
Kb=[a0b-a0 a1b-a1 a2b-a2];
K=Kb*P
eig(A-B*K)
2) Run the simulation in Fig. 7.12. 3) Execute the following MATLAB code in an
m-file:
nn=length(States(:,1));
n=nn-1;
Ts=1/n;
t=0:Ts:1;
figure(1)
subplot(3,1,1)
plot(t,States(:,1),’b-’);
ylabel(’rad’)
subplot(3,1,2)
plot(t,States(:,2),’b-’);
ylabel(’rad/s’)
subplot(3,1,3)
plot(t,States(:,3),’b-’);
ylabel(’rad/s’)
xlabel(’t [s]’)
At this point, Fig. 7.11 is drawn.
7.15 Summary
The mathematical models used in the state variable approach are sets of first-
order differential equations that must be solved simultaneously. Hence, the analysis
and design are performed in the time domain and the Laplace transform is no
7.16 Review Questions 503
longer used. This allows the study of nonlinear control systems, i.e., those systems
represented by nonlinear differential equations (see Chap. 16 for an example of
such applications). Recall that the Laplace transform cannot be employed when the
differential equations are nonlinear.
Although an equivalence exists between the state space representation and the
transfer function, the former is more general. This can be seen in the fact that
the transfer function only represents the controllable and observable part of a state
space representation. This means that there are some parts of a system that cannot
be described by the transfer function. However, if a system is controllable and
observable, the analysis and the design of the control system are simplified. In fact,
there are powerful results for this case, which are presented in Sects. 7.11 and 7.12.
An advantage of the state space approach is that it gives simple solutions to
problems that have a more complicated result when using the transfer function
approach. Two examples of this situation are the experimental prototypes that
are controlled in Chaps. 15 and 16, where two variables have to be controlled
simultaneously: the arm and the pendulum positions (in Chap. 15) and the pendulum
position and the wheel velocity (in Chap. 16). Another advantage of the state space
approach is that it allows us to develop a general methodology to obtain a linear
approximate model of nonlinear systems (see Sect. 7.3 and Chaps. 13, 15 and 16).
7.17 Exercises
1. Say what you understand by state and propose a physical system to indicate its
state.
2. Verify that the following dynamical equations are controllable:
⎡ ⎤ ⎡ ⎤
213 0 . /
A = ⎣5 9 7⎦, B = ⎣0⎦, C= 472 ,
028 2
⎡ ⎤ ⎡ ⎤
0 1 0 0 . /
A = ⎣ 0 −20 50 ⎦ , B = ⎣ 0 ⎦, C= 100 ,
0 −5 −250 100
⎡ ⎤ ⎡ ⎤
0 1 0 0 0
⎢0 0 −0.5 0⎥ ⎢ 1 ⎥ . /
A=⎢
⎣0
⎥, B=⎢ ⎥
⎣ 0 ⎦, C= 1010 ,
0 0 1⎦
0 0 50 0 −5
bs
Y (s) = U (s), b > 0, a > 0.
s+a
In fact, y(t) is known as the dirty derivative of u(t) and it is often employed
to replace velocity measurements in mechanical systems. To implement this
filter in practice, the corresponding dynamical equation is obtained. Find such
a dynamical equation. Recall that u(t) must be the input. Can you use frequency
response arguments to select a value for a?
6. Find a dynamical equation useful for implementing the lead controller:
U (s) s+b
= , 0 < b < c,
E(s) s+c
where U (s) is the plant input and E(s) is the system error. Compare with the
result in Sect. F.3.
7. Consider the following system without input:
ẋ = Ax, x ∈ R n ,
Recall (7.57) and (7.56) to explain that, in general, the following stands for the
solution of the closed-loop state equation:
ẋ = (A − BK)x, x ∈ R n , K = [k1 , . . . , kn ],
can be real, complex, different or repeated. In the case of n real and different
eigenvalues, λi , i = 1, . . . , n, n linearly independent eigenvectors wi , i =
1, . . . , n exist. Thus, an invertible n × n matrix:
Q−1 = [w1 w2 . . . wn ],
z = Qx,
ẋ = Ax, ż = Ez,
i.e., that:
⎡ ⎤
eλ1 t z1 (0)
⎢ eλ2 t z2 (0) ⎥
⎢ ⎥
z(t) = ⎢ .. ⎥,
⎣ . ⎦
eλn t zn (0)
and:
⎡ ⎤
eλ1 t 0 · · · 0
⎢ 0 eλ2 t · · · 0 ⎥
⎢ ⎥
x(t) = Q−1 ⎢ . .. . . .. ⎥ Qx(0).
⎣ .. . . . ⎦
0 0 · · · e nt
λ
9. Consider the matrix Ā and the vector B̄, defined in (7.67), when n = 5.
• Suppose that āi = 0 for i = 0, 1, . . . , 4. Show that:
7.17 Exercises 507
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤
0 0 0 0 1
⎢0⎥ ⎢0⎥ ⎢0⎥ ⎢1⎥ ⎢0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
B̄ = ⎢ 0 ⎥ , ĀB̄ = ⎢ 0 ⎥ , Ā2 B̄ = ⎢ 1 ⎥ , Ā3 B̄ = ⎢ 0 ⎥ , Ā4 B̄ = ⎢ 0 ⎥ ,
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣0⎦ ⎣1⎦ ⎣0⎦ ⎣0⎦ ⎣0⎦
1 0 0 0 0
i.e., these vectors are linearly independent, the matrix [B̄, ĀB̄, Ā2 B̄, Ā3 B̄,
Ā4 B̄] has a determinant that is different from zero, and, thus, the system
in (7.67) is controllable.
• Suppose that āi = 0 for i = 0, 1, . . . , 4. Show that:
⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤ ⎡ ⎤
0 0 0 0 1
⎢0⎥ ⎢0⎥ ⎢0⎥ ⎢1⎥ ⎢∗⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
B̄ = ⎢ 0 ⎥ , ĀB̄ = ⎢ 0 ⎥ , Ā2 B̄ = ⎢ 1 ⎥ , Ā3 B̄ = ⎢ ∗ ⎥ , Ā4 B̄ = ⎢ ∗ ⎥ ,
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣0⎦ ⎣1⎦ ⎣∗⎦ ⎣∗⎦ ⎣∗⎦
1 ∗ ∗ ∗ ∗
where the symbol “∗” stands for some numerical values depending on āi
for i = 0, 1, . . . , 4. Show that these vectors are still linearly independent,
i.e., that the matrix [B̄, ĀB̄, Ā2 B̄, Ā3 B̄, Ā4 B̄] has a determinant that is
different from zero; thus, the system in (7.67) is controllable.
10. (Taken from [1]) A set of n functions of time fi (t), i = 1, . . . , n, is said to be
linearly dependent on the interval [t1 , t2 ] if there are numbers α1 , α2 , . . . , αn ,
not all zero such that:
are linearly dependent on [0, 1] and on [−1, 0]. However, they are linearly
independent of [−1, 1].
11. Consider the results in Example 7.7.
0 1
• Recalling that eAt = L−1 (sI − A)−1 show that:
b
1 J
1 − e− J t
eAt
= b
b
.
0 e− J t
508 7 The State Variables Approach
• Show that det eAt = 0 for all t ∈ R, i.e., that eAt is nonsingular for all
t ∈ R.
• Define:
f1 (t)
F (t) = = eAt B. (7.99)
f2 (t)
Use the definition in the previous exercise to prove that f1 (t) and f2 (t) are
linearly independent for all t ∈ R.
• The following theorem is taken from [1]. Let fi (t), i = 1, 2, . . . , n, be 1 × p
continuous functions defined on [t1 , t2 ]. Let F(t) be the n × p matrix with
fi (t) as its i−th row. Define:
t2
W (t1 , t2 ) = F (t)F T (t)dt.
t1
Then, f1 (t), f2 (t), . . . , fn ((t), are linearly independent of [t1 , t2 ] if, and
only if, the n × n constant matrix W (t1 , t2 ) is nonsingular.
Use this theorem to prove that the two scalar functions defining the two
rows of matrix eAt B defined in the previous item are linearly independent of
t ∈ R.
• The following theorem is taken from [1]. Assume that for each i, fi is
analytic on [t1 , t2 ]. Let F (t) be the n × p matrix with fi as its i−th row,
and let F (k) (t) be the k−th derivative of F (t). Let t0 be any fixed point in
[t1 , t2 ]. Then, the fi s are linearly independent of [t1 , t2 ] if, and only if, the
rank of the following matrix, with an infinite number of columns, is n:
. . . .
F (t0 ) .. F (1) (t0 ) .. · · · .. F (n−1) (t0 ) .. · · · .
.. (1)
Using the definition in (7.99), show that F (t0 ) . F (t0 ) , n = 2, t0 = 0,
has rank 2.
e =
d At
• Using the facts that all the entries of eAt B are analytic functions, dt
e A, A , for m ≥ n, can be written as a linear combination of
At m
k = 16.6035, a = 3.3132, ρ = 5.
References 509
References
1. C.-T. Chen, Linear system theory and design, Holt, Rinehart, and Winston, New York, 1984.
2. C. Ray Wylie, Advanced engineering mathematics, McGraw-Hill, 1975.
3. W. L. Brogan, Modern control theory, 3rd. edition, Prentice Hall, Upper Saddle River, 1991.
4. E. Kreyszig, Advanced engineering mathematics, Vol. 1, 3rd. edition, John Wiley and Sons, New
Jersey, 1972.
5. M. R. Spiegel, Mathematical handbook of formulas and tables, McGraw-Hill, Schaum series,
New York, 1974.
6. C.-T. Chen, Linear system theory and design, Oxford University Press, New York, 1999.
Chapter 8
Advanced Topics in Control
Consider the closed-loop control system shown in Fig. 8.1. The open-loop transfer
function G(s) is assumed to be given as the cascade connection of the controller
Gc (s) and the plant Gp (s), i.e., G(s) = Gc (s)Gp (s). The system error is defined
as e(t) = r(t) − c(t), where e(t) = L−1 {E(s)}, r(t) = L−1 {R(s)} and c(t) =
L−1 {C(s)}.
Some results are presented in the following explaining some intrinsic limitations
of the transient response of closed-loop classical control systems. These limitations
are due to the structure of both the plant and the controller when connected, as in
Fig. 8.1. This means that such limitations may be avoided if a different structure for
the closed-loop system is chosen.
The proof for (8.1) is immediate from Table 4.15, in Sect. 4.4, concerning the
steady-state error when the reference is a step signal. On the other hand, it was
also shown in Sect. 4.4 that the system error is given as:
1
E(s) = R(s). (8.3)
1 + G(s)
Dividing by s yields:
E(s) 1
= R(s).
s s(1 + G(s))
k(s − z1 )(s − z2 ) · · · (s − zm )
G(s) = , (8.5)
s i (s − p1 )(s − p2 ) · · · (s − pn−i )
Example 8.1 Consider the following transfer functions used in two different closed-
loop systems whose structure is that in Fig. 8.1:
Note that i = 1 for system (1) and i = 2 for system (2). Hence, according to
Lemma 8.1, the response of system (2) always presents overshoot when a step
reference is applied, but this is not ensured for system (1). As both closed-loop
transfer functions are very similar, it is natural to wonder about these different
conclusions. To answer this question, in Figs. 8.2 and 8.3 the root loci and the
closed-loop time responses corresponding to systems (1) and (2) are presented.
k
There, kpd = 1 and three different values for kd are employed to determine the
corresponding closed-loop poles, which are also indicated in Figs. 8.2 and 8.3. The
closed-loop time responses are shown for these values of kd .
It is observed that for small values of kd , system (1) has two real closed-loop
poles; hence, the closed-loop time response does not exhibit overshoot. In the case
of system (2), it has two complex conjugate closed-loop poles for small values of
kd ; hence, the closed-loop time response exhibits overshoot. As observed in Fig. 8.2,
the explanation for these different behaviors relies on the fact that the root locus for
system (1) belongs to the real axis for small values of kd , which results from the
real open-loop poles at s = 0 and s = −0.5, whereas the root locus for system (2)
does not belong to the real axis for small values of kd , because of the two open-loop
poles at s = 0.
For medium values of kd , both systems have complex conjugate closed-loop
poles; hence, the time response of both systems exhibits overshoot. Finally, for
large values of kd both systems have two real closed-loop poles, but, despite this,
both of them present a time response with overshoot.1 Thus, it is corroborated that
response of system (2) always presents overshoot for a step reference, as predicted
in Lemma 8.1.
Figures 8.2 and 8.3 were drawn by executing the following MATLAB code in an
m-file several times:
clc
gp1=tf(8,[1 0.5 0]);
gc1=tf([1 1],1);
figure(1)
rlocus(gc1*gp1);
hold on
kd=0.01;% 0.01, 0.1,0.4
Root Locus
0.8
0.6
0.2
−0.2
−0.4
−0.6
−0.8
−3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 0.5
Real Axis (seconds−1)
(a)
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Time (seconds)
(b)
k
Fig. 8.2 Root locus and closed-loop time response for system (1), when kpd = 1 and kd takes
different values. (a) Closed-loop poles +: kd = 0.01; triangle down: kd = 0.1; triangle up: kd =
0.4. (b) Continuous: kd = 0.01; Dash–dot: kd = 0.1; Dashed: kd = 0.4
plot( -0.3540,0,’b+’,-0.2260,0,’b+’);
%plot(-0.6500,0.6144,’bv’,-0.6500,-0.6144,’bv’);
%plot(-2.3217,0,’b^’,-1.3783,0,’b^’);
gc1=tf(kd*[1 1],1);
M1=feedback(gc1*gp1,1,-1);
pole(M1)
figure(2)
8.1 Structural Limitations in Classical Control 515
Root Locus
1.5
0.5
−0.5
−1
−1.5
−4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0 0.5
Real Axis (seconds−1)
(a)
Step Response
1.8
1.6
1.4
1.2
Amplitude
1
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30
Time (seconds)
(b)
k
Fig. 8.3 Root locus and closed-loop time response for system 2), when kpd = 1 and kd takes
different values. (a) Closed-loop poles. +: kd = 0.01; triangle down: kd = 0.1; triangle up:
kd = 0.55. (b) Continuous: kd = 0.01; Dash-dot: kd = 0.1; Dashed: kd = 0.55
step(M1,30)
grid on
hold on
gp2=tf(8,[1 0 0]);
gc2=tf([1 1],1);
516 8 Advanced Topics in Control
figure(3)
rlocus(gc2*gp2);
hold on
kd=0.01;% 0.01, 0.1, 0.55
plot(-0.0400,0.2800,’b+’,-0.0400,-0.2800,’b+’)
%plot(-0.4000, 0.8,’bv’,-0.4000,-0.8,’bv’)
%plot( -2.8633,0,’b^’,-1.5367,0,’b^’);
gc2=tf(kd*[1 1],1);
M2=feedback(gc2*gp2,1,-1);
pole(M2)
figure(4)
step(M2,30)
grid on
hold on
Example 8.2 Consider the ball and beam system studied and experimentally con-
trolled in Chap. 14. In particular, see the block diagrams in Fig. 14.8. Note that
the open-loop transfer function has two poles at the origin. Thus, overshoot is
unavoidable when a step reference xd is commanded. This is the reason why the
design performed in Sect. 5.2.9, Chap. 5, and experimentally tested in Chap. 14,
propose a desired response with overshoot, i.e., Mp = 25%.
2. For z0 in the right half-plane and a positive step reference R(s) = A/s, A > 0,
the following holds:
∞
c(t)e−z0 t dt = 0. (8.8)
0
8.1 Structural Limitations in Classical Control 517
which is ensured to exist according to the arguments in Appendix A, i.e., see (A.18),
because Re(z0 ) >Re(−α) = −α. Thus, using (8.3) and (8.9):
∞
−z0 t 1 A
e(t)e dt = E(s)|s=z0 = ,
0 1 + G(s) s s=z0
1 A A
= = ,
1 + G(z0 ) z0 z0
because G(p0 ) = ∞, i.e., p0 is a pole of G(s). Thus, (8.7) is retrieved. Finally, the
use of:
G(s)
C(s) = R(s),
1 + G(s)
yields:
∞
−z0 t G(s) A
c(t)e dt = C(s)|s=z0 = ,
0 1 + G(s) s s=z0
G(z0 ) A
= = 0,
1 + G(z0 ) z0
because G(z0 ) = 0, i.e., z0 is a zero of G(s). Thus, (8.8) is retrieved. Note that
the assumption on the open-loop transfer function G(s) with at least one pole at the
origin ensures a zero steady-state error.
Carefully analyzing (8.6), (8.7), (8.8), the authors in [7] arrive at the following
conclusions:
1. If z0 is a negative real number, i.e., it represents a stable zero, then the error must
change sign in order to render the integral in (8.6) negative. Recall that the error
is initially positive. This implies that the transient response must overshoot. In
[7], it is demonstrated that this overshoot is larger as |z0 | is smaller.
518 8 Advanced Topics in Control
is differentially flat if all its states x and the input u can be written as functions of a
variable yf and a finite number of its derivatives [1], i.e.,:
(β)
x = g(yf , ẏf , . . . , yf(α) ), u = h(yf , ẏf , . . . , yf ), (8.10)
for some functions g(·) and h(·). Symbols α and β represent some finite positive
integers and yf is known as the flat output. However, there is no well-defined
procedure to find the flat output in the case of nonlinear systems. As usual, the
differential flatness approach is simplified in the case of linear time invariant
systems. A linear time invariant system:
is differentially flat if it is controllable [2] and the flat output can be found as follows.
Proposition 8.1 ([2]) The flat output of the linear controllable system (8.11) is
proportional to the linear combination of the states obtained from the last row of
the inverse of the controllability matrix Co = [B, AB, A2 B, . . . , An−1 B], i.e.,:
. /. /−1
yf = λ̄ 0 0 . . . 0 1 B AB A2 B . . . An−1 B x, (8.12)
x̄ = P x, (8.14)
520 8 Advanced Topics in Control
According to (8.13), if we define the flat output as yf = λx̄1 , for a nonzero constant
scalar λ, we can write:
⎡ ⎤
yf
⎢ ⎥
⎢ ẏf ⎥
1⎢ ⎥
x̄ = ⎢ ÿf ⎥.
λ⎢
⎢ .. ⎥
⎥
⎣ . ⎦
(n−1)
yf
where g(·) is an n-dimensional linear function in this case. Moreover, from the last
row in (8.13) we have:
1
u= a0 yf + a1 ẏf + a2 ÿf + · · · + an−2 yf(n−2) + an−1 yf(n−1) + yf(n) .
λ
(n)
= h(yf , ẏf , . . . , yf ). (8.17)
The following remarks are in order. The latter expressions and (8.10) imply that the
controllable system in (8.11) is differentially flat. It is clear from (8.16) that the flat
output, yf , and its first n − 1 time derivatives can be written in terms of the state x in
this case. Furthermore, according to (8.17), the controllable linear system in (8.11)
can be represented by the following transfer function without zeros:
8.2 Differential Flatness 521
Yf (s) λ
= n .
U (s) s + an−1 s n−1 + an−2 s n−2 + · · · + a2 s 2 + a1 s + a0
As shown in Chap. 15, this is a useful representation for designing a state feedback
controller u = −Kx for (8.11) using classical control design tools to select the gain
vector K. On the other hand, the following can be written:
. /−1
P = q1 · · · qn−2 qn−1 qn = (Co F )−1 = F −1 Co−1 ,
⎡ ⎤
a1 a2 · · · an−2 an−1 1
⎢ a a ··· a ⎥
⎢ 2 3 n−1 1 0 ⎥
⎢ ⎥
⎢ a3 a4 · · · 1 0 0⎥
F =⎢
⎢ .. .. . . . .. .. ⎥
⎥,
⎢ . . . .. . .⎥
⎢ ⎥
⎣ an−1 1 · · · 0 0 0⎦
1 0 ··· 0 0 0
where:
⎡ ⎤
0 ···
⎢0 ··· ⎥
⎢ ⎥
⎢ ⎥
Cof T (F ) ⎢0 ··· ⎥
F −1 = , det(F ) = μ, Cof (F ) = ⎢
⎢ .. .. .. .. .. .. ⎥
⎥,
det(F ) ⎢. . . . . .⎥
⎢ ⎥
⎣0 ··· ⎦
μ̄ ···
One important application of the describing function method is the study of limit
cycles in “almost” linear systems. Roughly speaking, a limit cycle can be understood
as a system sustained oscillation with respect to time. For our purposes an “almost”
linear system is a closed loop system with two components (see Fig. 8.4): one
of the components, G(s), is a linear, time-invariant system, whereas the second
component, c = f (e), is a “static” hard nonlinearity. A “static” hard nonlinearity
is a nonlinear, time-invariant function that is not continuously differentiable, whose
description does not involve any differential equation.
–d
e
d
k
8.3 Describing Function Analysis 523
0
c(t)
0 t1 T time
4
According to Fig. 8.5, the input and the output of the nonlinearity have the
waveforms shown in Fig. 8.6. It is clear that the output of the nonlinearity is periodic;
hence, it admits the Fourier series expansion:
∞
a0
c(t) = + (an cos(nωt) + bn sin(nωt)) , (8.19)
2
n=1
T /2
2 2π
a0 = c(t)dt, ω= .
T −T /2 T
Note that, according to Fig. 8.6, c(t) is an odd function, which implies that
a0 = 0.2 On the other hand, if it is assumed that the magnitude of the linear system
G(j ω) has low-pass filter properties, then the high order harmonics in (8.19) can be
neglected to approximate c(t) only by the fundamental frequency component, i.e.,:
2 Thisis because the dead zone characteristic presented in Fig. 8.5 is odd. Furthermore, a0 = 0 for
any odd “static” hard nonlinearity.
524 8 Advanced Topics in Control
T /2
2
b1 = c(t) sin(ωt)dt.
T −T /2
From these expressions, it is clear that a1 = 0 because c(t) is an odd function. Thus,
the following can be written:
c(t) ≈ b1 sin(ωt).
where ωt1 = arcsin Aδ and cos θ = 1 − sin2 θ have been used. According to
the frequency response approach, any system component can be represented as the
ratio between the output amplitude, i.e., b1 , and the input amplitude, i.e., A. This
means that the dead zone nonlinearity can be represented by the frequency response
“transfer function”:
⎡ ⎤
2
b1 2k ⎣ π δ δ δ ⎦.
N (A) = = − arcsin − 1−
A π 2 A A A
N(A) is called the describing function of the dead zone nonlinearity. We stress that
this “transfer function” is real, positive, and frequency independent, but dependent
on the input amplitude A. Moreover, the maximal value is N (A) = k > 0, which is
reached as A → ∞. The minimal value tends toward zero and it is approached as
A → δ.
On the other hand, given a linear time invariant, negative feedback, closed-
loop system with open-loop transfer function G(s)H (s), the closed loop poles
satisfy 1 + G(s)H (s) = 0, which can be rearranged to write G(s)H (s) = −1.
According to the Nyquist stability criterion, if we replace s = j ω such that
8.3 Describing Function Analysis 525
G(j ω)H (j ω) = −1 has a solution3 for a nonzero ω, this means that that there are
imaginary closed-loop poles. Thus, a sustained oscillation exists and the oscillation
frequency ω is represented by the imaginary part of these closed-loop poles. Based
on these arguments, going back to Fig. 8.4 and replacing the nonlinearity with
its frequency response transfer function, N(A), it is concluded that the condition
N(A)G(j ω) = −1 or, equivalently:
1
G(j ω) = − , (8.20)
N(A)
indicates that a sustained oscillation may exist.4 The condition (8.20) is commonly
tested graphically by verifying that the polar plot of G(j ω) and the plot of −1/N(A)
intersect at some point. Recall that in the case of a dead zone nonlinearity N (A) is
real and positive. Hence, −1/N(A) is real and negative. Thus, according to the
above discussion, a limit cycle may exist if the polar plot of G(j ω) intersects the
negative real axis in the open interval (−∞, −1/k). The oscillation frequency and
the amplitude of the oscillation are found as the values of ω, in G(j ω), and A, in
−1/N(A), at the point where these plots intersect.
As an application example consider the closed loop system in Fig. 8.7 where:
+ + τ (s) Y(s)
d(a+bh) 1
β s2
s2 – b
+ +
k vs
k p + k ds
3 This implies that point (−1, j 0) belongs to the polar plot of G(j ω)H (j ω), i.e., the closed loop
system is marginally stable.
4 Note that because of the approximate nature of the method the predicted results are valid only to
a certain extent.
526 8 Advanced Topics in Control
Bode Diagram
60
50
Magnitude (dB)
40
30
20
10
0
−10
−20
−90
Phase (deg)
−180
−270
−360
100 101 102
Frequency (rad/s)
Fig. 8.9 Bode diagrams of G(s) in (8.21) when using the numerical values in Table 8.1. (a)
Continuous. (b) Dashed. (c) Dash–dot. (d) Dotted
Note that a dead zone “static” nonlinearity exists where it is assumed that:
δ = 0.0115, k = 1.
Using some block algebra, the block diagram in Fig. 8.8 is obtained where e =
τ (s) and:
Hence, the closed loop system at hand has been written in the form shown in
Fig. 8.4, an important step in applying the describing function method. Also note
that G(s) has four poles and only three zeros. Thus, its magnitude behaves as a
low-pass filter. Recall that this is an important condition for the application of the
describing function method. In Fig. 8.9, the Bode diagrams of the transfer function
in (8.21) are presented when using the numerical values in Table 8.1. Note that,
according to the above discussion, a limit cycle exists in all the cases in Table 8.1
8.3 Describing Function Analysis 527
Nyquist Diagram
5
2
Imaginary Axis
−1
−2
−3
−4
−5
−7 −6.5 −6 −5.5 −5 −4.5 −4 −3.5 −3 −2.5 −2
Real Axis
Fig. 8.10 Polar plot of G(s) in (8.21) when using the numerical values in Table 8.1. (a)
Continuous. (b) Dashed. (c) Dash–dot. (d) Dotted
because all the phase plots in Fig. 8.9 intersect the −180◦ phase line. Furthermore,
this happens when the magnitude is larger than 0[dB]. Recall that the open interval
(−∞, −1/k) corresponds to the open interval (0, ∞)[dB] (because k = 1) when the
phase is −180◦ . Note that the −180◦ phase line is intersected at a larger frequency
as we go from a) to d) in Table 8.1. Also note that, according to Fig. 8.10 the negative
real axis is intersected by the polar plot of G(j ω) at some point that moves to the
left as we go from a) to d) in Table 8.1. Recall that −1/N(A) moves to the left as A
approaches δ. Thus, it is concluded that the amplitude of the oscillations decreases
and the frequency of the oscillations increases as we go from a) to d) in Table 8.1.
528 8 Advanced Topics in Control
1 1
0.8 0.8
0.6 0.6
0.4 0.4
a)
b)
0.2 0.2
0 0
−0.2 −0.2
−0.4 −0.4
0 5 10 15 0 5 10 15
t[s] t[s]
1 1
0.8 0.8
0.6 0.6
0.4 0.4
d)
c)
0.2 0.2
0 0
−0.2 −0.2
−0.4 −0.4
0 5 10 15 0 5 10 15
t[s] t[s]
Fig. 8.11 Simulation response of the output y in Fig. 8.7 when using the numerical values in
Table 8.1
In Fig. 8.11, the evolution obtained in the simulation of the output y(t) in Fig. 8.7
is presented when using the numerical values in Table 8.1. All the initial conditions
are set to zero except for y(0) = 1. These results verify all the above predictions: a
sustained oscillation exists in all cases, the amplitude decreases and the frequency
increases as we go from a) to d) in Table 8.1. It is important to note that the above
theoretical discussion on limit cycles was intended to explain the amplitude and
the frequency of the oscillation at the input of the “static” nonlinearity e = τ (s).
However, in Fig. 8.11, we present the oscillation of the different variable y, which
relates to e = τ (s) through e = −(kv s 3 + βs 2 + βkd s + βkp )Y (s). Hence, it is clear
that, because of the linear relation between e and y(t), these results are also valid
for y(t). Some of the results in this section were reported for the first time in [5].
Figures 8.9 and 8.10 were drawn by executing the following MATLAB code in
an m-file several times:
clc
g=9.81;
km=0.0368;
l1= 0.129;
m1= 0.02218;
L0=0.1550;
8.3 Describing Function Analysis 529
J1=0.0001845;
I0=0.00023849;
den=I0*(J1+m1*l1^2)+J1*m1*L0^2;
h=(J1+m1*l1^2)/(m1*l1*L0);
a=-m1^2*l1^2*L0*g/den;
b=(I0+m1*L0^2)*m1*l1*g/den;
c=(J1+m1*l1^2)/den;
d=-m1*l1*L0/den;
%{
kv=2.3755e-4;
beta=0.0041;
kd=2.88;
kp=kd;
%}
%{
kv=2.3755e-4*1.2;
beta=0.0041*1.4;
kd=4.59;
kp=kd;
%}
%{
kv=2.3755e-4*1.4;
beta=0.0041*1.8;
kd=5.62;
kp=kd;
%}
%%{
kv=2.3755e-4*2;
beta=0.0041*2.8;
kd=7;
kp=kd;
%}
g=tf(-(a+b*h)*d*[kv beta beta*kd beta*kp],[1 0 -b
0 0]);
figure(1)
bode(g,’b:’,{1,100});
grid on
hold on
figure(2)
nyquist(g,’b:’);
axis([-7 -2 -5 5])
hold on
Simulations in Fig. 8.11 were obtained using the MATLAB/Simulink diagram in
Fig. 8.12. The dead zone block has as a parameter δ = 0.0115, whereas the To work
space block is programmed to store data in an array and 0.001 as sampling time.
530 8 Advanced Topics in Control
Gain1
beta d*(a+b*h) 1 1
2 s s
Add1
Add Integrator Integrator1 Scope
Gain Derivative
kv du/dt FlatOutput
Add2
kp
Proportional Derivative1
kd
du/dt
Derivative2
Fig. 8.12 MATLAB/Simulink diagram used for the simulations in Fig. 8.11
+M
k
e
–M
ylabel(’d)’)
xlabel(’t[s]’)
At this point, Fig. 8.11 is drawn.
5 This is because the saturation characteristic presented in Fig. 8.13 is odd. Furthermore, a
0 = 0 for
any odd “static” hard nonlinearity.
6 See Fig. 8.4.
532 8 Advanced Topics in Control
c(t)
0
–M
0 t1 T time
4
T /2
2
a1 = c(t) cos(ωt)dt,
T −T /2
T /2
2
b1 = c(t) sin(ωt)dt.
T −T /2
From these expressions, it is clear that a1 = 0 because c(t) is an odd function. Thus,
the following can be written:
c(t) ≈ b1 sin(ωt).
M
where ωt1 = arcsin kA and cos θ = 1 − sin2 θ have been used. According to
the frequency response approach, any system component can be represented as the
ratio between the output amplitude, i.e., b1 , and the input amplitude, i.e., A. This
means that the saturation nonlinearity can be represented by the frequency response
“transfer function”:
⎡ ⎤
2
b1 2k ⎣ M M M ⎦ , if A > M ,
N (A) = = arcsin + 1−
A π kA kA kA k
or:
b1 M
N(A) = = k, if A ≤ .
A k
di
L + Ri + kb z2 = u, (8.22)
dt
t
u = kpi (i ∗ − i) + kii (i ∗ − i)dt, (8.23)
0
where L, R, kb , are positive constants standing for the armature inductance and
resistance, in addition to the motor counter-electromotive force constant. i and u
represent the armature electric current and voltage applied at the motor terminals,
534 8 Advanced Topics in Control
whereas z2 = ẏ − h (3)
a+bh y , where y is the inverse Laplace transform of Y (s) in
∗
Fig. 8.7. Finally I ∗ (s) = τ km(s) is the Laplace transform of the commanded electric
current i ∗ and τ ∗ (s) = (kv s 3 + βs 2 + βkd s + βkp )Y (s) is the commanded torque.
Replacing (8.23) in (8.22), using:
d(a + bh)
s 2 Y (s) = τ (s),
s2 − b
from Fig. 8.7, τ (s) = km I (s), and after an algebraic procedure, it is possible to find:
(s 2 − b)(kpi s + kii )
I (s) = GI (s)I ∗ (s), GI (s) = ,
N(s)
kb hd(a + bh)km 2
N (s) = Ls 4 + (R + kpi )s 3 + kii − bL − s
a + bh
−(R + kpi )bs − kii b + kb d(a + bh)km .
Using τ (s) = km I (s) and τ ∗ (s) = km I ∗ (s) again, the following is finally found:
Thus, the block diagram in Fig. 8.7 now becomes the block diagram in Fig. 8.15. The
dead zone nonlinearity is no longer considered because it is observed that in some
experiments in Chap. 15, the dead zone does not have the dominant effect. Using
some block algebra, the block diagram in Fig. 8.16 is obtained where e = τ (s) and:
k p + k ds
Fig. 8.15 A closed-loop system including a saturation nonlinearity and the electric dynamics of a
direct current motor used to generate torque
Hence, the closed loop system at hand has been written in the form shown in
Fig. 8.4, an important step to applying the describing function method. Also note
that GC (s) has six poles and four zeros. Thus, its magnitude behaves as a low-pass
filter. Recall that this is an important condition for the application of the describing
function method. Using the following numerical values:
the Bode diagrams in Fig. 8.17 and the polar plots in Fig. 8.18 are drawn. The
continuous line is obtained using kpi = 0.03 and the dashed line is obtained using
kpi = 0.8.
Bode Diagram
200
150
100
Magnitude (dB)
50
0
−50
−100
−150
−200
−135
−180
Phase (deg)
−225
−270
−315
−360
10−2 10−1 100 101 102 103 104 105
Frequency (rad/sec)
Fig. 8.17 Bode diagrams of GC (s) in (8.24). Continuous kpi = 0.03. Dashed kpi = 0.8
536 8 Advanced Topics in Control
s r
Fig. 8.18 Polar plot of GC (s) in (8.24). Continuous kpi = 0.03. Dashed kpi = 0.8
According to the discussion above and Fig. 8.18, two limit cycles exist for the
case kpi = 0.03 because the negative real axis is intersected twice by GC (j ω) on
the interval (−∞, −1/k]. Recall that k = 1 in this case. Proceeding analogously,
it is concluded that in the case of kpi = 0.8 only one limit cycle exists. Limit
cycles may be stable or unstable. To check limit cycle stability, the application
of the Nyquist stability criterion is useful. Using the numerical values above, it is
found that N (s) has one real positive root and the remaining roots have a negative
real part. Furthermore,
√ N(s) has two roots located at +9.65 and −9.62, which are
approximately ± b = ±9.69. All roots of (kv s 3 + βs 2 + βkd s + βkp )(kpi s + kii )
have a negative real part. Hence, GC (s) is nonminimum phase and it has two poles
at s = 0. Therefore, the number of open-loop poles with a positive real part is
P = 1 and the modified Nyquist path in Fig. 8.19 must be used. Following a similar
procedure to that according to (6.65), in Chap. 6, the plots in Fig. 8.20 are obtained.
To study the stability of the limit cycles, the following modified version of the
Nyquist stability criterion is useful [3]. Given a linear time-invariant, negative feed-
back, closed-loop system with an open-loop transfer function kG(s)H (s), where k
is any constant, real or complex, the closed-loop poles satisfy 1 + kG(s)H (s) = 0,
which can be rearranged to write G(s)H (s) = − k1 . Thus, the Nyquist stability
criterion can be applied merely by taking into account the number of times that the
polar plot G(j ω)H (j ω) encircles the point − k1 , instead of the point −1.
In the case of limit cycle stability, proceed as follows [3]. Consider Fig. 8.4,
replacing the nonlinearity with its frequency response transfer function N (A). The
condition:
8.3 Describing Function Analysis 537
ω = 0+
φ = +90 s = εφ
ε
Re (s)
r→∞
ω = 0–
φ = – 90
– jω
1
G(j ω) = − ,
N(A)
7 This does not mean that another limit cycle with a different amplitude A exists. Recall that N (A)
is a linear approximation of a nonlinear function; hence, N (A) changes if A changes and this does
not require A to represent an oscillation amplitude in a steady state.
538 8 Advanced Topics in Control
Im( G C (jω))
r→∞
– 360°
ω = 0+
– 1 ω=+∞
Re( G C (jω))
ω=–∞ ω = 0–
r→ ∞
0°
r→ ∞
(a)
Im( G C (jω))
r→∞
– 360°
ω = 0+
– 1 ω=+∞
Re( G C (jω))
ω=–∞ ω = 0–
r→ ∞
0°
r→ ∞
(b)
Fig. 8.20 Mapping the modified Nyquist path in Fig. 8.19 to the plane GC (j ω) . (a) kpi = 0.03.
(b) kpi = 0.8
−1
−2
−3
−4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
(a)
1
0.8
0.6
0.4
0.2
0
−0.2
−0.4
−0.6
−0.8
−1
In the case of kpi = 0.03, a second limit cycle exists at the right of Fig. 8.18. It
is left as an exercise for the reader to proceed as above to verify that this limit cycle
is stable.
In Fig. 8.21, the evolution obtained in simulation of the signal at the input of the
saturation nonlinearity in Fig. 8.15 is presented when using the numerical values
in (8.25). All the initial conditions are set to zero except for the signal at the input of
the nonlinearity, which is set to 1. Note that, in the case of kpi = 0.8 no limit cycle
appears. This is a consequence that the limit cycle due to the saturation is unstable,
540 8 Advanced Topics in Control
but the closed-loop system is stable. This can be verified by applying the Nyquist
stability criterion in Fig. 8.20b, i.e., considering the number of times that the point
−1 on the real axis is encircled. Furthermore, limit cycles are not observed either
in the experiments performed in Chap. 15, where it is explained that the controller
gains used in this case are chosen such that any limit cycle due to a dead zone
nonlinearity does not appear.
In the case of kpi = 0.03, a limit cycle appears and the oscillation increases
at the beginning to reach this limit cycle. Apply the Nyquist stability criterion to
Fig. 8.20a, i.e., considering the number of times that the point −1 on the real axis is
encircled, to verify that the closed-loop system is unstable. This explains the initial
growth in the oscillation. Moreover, from Fig. 8.21a, it is possible to measure the
oscillation frequency: f ≈ 8[cycles/s]= 8[Hz], then ω = 2πf ≈ 50.26[rad/s].
This limit cycle corresponds to the point in Fig. 8.17 where the −180◦ phase line
is crossed at ω ≈ 48[rad/s] because, according to Fig. 8.18, this is the limit cycle
appearing at a higher frequency. Hence, this corroborates the existence and stability
of such a limit cycle. Note that this also shows that a saturation nonlinearity may
convert closed-loop instability into a limit cycle, i.e., into sustained oscillations. This
also explains the operation of the oscillator electronic circuit based on a transistor
presented in Sect. 9.3.9.
Figures 8.17 and 8.18 were drawn using the following MATLAB code in an m-
file:
clear all
clc
g=9.81;
l1= 0.129;
m1= 0.02218;
L0=0.1550;
J1=0.0001845;
I0=0.00023849;
kpi=0.8;%0.03;%
kii=130;
km=0.0368;%0.05
R=2.4;
L=0.030; %0.084; %0.163; %
kb=km;
den=I0*(J1+m1*l1^2)+J1*m1*L0^2;
h=(J1+m1*l1^2)/(m1*l1*L0);
a=-m1^2*l1^2*L0*g/den;
b=(I0+m1*L0^2)*m1*l1*g/den;
c=(J1+m1*l1^2)/den;
d=-m1*l1*L0/den;
kv=2*2.3755e-4;
beta=2.8*0.0041;
kd=7;
8.3 Describing Function Analysis 541
kp=7;
alla=-kii*b+kb*d*(a+b*h)*km;
deni=[L R+kpi kii-b*L-kb*h*d*(a+b*h)*km/(a+b*h)
-(R+kpi)*b alla];
num1=conv([1 0 -b],[kpi kii])
numi1=conv(num1,[kv beta beta*kd beta*kp])
Gi=tf(numi1,deni)
pole(Gi)
zero(Gi)
G=tf(-d*(a+b*h),[1 0 -b 0 0]);
GH=Gi*G;
figure(1)
bode(GH,’r--’)
grid on
hold on
figure(2)
nyquist(GH,’r--’)
hold on
axis([-4 1 -1 1])
den2=conv([1 0 -b 0],deni)
The simulations in Fig. 8.21 were performed using the Simulink diagram in
Fig. 8.22. The saturation block has ±2.5 as saturation limits, the Datos block saves
data in an array, whereas the Datos1 block saves data as a structure with time. To
obtain these graphical results, proceed as follows: (1) Execute the above MATLAB
code for kpi=0.03. (2) Run the simulation in Fig. 8.22. (3) Execute the following
MATLAB code in an m-file:
clc
tiempo=Datos1.time;
figure(3)
plot(tiempo,Datos(:,1))
axis([0 1 -1.2 1.2])
(4) repeat (1), (2), (3), for kpi=0.8.
d*(a+b*h)*numi1(s) 1 Scope
den2(s) s
Datos
Saturation Integrator
Datos1
Given the closed loop system in Fig. 8.23, the sensitivity function is defined as:
C(s) 1
S(s) = = ,
D(s) 1 + G(s)H (s)
where D(s) is a disturbance. The transfer functions H (s) and G(s) represent the
plant and the controller respectively. From the above definition we can write:
1
|S(j ω)| = .
|G(j ω)H (j ω) − (−1)|
This means that the magnitude of the sensitivity function represents the inverse of
the distance between point (−1, j 0) and the polar plot of G(j ω)H (j ω). Hence,
according to the Nyquist stability criterion, a bad performance is obtained if |S(j ω)|
is large for some ω > 0. Furthermore, large sensitivity values put the polar plot of
G(j ω)H (j ω) too close to the critical point (−1, j 0). This may result in closed-
loop instability because of imperfections in control system implementation. Thus, a
necessary condition for closed-loop stability is that |S(j ω)| is “small” for all ω > 0.
A fundamental property of the feedback connection in Fig. 8.23 is represented by
the so-called Bode integrals, which are given as follows [6]:
∞
ln |S(j ω)|dω = 0, (8.26)
0
∞
ln |S(j ω)|dω = π Re (p). (8.27)
0 p∈P
The properties in (8.26) and (8.27) stand for the cases when the plant transfer
function H (s) is stable and unstable respectively. In this respect, P represents the
set of all the unstable poles of H (s). Because of the low-pass filtering property of
most plants, it has been suggested in [6] to replace (8.26) and (8.27) by:
Ωa
ln |S(j ω)|dω = δ, (8.28)
0
Ωa
ln |S(j ω)|dω = π Re (p) + δ. (8.29)
0 p∈P
Smin = 1, (8.30)
πξ
Smin = e Ωa > 1, ξ= Re (p) > 0, (8.31)
p∈P
8.5 Summary
This chapter is included to study the theory required to understand some interesting
phenomena appearing during experiments when controlling some of the mecha-
nisms in the last eight chapters of the book. This is the case of large overshoots
observed in a magnetic levitation system, even when all the closed-loop poles are
real. The explanation of this phenomenon is given in Sect. 8.1 “Structural limitations
544 8 Advanced Topics in Control
in classical control,” where it is concluded that the plant open-loop unstable poles
are responsible for this. It is also explained in that section that an open-loop
double pole at the origin may contribute to such behavior and this is the case of
experiments with the ball and beam system. On the other hand, limit cycle is a
phenomenon induced by hard nonlinearities in some mechanical systems such as
the Furuta pendulum. This is explained in Sect. 8.3 “Describing function analysis,”
where two different nonlinearities are considered: the dead zone and the saturation.
Moreover, the saturation nonlinearity is responsible for sustained oscillations in sine
wave oscillator circuits studied in Chap. 9. Furthermore, a methodology useful for
selecting the controller gains such that limit cycles are avoided is proposed using
the ideas presented in Sect. 8.2 “Differential flatness” and Sect. 8.3.
8.7 Exercises
and select the controller gains such that all the poles of the closed-loop
system (12.7), (8.32) are assigned arbitrarily.
• Using the fact that θ2 is the flat output, find a way of expressing:
where L2 (·) and L3 (·) are linear functions of their arguments, and show
that (8.32) can be written as:
where γ1 , γ2 , γ3 , γ4 , are some constants and θ1d = θ2d . Use the procedure
before the Example 7.9 to find the controller gains γ1 , γ2 , γ3 , γ4 , arbitrarily
assigning the eigenvalues to the closed-loop system x̃˙ = Ax̃ + Bu, x̃ =
[θ1 − θ1d , θ̇1 , θ2 − θ2d , θ̇2 ]T , for u given in (8.33).
• Verify through numerical examples that the procedures in the previous two
items can assign the same eigenvalues and that the sets of gains in both
approaches can be obtained from each other.
• Study the possible existence of limit cycles, induced by a dead zone
nonlinearity, when using the control scheme in (8.32) in the closed-loop
system with (12.7). Explain why these results are still valid when using the
closed-loop system x̃˙ = Ax̃ + Bu, x̃ = [θ1 − θ1d , θ̇1 , θ2 − θ2d , θ̇2 ]T , for u
given in (8.33).
2. Compare Fig. 8.7, when the dead zone nonlinearity is not present, and Fig. 6.83.
Show that a control scheme similar to that in Fig. 6.83, i.e., with a lead
compensator in the outer loop instead of a proportional–derivative controller,
can be designed for the plant in Fig. 8.7. Use the frequency response method
presented after (6.53) to perform the design.
3. Consider a dead zone nonlinearity at the input of the ball and beam plant in
Fig. 6.83 and study the possible existence of limit cycles.
References
1. M. Fliess, J. Levine, P. Martin, and P. Rouchon, Flatness and defect of non-linear sys-
tems: introductory theory and examples, International Journal of Control, Vol. 61, No. 6,
pp. 1327–1361, 1995.
2. H. Sira-Ramírez and S.K. Agrawal, Differentially flat systems, Marcel Dekker, New York,
2004.
3. J. J. Slotine and W. Li, Applied nonlinear control, Prentice Hall, 1989.
4. E. Usai, Describing function analysis of nonlinear systems. University of Leicester. Department
of Engineering and University of Cagliari Department of Electrical and Electronic Engineering,
2008.
546 8 Advanced Topics in Control
Consider the closed-loop system depicted in Fig. 9.1. The corresponding closed-
loop transfer function is:
C(s) A
= ,
R(s) 1 + βA
C(s) A 1
= ≈ . (9.1)
R(s) 1 + βA β
The applications of this fact are important in electronic circuits, as explained in the
following.
Suppose that A is the gain of a power amplifier. These devices are capable
of handling large amounts of power; hence, their components must be capable
of working under large temperature variations. This implies that the components
of a power amplifier are not high-precision and large changes in their parameters
Nonlinear
Preamplifier
amplifier
are expected. Thus, it is natural to assume that A changes under normal operation
conditions. According to (9.1), the use of feedback around an amplifier with gain A
has the effect of rendering the circuit gain changes small, despite A exhibiting large
variations. Hence, feedback can solve the problem of a power amplifier with large
gain changes. An important feature is that the gain β must not exhibit significant
changes and this is achieved if such a gain depends only on low-power components,
i.e., that they can be composed only of precision devices.
In the following, some applications are presented where feedback is used to
reduce the gain variations in some electronic circuits, which can also be understood
as the reduction of the effects of the circuit nonlinearities.
Consider the block diagram in Fig. 9.2. The nonlinear amplifier is an amplifier with
gain A1 = 2 when the input voltage u is negative and a gain A2 = 0.5 when the
input voltage is positive. This property can be represented as in Fig. 9.3. Hence, this
amplifier delivers at its output a distorted version of the signal applied at its input.
In Fig. 9.4, the signal at the nonlinear amplifier output is shown, when a sinusoidal
signal is applied at its input. This is a good example of distortion. Combining the
effect of all amplifiers in the direct path, it is concluded that the block diagram in
Fig. 9.2 can be represented by a block diagram such as that in Fig. 9.1 where:
A = A1 A0 , u < 0,
9.1 Reducing the Effects of Nonlinearities in Electronic Circuits 549
0.5
u
2
Vo
A = A2 A0 , u > 0,
β = 1, for instance,
with A0 the gain of the preamplifier, which is very large. Note that the following
closed-loop transfer function is obtained:
C(s) A 1
= ≈ = 1,
R(s) 1 + βA β
u Vo
– Vcc
system depicted in Fig. 9.2 is shown when Vi is a sinusoidal signal. Note that Vo has
the same amplitude for both semicircles when a nonlinear amplifier (with gain A) is
embedded in the feedback system.
1
–0.6
1 +0.6 u
Vo
–Vcc
R2
R1
552 9 Feedback Electronic Circuits
signal Vi , as shown in Fig. 9.10; hence, to eliminate the effect of the dead zone by
employing feedback. This is explained as follows.
The circuit in Fig. 9.9 can be represented by the block diagram in Fig. 9.1. This
feedback system has a closed-loop transfer function given as:
C(s) A
= , C(s) = Vo (s), R(s) = Vi (s),
R(s) 1 + βA
R1
β= ≤ 1,
R1 + R2
Vo (s) A 1
= ≈ . (9.2)
Vi (s) 1 + βA β
The expression in (9.2) indicates that the whole circuit behaves as an amplifier with
the constant gain 1/β such that the effect of the dead zone is eliminated and the
waveform of Vo is identical to that of Vi .
Note that R1 and R2 can be chosen to be large to ensure that only a small electric
current flows through them; hence, precision resistances can be employed. It is also
important to stress the following. According to Fig. 9.7 α(u) is zero for u in the
interval [−0.6, +0.6][V]. This suggests that the condition βA = α(u)A0 β
1 is
not true. However, it is important to understand that the characteristic in Fig. 9.7 is
an idealization of what really happens in practice where Vo is zero only when u is
also zero.
In Fig. 9.11 the experimental voltages u and Vo corresponding to Fig. 9.6 are
shown. The Darlington transistors TIP 141 (NPN) and TIP 145 (PNP) are employed.
This means that the voltage at the base-emitter junction has a nominal direct
polarization voltage of about 1.2[V]; hence, the dead zone is in this case in the
9.1 Reducing the Effects of Nonlinearities in Electronic Circuits 553
Fig. 9.11 Experimental results. Voltages at the input and the output of the circuit in Fig. 9.6. Upper
line: Vo , bottom line: u
Vo (s) 1 R1
= = 2, β= = 0.5.
Vi (s) β R1 + R2
Fig. 9.12 Experimental results. Voltages at the input and the output of the circuit in Fig. 9.9. Upper
line: Vo , bottom line: Vi
Ei(s)
Eo(s)
Consider the circuit in Fig. 9.13 where Z1 (s) and Z2 (s) stand for the impedances
of two passive networks located at those places. In an operational amplifier, it is
true that:
where V+ (s) and V− (s) stand respectively for voltages at the terminals “+” and “−”
of the operational amplifier, whereas A0 is the open-loop gain of the operational
amplifier, which is very large (about 100,000 [2], pp. 500). As V+ (s) = 0 and
V− (s) = V1 (s), then:
VZ1(s) Z1(s)
Eo(s) V1(s)
Ei(s)
(a)
Z2(s)
Eo(s)–Ei(s) Z1(s)
VZ1(s)
(b)
To compute V1 , the auxiliary circuits in Figs. 9.14a and b are employed. There, it is
found that:
Z1 (s)
V1 (s) = (Eo (s) − Ei (s)) + Ei (s),
Z1 (s) + Z2 (s)
Z1 (s) Z1 (s)
= Eo (s) + Ei (s) 1 − .
Z1 (s) + Z2 (s) Z1 (s) + Z2 (s)
hence:
Z1 (s)
Eo (s) −A0 1 − Z1 (s)+Z2 (s)
= Z1 (s)
.
Ei (s) 1 + A0 Z1 (s)+Z 2 (s)
556 9 Feedback Electronic Circuits
Z1 (s)
It is possible to assume that A0 Z1 (s)+Z 2 (s)
1, because A0 is very large; thus:
Eo (s) Z2 (s)
=− . (9.4)
Ei (s) Z1 (s)
Z1 (s)
Note, however, that the condition A0 Z1 (s)+Z 2 (s)
1 is true depending on A0 . In
this respect, it is important to point out that, in practical operational amplifiers,
the gain A0 is not a constant, but changes with the frequency of the signals the
operational amplifier is processing. It is common that A0 decreases when such a
frequency increases in a similar manner to the magnitude of a low-pass filter [2],
Z1 (s)
pp. 500. Hence, the conditions A0 Z1 (s)+Z 2 (s)
1 and (9.4) are not satisfied for
high frequencies. On the other hand, the manner in which A0 changes with the
frequency depends on the particular operational amplifier that is employed. This
means that attention must be paid when selecting an operational amplifier for a
given application, i.e., taking into account how fast the plant to be controlled is.
In Table 9.1, some examples are shown on the possible networks employed to
implement Z1 (s) and Z2 (s), in addition to the analog controller that results when
using them. It is left as an exercise for the reader to compute Z1 (s) and Z2 (s)
for each one of these networks to verify, using (9.4), that the transfer function of
the controller in the column at the right of this table is obtained. See [3] for a
more complete table including additional controllers. It is stressed, however, that
these controllers can also be implemented using either a digital computer or a
microcontroller.
The purpose of this section is to show how control theory can be employed to design
feedback electronic circuits generating sinusoidal signals. As sustained oscillations
are present only in marginally stable systems, a necessary requirement for these
feedback electronic circuits, from the linear control theory point of view, is that
their characteristic polynomial must possess a pair of imaginary conjugate roots,
i.e., the closed-loop system has to possess imaginary conjugate poles. This is known
as the oscillation condition. Once this is achieved, the oscillation frequency, in
radians/second, is equal to the imaginary part of such roots or poles. This part of the
oscillator electronic circuit analysis and the design is performed using both classical
control theory approaches: the time response and the frequency response. In the
present section, some designs are presented based on either operational amplifiers
or transistors.
An oscillator based on operational amplifiers simplifies the analysis and design
from the control point of view and it is useful when operating at low frequencies
as it avoids the necessity for inductance. It is important to stress that inductances
required to generate low-frequency oscillations are large, resulting in bulky designs.
The main drawback of this design is that it cannot work at high frequencies as in the
radiofrequency bands because of the limitations of operational amplifiers.
On the other hand, the use of transistors results in a more complex analysis and
design from the control point of view. However, the main advantage of the use of
transistors is that it makes it possible to design oscillators for high frequencies, i.e.,
for the radiofrequency bands. The use of transistors is also interesting because of the
following feature. As shown in the remainder of this section, that when operational
amplifiers are employed, the resulting circuit is linear, requiring the introduction,
in an artificial manner, of a nonlinear circuit component to render the oscillation
possible. On the contrary, as the transistor is a nonlinear device it renders the
oscillation possible in a rather natural manner.
Consider the circuit in Fig. 9.15. In Example 2.14, Chap. 2, it was found that the
voltages Eo (s) and Ei (s) are related as in (2.73). This expression is rewritten here
for ease of reference:
Eo (s) Ts
= GT (s) = 2 2 , T = RC. (9.5)
Ei (s) T s + 3T s + 1
Consider now the circuit in Fig. 9.16 where an operational amplifier-based non-
inverter amplifier is included, see Fig. 9.17. In the operational amplifier:
Ei(s) C R Eo(s)
– –
Vo
R Vi C
Rf
R1
R1
with V+ (s) = Vi (s) and V− (s) = R1 +Rf V0 (s). Then:
R1
V0 (s) = Vi (s) − V0 (s) A0 ,
R1 + Rf
and rearranging:
R1 + Rf + R1 A0
V0 (s) = A0 Vi (s).
R1 + Rf
as A0 is large, then:
R1 A0
V0 (s) = A0 Vi (s),
R1 + Rf
and, finally:
R1 + Rf
V0 (s) = AVi (s), A= .
R1
Note that the block diagrams in Figs. 9.18a and b can be obtained from this
circuit. It is important to observe that, according to these block diagrams, the circuit
in Fig. 9.16 is a positive feedback circuit. As the theory presented in the previous
chapters assumes that negative feedback control systems are designed, such as that
9.3 Design of Sinusoidal Waveform Oscillators 559
Rf
R1
in Fig. 9.18d, it is necessary to transform the block diagram in Fig. 9.18b into a more
convenient form. This is achieved in Fig. 9.18c where a negative sign is included
in the feedback path, which is compensated for by a sign change in the transfer
function on the direct path. Thus, a negative feedback system has been obtained
that is equivalent to the systems in Figs. 9.18b and d. Thus, the open-loop transfer
function is given as:
This method studies the circuit at hand through the location of the closed-loop
poles. From the study of differential equations in Chap. 3, it is known that sustained
oscillations are possible only if the closed-loop poles are imaginary, i.e., with a zero
real part. Under these conditions, the oscillation frequency, in radians/second, is
equal to the imaginary part of these poles.
It is also known that the closed-loop poles satisfy:
1 + G(s)H (s) = 0.
T As
1 + G(s)H (s) = 1 − GT (s)A = 1 − ,
T 2s2 + 3T s + 1
T 2 s 2 + 3T s + 1 − T As
= = 0,
T 2 s 2 + 3T s + 1
T 2 s 2 + (3 − A)T s + 1 = 0.
560 9 Feedback Electronic Circuits
(a)
0 + E i ( s) E o ( s)
G T (s)
+
R f +R 1
R1
Vo Vi
(b)
0 + – E i ( s) E o ( s)
– G T (s)
–
R f +R 1
R1
Vo Vi
(c)
R (s) C(s)
G (s)
+ –
H (s)
(d)
(3 − A)2 T 2 − 4T 2 < 0,
i.e., if 5 > A > 1.
9.3 Design of Sinusoidal Waveform Oscillators 561
• If A > 3, then both poles have a positive real part, i.e., the circuit is unstable,
which is not desirable.
• If A < 3, then both poles have a negative real part, i.e., the circuit is stable.
This, however, is not desirable either because circuit oscillation disappears as
time increases.
• If A = 3, then both poles have a zero real part; thus, they are imaginary as
desired. These poles are located at s1,2 = ±j T1 . Hence, the oscillation frequency
is ω = T1 = RC1
.
jT ω
GT (j ω) = .
T 2 (j ω)2 + 3j T ω + 1
1
GT (j/T ) = .
3
To plot the Bode diagrams of GT (s) rearrange:
1
T2
GT (s) = T s . (9.7)
s2 + 3
Ts + 1
T2
The Bode diagrams of GT (s) are shown in Fig. 9.19. The magnitude of GT (j ω)
is maximal (equal to 13 ) at the frequency ω = 1/T = 1/(RC), exactly when the
phase of GT (j ω) is zero.
The polar plot of G(s)H (s), given in (9.6), is depicted in Fig. 9.20. From the
Bode diagrams of GT (s), shown in Fig. 9.19, it is concluded that the polar plot of
G(s)H (s), shown in Fig. 9.20, consists of two clockwise contours. Note that the
negative sign in (9.6) changes 180◦ the phase at every point of the Bode diagram
of GT (s). Also note that the polar plot in Fig. 9.20 crosses the negative real axis
R +R
at the point − 13R1 f when the frequency is ω = 1/T = 1/(RC). On the other
hand, because the polar plot includes positive and negative frequencies and it is
symmetrical with respect to the real axis for negative and positive frequencies, then
R +R
the negative real axis is also crossed at the point − 13R1 f when the frequency is
ω = −1/T = −1/(RC). Also note that the number of unstable open-loop poles
of the function given in (9.6) is zero, i.e., P = 0, because all the coefficients of the
polynomial at the denominator of GT (s) are positive (see Sect. 4.2.1).
562 9 Feedback Electronic Circuits
Im (G(jω)H(jω))
– A3 ω→+∞
Finally, before applying the Nyquist stability criterion, the following must be
noted. As G(s)H (s) has one zero at s = 0, i.e., on the imaginary axis, a contour
must be included such as that in Fig. 6.79. The only difference is that in this case
it is a zero (instead of a pole) that must be contoured. However, along this contour
s = ε φ where ε → 0; hence, G(s)H (s) → 0 also on this contour. This means that
G(s)H (s) represents a unique point on the origin of the complete contour. Thus,
when applying the Nyquist stability criterion, three cases exist:
R +R
1. If 13R1 f > 1, then the number of contours around the point (−1, j 0) is N = 2,
i.e., the number of closed-loop unstable poles is Z = N + P = 2. This implies
circuit instability, which is undesirable.
R +R
2. If 13R1 f < 1, then the number of contours around the point (−1, j 0) is N = 0
and the number of unstable closed-loop poles is Z = N + P = 0. Although
this implies circuit stability, it is also undesirable in this application because the
circuit oscillation disappears as time increases.
9.3 Design of Sinusoidal Waveform Oscillators 563
R +R
3. If 13R1 f = 1, then the circuit is marginally stable, i.e., there are closed-
loop poles on the imaginary axis. This can also be understood as follows. The
condition to be satisfied by the closed-loop poles is 1 + G(s)H (s) = 0, or
G(s)H (s) = −1. Then, if the closed-loop poles are imaginary, it suffices to
perform the variable change s = j ω. Note that this is what happens when the
polar plot in Fig. 9.20 crosses the negative real axis at the point (−1, j 0) when
the frequency is ω = 1/T = 1/(RC) and ω = −1/T = −1/(RC). This means
that G(j ω)H (j ω)|ω=1/T = −1 and G(j ω)H (j ω)|ω=−1/T = −1. Hence, it
is concluded that there are two closed-loop poles that are imaginary conjugate
and placed at s = j/T and s = −j/T . Thus, the circuit exhibits permanent
oscillations at the frequency ω = 1/T .
From the above discussion, it is concluded that the gain of the operational amplifier-
based non-inverter amplifier must be chosen as:
R1 + Rf
A= = 3.
R1
However, the circuit in Fig. 9.16 does not oscillate correctly. The reason for this is
R +R
that commercial values for Rf and R1 cannot be found to exactly satisfy 1R1 f = 3.
Moreover, any small change in their nominal values would render the circuit either
unstable or stable (oscillation vanishes as time increases). This is a well-known fact
in electronics: a linear circuit cannot correctly oscillate in practice, i.e., all practical
oscillators are nonlinear.
The way to build a practical oscillator using the above ideas is by employing
the circuit in Fig. 9.21, which includes a nonlinearity introduced by two Zener
diodes. Suppose that A > 3. Hence, the circuit is unstable and oscillates with an
ever increasing amplitude. The job of the Zener diodes is to put a short circuit at
the 10[KOhm] resistance when they reach the avalanche voltage. This decreases
the gain A of the amplifier when the output voltage reaches a certain threshold.
This renders A < 3, and the oscillation amplitude decreases. Hence, the voltage
at the Zener diodes decreases and the short circuit at the 10[KOhm] resistance
disappears. Then, A > 3 again. Finally, this process ends at a steady state where a
sinusoidal voltage with constant amplitude is produced. Note that, using the values
of resistances in Fig. 9.21, A = 45/10 = 4.5 if the Zener diodes are open and
A = 35/10 = 3.5 if the Zener diodes are on. Hence, the 25.6[KOhm] potentiometer
must be adjusted to obtain a value slightly larger than 3 for A to obtain a sustained
oscillation. Note that the expected oscillation frequency is:
564 9 Feedback Electronic Circuits
33nF 4.7kΩ
+
–
Zeners
10kΩ eo
25.6kΩ 3.6V
4.7kΩ 33nF
10kΩ
Fig. 9.22 Waveform of voltage at the output of the operational amplifier in Fig. 9.21. The
potentiometer is at 20[KOhm]
1 1 1
ω= = = = 6447[rad/s],
T RC (4.7 × 103 )(0.033 × 10−6 )
ω 6447
f = = = 1.026[KHz].
2π 2π
Some experimental results obtained with circuit in Fig. 9.21 are shown in Figs. 9.22
and 9.23. The UA741 operational amplifier has been employed. The frequency
measured in experiments is 1[KHz]. The oscillation amplitude can be modified if
the resistance of the 25.6[KOhm] potentiometer is increased, which also increases
9.3 Design of Sinusoidal Waveform Oscillators 565
Fig. 9.23 Waveform of the voltage at the output of the operational amplifier in Fig. 9.21. The
potentiometer is at 25.6[KOhm]
+ +
V1(s) I1 R I2 R I3 R V2(s)
– –
the amplifier gain A. However, if this gain is too large, the sinusoidal waveform
is distorted. This is what happens in Fig. 9.23 where the 25.6[KOhm] poten-
tiometer is adjusted to its maximal resistance value. On the contrary, in Fig. 9.22
the 25.6[KOhm] potentiometer is adjusted to approximately 20[KOhm]. This is
evidence that the behavior of Zener diodes is smooth instead of abrupt, as the
amplitude of voltage at the operational amplifier output increases. Thus, a larger
loop gain in (9.6) reduces to 1 if the amplitude of oscillations increases, i.e., if the
Zener diodes work deeper in the avalanche region.
Finally, note that, according to the block diagrams in Fig. 9.18, this oscillator
circuit is a closed-loop system without an input, i.e., the circuit oscillates when
a zero input is applied. This must not be a surprise as it is clearly explained in
Sect. 3.3, Chap. 3, that a second-order (or a larger order) circuit may oscillate,
despite the input being zero if the initial conditions are different from zero. In this
respect, note that despite the fact that the circuit has no stored energy initially, some
small initial conditions that are different from zero are produced as a consequence
of a perturbation in the circuit when this is turned on. These initial conditions that
are different from zero, although small, suffice to make the circuit oscillate given
the initial instability of the circuit, because A > 3 when the circuit is turned on.
566 9 Feedback Electronic Circuits
Rf
R
+ –
+
V2(s) + V1(s)
- -
Consider the circuit shown in Fig. 9.24. The relationship between the voltages V1 (s)
and V2 (s) is shown in (2.76) in Example 2.15, Chap. 2. This expression is rewritten
here for ease of reference:
V2 (s) R3C 3s 3
= 3 3 3 = F (s). (9.8)
V1 (s) R C s + 6R 2 C 2 s 2 + 5RCs + 1
On the other hand, according to Sect. 9.2, the inverter amplifier shown in Fig. 9.25
performs the operation:
Rf
V1 (s) = − V2 (s). (9.9)
R
Now, consider the circuit shown in Fig. 9.26. Note that this circuit can be
represented using the block diagram in Fig. 9.27a. Moreover, according to (9.8) and
(9.9), the block diagram in Fig. 9.27b is obtained, which can be represented as in
Fig. 9.27c. This is convenient for seeing that it is a negative feedback closed-loop
system. Hence, the open-loop transfer function is given as:
Rf
G(s)H (s) = F (s). (9.10)
R
It is well known that the closed-loop poles satisfy:
i.e.,
Rf
1+ F (s) = 0. (9.12)
R
9.3 Design of Sinusoidal Waveform Oscillators 567
R
+ – +
V2(s) +
- V1(s)
-
C C C
R R
s0 R
In the following, we analyze the closed-loop circuit to find the conditions for the
existence of a pair of imaginary conjugate closed-loop poles. From (9.12), we obtain
the following characteristic polynomial:
(R 4 C 3 + Rf R 3 C 3 )s 3 + 6R 3 C 2 s 2 + 5R 2 Cs + R = 0. (9.13)
According to Chap. 3, the behavior of this circuit depends on the roots of the
characteristic polynomial in (9.13). As this polynomial is third-degree, it is useful
to employ Routh’s stability criterion (Sect. 4.3) to study its roots; hence, Table 9.2
is obtained. Three different behaviors can be predicted from this table:
• (6R 3 C 2 )(5R 2 C) − R(R 4 C 3 + Rf R 3 C 3 ) > 0, i.e., Rf < 29R. In this case,
all the entries in the first column of Table 9.2 are positive, ensuring that all the
roots of the polynomial in (9.13) have a negative real part, i.e., circuit stability is
concluded. This means that, although the circuit could oscillate, this oscillation
disappears as time increases.
568 9 Feedback Electronic Circuits
Phase-shift
RC network
(a)
V 2(s) Rf V 1(s)
0 +
– R
+
F (s)
(b)
Rf V 1(s)
0 +
R
–
F(s)
(c)
the row s 1 and to continue constructing the table as shown in Table 9.3. As there
is no change of sign in the first column of Table 9.3, it is concluded that no roots
9.3 Design of Sinusoidal Waveform Oscillators 569
exist with positive real parts; hence, imaginary conjugate roots exist. Thus:
Rf = 29R, (9.14)
6R 3 C 2 s 2 + R = 0,
are also roots of the characteristic polynomial shown in (9.13). Solving the latter
expression, it is found that the corresponding roots are imaginary, as expected:
1 1
s1 = j √ , s2 = −j √ .
6RC 6RC
This means that ω = √1 = 2πf , i.e., that the oscillation frequency in Hertz
6RC
is given as:
1
f = √ . (9.15)
2π 6RC
Thus, the oscillator circuit in Fig. 9.26 must be designed by choosing R and C
such that the oscillation frequency is computed as in (9.15), and then oscillation
is ensured by choosing Rf according to (9.14).
In what follows, the closed-loop circuit is studied by applying the Nyquist stability
criterion to find the conditions for closed-loop marginal stability. Let us first apply
Routh’s criterion to the characteristic polynomial in (9.8) (see Table 9.4). As there
are no changes of sign in the first column, we conclude that the characteristic
phase +270
[°] +
+
R
polynomial in (9.8) has no pole with a positive real part. As G(s)H (s) = Rf F (s),
this means that P = 0. In Fig. 9.28, the Bode diagrams for F (s) defined in (9.8)
are depicted. From Fig. 9.28 the polar plot of F (s) is obtained, which is depicted
R
in Fig. 9.29. Note that, according to G(s)H (s) = Rf F (s), the polar plot of the
open-loop transfer function is identical to the polar plot of F (s) in Fig. 9.29, but
R
it is only required to increase the magnitude by a factor Rf . Hence, depending
Rf
on the particular value of R , there are three possibilities, which are depicted
R
in Fig. 9.30. Thus, closed-loop marginal stability is obtained for a value Rf that
satisfies G(j ω)H (j ω) = −1 for some ω. This means that the closed-loop poles
are imaginary. Moreover, as 1 + G(s)H (s) = 0 is the condition that defines the
closed-loop poles s, then 1 + G(j ω)H (j ω) = 0, or G(j ω)H (j ω) = −1, implies
that the closed-loop poles can be written as s = ±j ω where ω is the frequency at
R
which the polar plot of G(j ω)H (j ω) crosses the point (−1, j 0). The value of Rf
that produces marginal stability is known as the oscillation condition and can be
R
obtained from G(j ω)H (j ω) = Rf F (j ω) = −1, i.e.,
Rf 1
=− .
R F (j ω2 )
Rf 1
= −29.2/20 = 28.8403 ≈ 29,
R 10
9.3 Design of Sinusoidal Waveform Oscillators 571
a value that is very close to the oscillation condition established in (9.14). Also note
that, according to the previous section, the oscillation frequency is given as ω =
√1 = 408.2483[rad/s], where RC = 0.001 has been used, which is very close to
6RC
ω2 = 411[rad/s] found in Fig. 9.31. Note that the frequency domain analysis does
R
not provide closed expressions to compute the exact value of Rf or the oscillation
frequency. However, very precise numerical values are given for both parameters.
From the above discussion, it is concluded that Rf and R must satisfy (9.14).
However, similar to the oscillator circuit in Sect. 9.3.1, the oscillator in Fig. 9.26
must be modified, as shown in Fig. 9.32 to accomplish a satisfactory oscillation.
R
Note that, using the values of resistance in Fig. 9.32, Rf = 80000
2200 = 36.36 if the
Rf
Zener diodes are open and R = 47000
2200 = 21.36 if the Zener diodes conduct. Hence,
R
the 47[KOhm] potentiometer must be adjusted to obtain a value for Rf slightly
larger than 29 to obtain sustained oscillations. Note that the expected oscillation
frequency is:
1 1
f = √ = √ = 2.9534[KHz].
2π 6RC 2π 6(2200)(0.01 × 10−6 )
Some experimental results are shown in Fig. 9.33 that were obtained with the circuit
in Fig. 9.32. The UA741 operational amplifier is employed. Frequency measured in
experiments is 2.7027[KHz], which is very close to the design value: 2.9534[KHz].
572 9 Feedback Electronic Circuits
(a)
(b)
(c)
9.3 Design of Sinusoidal Waveform Oscillators 573
Bode Diagram
0
System: F
Magnitude (dB)
−100
−150
270
Phase (deg)
180
System: F
Frequency (rad/sec): 411
Phase (deg): 180
90
0
101 102 103 104 105
Frequency (rad/sec)
47k
33k
2.2k
– +
+ v1
2.2k 2.2k
574 9 Feedback Electronic Circuits
Fig. 9.33 Waveform of the voltage at the output of the operational amplifier in Fig. 9.32
n
R L
R2
Q υCC
C1
Rt
C3
CBP R1
RE C2
The oscillator circuit shown in Fig. 9.34 is studied in this section. This circuit is
known as the Colpitts oscillator. The transistor is a nonlinear device. Because of
that, the problem is studied by proceeding as in the case of nonlinear differential
equations. It is assumed that the circuit in Fig. 9.34 works around an operation point,
i.e., only small variations of signals are allowed around it. The operation point is
determined by the direct current operation of the circuit in Fig. 9.34, whereas the
variations around the operation point are analyzed using an equivalent small-signal
circuit for the circuit in Fig. 9.34. The small-signal circuit is similar to approximate
linear models obtained for nonlinear systems (nonlinear differential equations) in
9.3 Design of Sinusoidal Waveform Oscillators 575
Sect. 7.3, which is valid if only small variations around the selected operation point
are allowed. The circuit is studied under direct current conditions in the next section.
The equivalent small-signal circuit is analyzed in subsequent sections.
Given the large number of variables involved (voltages and currents at each
circuit element), the following nomenclature is employed. vR1Q stands for the
(constant) voltage at the resistance R1 at the operation point, vr1 represents the
voltage variations at the resistance R1 around the operation point and vR1 is the total
voltage at the resistance R1 , i.e., vR1 = vR1Q + vr1 . Currents and voltages at the
other circuit elements are defined analogously. On the other hand, upper case letters
are employed to represent the Laplace transform of a time function represented with
a lower case letter, e.g., I (s) = L{i(t)}.
The Kirchhoff voltage law applied to mesh defined by Jc in Fig. 9.35 yields:
R2
Q Jc υCC
+
–
R1
Jb RE
576 9 Feedback Electronic Circuits
The Kirchhoff voltage law applied to mesh defined by Jb in Fig. 9.35 yields:
Suppose that iCQ , vCEQ , β and vcc are given as known values. RE is computed
using (9.16) and iEQ ≈ ICQ . Then, iR1Q is proposed from iCQ = βiBQ and the
following important assumption:
iR1Q
iBQ . (9.18)
The equivalent small-signal model for the transistor is found first. Although several
small-signal models for the transistor exist, in this book the following is considered.
The emitter current, i.e., the current through the diode at the base-emitter junction,
is given by the Shockley equation [1], chapter 5:
v
BE
iE = IES e VT − 1 ,
where IES is a constant with a value between 10−12 [A] and 10−16 [A] whereas VT =
0.026[V] for a temperature of 300 Kelvin degrees. An important equation in the
transistor establishes that iB = (1 − α)iE , where α is a positive constant slightly
less than 1. Hence:
v
BE
iB = (1 − α)IES e V T −1 . (9.21)
As the transistor is assumed to work in its active region, then the number 1
subtraction in the latter expression can be neglected to write:
v
BE
iB = (1 − α)IES e VT .
9.3 Design of Sinusoidal Waveform Oscillators 577
Recalling that iB = iBQ + ib and vBE = vBEQ + vbe , the following can be written:
vBEQ +vbe
iBQ + ib = (1 − α)IES e VT ,
vBEQ vbe
= (1 − α)IES e VT e VT . (9.22)
Also recall that small changes in iB are due to small changes in vBE , i.e., ib = 0 if
vbe = 0. Then, according to the last expression:
vBEQ
iBQ = (1 − α)IES e VT .
If only small values of vbe are allowed, the following approximation is possible [4],
pp. 942:
vbe vbe
e VT ≈ 1 + ,
VT
vbe VT
ib = , rπ = . (9.24)
rπ IBQ
On the other hand, the following expression is also valid for small variations:
ic = βib . (9.25)
Using (9.24) and (9.25) the small-signal model of the transistor shown in
Fig. 9.36a is obtained. It is possible to find an equivalence between this model and
that shown in Fig. 9.36b. Note that the only difference is that the base-emitter voltage
is now given as a voltage drop due to the emitter current, i.e., it must depend on the
new resistance hib :
vbe vbe rπ VT VT
hib = = = = = . (9.27)
ie (1 + β)ib 1+β (1 + β)IBQ IEQ
578 9 Feedback Electronic Circuits
rπ βib
ie
υbe
–
E
(a)
ib ic
E C
–
hib βib
ib
υbe +
B
(b)
Note that value of hib depends on IEQ , i.e., on the operating point. Once the small-
signal model of the transistor has been found, we proceed to finding the equivalent
small-signal circuit for the whole oscillator circuit.
Consider the circuit in Fig. 9.37a. The Kirchhoff voltage law applied to mesh J3
establishes that:
diL
vcc = L + vCE + vRE ,
dt
iL = iLQ + il ,
vCE = vCEQ + vce ,
vRE = vREQ + vre .
n
J3
R L
R2
Q υCC
C1
Rt
C3
CBP R1
RE C2
(a)
βi b
ic C
J3
B
C1
ib hib ie E Rt
C3 L Rex Rcobre
RE C2
(b)
Fig. 9.37 Equivalent small-signal circuit for the whole oscillator circuit
Hence, the equivalent small-signal circuit must represent a mesh such as that
indicated by J3 in Fig. 9.37b. Proceeding in a similar manner for all possible meshes
and nodes in the circuit depicted in Fig. 9.37a, it is found that the equivalent small-
signal circuit is given as in Fig. 9.37b. It is important to state that Rcopper is the
equivalent parallel resistance of the inductance internal resistance (due to copper),
whereas Rex = n2 R, where R is the external load for the oscillator circuit and n is
the ratio of the turns number of L and the turns number of the inductance connected
to R.
Finally, the resistances R1 and R2 in Fig. 9.37a disappear in Fig. 9.37b because
it is assumed that the impedance of CBP (parallel to R1 and R2 ) is very small
compared with the equivalent parallel resistance of R1 and R2 at the oscillation
frequency ω1 , i.e., ω1 C1BP
RR11+R
R2
2
. Moreover, if ω1 C1BP
hib , the capacitor
impedance can be neglected.
580 9 Feedback Electronic Circuits
βib
ic C i
1
B ih
ib hib E R t iout iout C1
C3 L R ex R cobre vo
ie
RE vout vout R in C2
The circuit in Fig. 9.34 is analyzed in this and the subsequent sections on the basis
of the equivalent small-signal circuit in Fig. 9.37b. The reader must remember that
all that is predicted by this analysis only stands around the operation point, which is
determined in the direct current analysis.
For analysis purposes, the feedback path through the emitter resistance is opened
as shown in Fig. 9.38 [5], pp. 265, [6], pp. 64. Rin in Fig. 9.38 is given as:
RE hib
Rin = Rt + . (9.28)
RE + hib
Now, we proceed to analyze the circuit in Fig. 9.38. The impedance between points
1 and 2 is given as:
where Yf (s) is the admittance between points 1 and 2. On the other hand, Vo (s) and
I (s) are related as:
where:
1 1 1 1
= Yf (s) + + sC3 + + . (9.31)
Zc (s) sL Rex Rcopper
sL(sRin (C1 + C2 ) + 1)
Zc (s) = , (9.32)
a3 s 3 + a2 s 2 + a1 s + 1
9.3 Design of Sinusoidal Waveform Oscillators 581
where Vout (s) and Vo (s) are related to current Ih (s) through:
1 1
Vo (s) = Ih (s), Vout (s) = Ih (s). (9.34)
Yf (s) 1
Rin + sC2
1 1 + Rin sC2
Vo (s) = Vout (s).
Yf (s) Rin
2 C C s+R C )
s(Rin
Vout (s) 1 2 in 1
M(s) = = 2 . (9.35)
Vo (s) Rin C2 (C1 + C2 )s 2 + Rin (2C2 + C1 )s + 1
Vout (s) 1 1
Iout (s) = = M(s)Vo (s) = M(s)Zc (s)I (s). (9.36)
Rin Rin Rin
On the other hand, applying the current divisor to the emitter circuit in Fig. 9.38, the
following is found:
−RE
Ie (s) = Iout (s).
RE + hib
Thus, if:
RE
hib , β
1, (9.37)
Iout (s) ≈ −Ie (s) = −(β + 1)Ib (s) ≈ −βIb (s) = I (s), (9.38)
582 9 Feedback Electronic Circuits
0 I (s) M (s )Z c(s )
Iout (s)
R in
+ +
(a)
(b)
Fig. 9.39 Equivalent block diagrams for the circuit in Fig. 9.38
i.e., the transistor current gain in the common base configuration is unitary.
According to the expressions in (9.36) and (9.38), the block diagram in Fig. 9.39a is
obtained. This block diagram has positive feedback, which is an important feature
for producing sustained oscillations. In Fig. 9.39b an equivalent block diagram is
shown, which, however, is now expressed as a negative feedback system. This
allows the application of classical control analysis and design tools when applied
to a closed-loop system such as that in Fig. 9.18d. Hence, the open-loop transfer
function is:
1
G(s)H (s) = − M(s)Zc (s). (9.39)
Rin
Let us first study the transfer functions M(s) and Zc (s). Note that all the coeffi-
cients of these transfer functions are positive. According to the criteria studied in
Sects. 4.2.1 and 4.2.2 on the coefficient signs of first- and second-order polynomials
and their corresponding roots, it is concluded that M(s) has two poles with a
negative real part, one zero with a negative real part and one zero at s = 0.
However, according to Sect. 4.2.3, the coefficient signs criterion cannot be
applied to Zc (s) because its denominator is a third-degree polynomial. Nevertheless,
a well-known result of the linear electric circuit theory1 can be employed. This result
states [7], Chapt. 19, Sects. 5 and 6, that the impedance of any network composed
only of passive circuit elements (resistances, capacitance, and inductances) is a
transfer function that only has poles with real parts, which are less than or equal
to zero. Note that this is the case of Zc (s). Furthermore, as Zc (s) has a denominator
with a term that is independent of s, then it is ensured that Zc (s) has three poles
with a negative real part, one zero with a negative real part, and one zero at s = 0.
According to the above discussion and what was presented in Chap. 6, it is
concluded that the Bode and polar plots of Zc (s) and M(s) have the shapes shown
in Figs. 9.40 and 9.41 respectively, whereas the polar plot of G(s)H (s) given in
(9.39) is shown in Fig. 9.42. It is important to stress that the polar plot of G(s)H (s)
is composed of two clockwise closed contours obtained as the frequency goes from
−∞ to +∞. The real axis is crossed twice at the frequencies ω = ±ω1 . Note
that, at these frequencies, the transfer function G(j ω)H (j ω) has a zero imaginary
part. Finally, as G(s)H (s) has two zeros at s = 0, to apply the Nyquist criterion the
contour shown in Fig. 6.79 must be performed around such zeros at origin. However,
as s = ε φ, with ε → 0, then G(s)H (s) → 0 along the complete contour; hence,
it is represented by a single point at the origin. Applying the Nyquist criterion, the
following conclusions are in order:
• If |G(j ω)H (j ω)|ω=w1 < 1, then closed-loop stability is ensured and sustained
oscillations are not possible. This is because Z = P +N , where P = 0 represents
the number of poles with positive real parts in G(s)H (s), N = 0 is the number
of clockwise contours around the point (−1, 0) in Fig. 9.42 and Z = 0 is the
number of closed-loop unstable poles.
• If |G(j ω)H (j ω)|ω=w1 > 1, then the closed-loop system is unstable because
Z = N + P = 2, with P = 0 and N = 2. This situation is clearly undesirable.
• If |G(j ω)H (j ω)|ω=w1 = 1, then there are two imaginary closed-loop poles that
allows the existence of sustained oscillations. The imaginary part of these poles
is ±ω1 representing the circuit oscillation frequency.
From these observations, a way of computing the values for the circuit elements
is presented next. However, given the complexity of the expressions defining
G(s)H (s), some assumptions about the circuit components must be considered.
1 ω2 C12 Rin 1 1
= + +
Zc (j ω) (ωRin (C1 + C2 ))2 + 1 Rex Rcopper
2 (C + C ) + 1
ω2 C2 Rin 1 2 1
+ j ωC1 + ωC3 − , (9.40)
(ωRin (C1 + C2 ))2 + 1 ωL
584 9 Feedback Electronic Circuits
(a)
Im (Z c(jω))
ω→–∞
ω=0
ω→+∞
Re (Z c(jω))
(b)
2 ω2 (C 2 + C C ) + j ωR C
Rin 1 2 in 1
M(j ω) = 1
. (9.41)
1 + Rin
2 ω2 (C + C )2
1 2
(a)
Im (M(jω))
ω=0 ω→+∞
ω→–∞
Re (M(jω))
(b)
Re(G(jω)H(jω))
1
ω1 = , (9.42)
C1 C2
L C1 +C2 + C3
586 9 Feedback Electronic Circuits
, which represents the circuit oscillation frequency. It is very important to state that,
to simplify these expressions to obtain (9.42), the following assumptions have to be
considered:
1 1
2
Rin
, 2
Rin
. (9.43)
ω12 C2 (C1 + C2 ) ω12 (C1 + C2 )2
Note that this phase is different from zero for any frequency. The above-cited
condition requiring the imaginary part of M(j ω) to be zero is equivalent to asking
for the phase in (9.44) to be zero. Although this is not possible, a phase that is close
to zero can be obtained for ω = ω1 if:
1
Rin
. (9.45)
ω1 (C1 + C2 )
This and the other approximations that have been considered result in only small
differences between the computed values and those obtained experimentally on the
oscillation frequency and the gain of the open-loop transfer function.
Finally, G(j ω)H (j ω)|ω=w1 is obtained as:
1
|G(j ω)H (j ω)|ω=w1 = Re(M(j ω))|ω=ω1 Re(Zc (j ω))|ω=ω1 , (9.46)
Rin
where Re(x) stands for the real part of x. From (9.46) and taking into account the
assumption in (9.45), the following is found:
⎡ ⎤
1 ⎢ 1 ⎥
|G(j ω)H (j ω)|ω=w1 = ⎣ ⎦.
Rin C1C+C 2 C12
+ 1
+ 1
1 Rin (C1 +C2 )2 Rex Rcopper
Hence, according to the condition |G(j ω)H (j ω)|ω=w1 = 1, it is concluded that the
circuit presents sustained oscillations at the frequency given in (9.42) if:
⎡ ⎤
1 ⎢ 1 ⎥
⎣ ⎦ = 1. (9.47)
Rin C1C+C 2 C12
+ 1
+ 1
1 Rin (C1 +C2 )2 Rex Rcopper
–B1 B1
–B2
This renders the circuit unstable when turned on and, because of that, the amplitude
of the oscillation increases. However, this amplitude growth does not stand forever
because the transistor reaches saturation (zero collector to emitter voltage and
maximal collector current) and cutoff (zero collector current and maximal collector
to emitter voltage) regions. Hence, Iout and I in Fig. 9.39b are related through a
saturation function as I = sat (Iout ) shown in Fig. 9.43. The transistor current
gain corresponds to the slope B 2
B1 , where B1 is the amplitude of Iout and B2 is the
amplitude of I . Then, the block diagram in Fig. 9.39b must be changed by that in
Fig. 9.44 and we now have:
⎡ ⎤
B2 1 ⎢ 1 ⎥
G(j ω)H (j ω)|ω=w1 = ⎣ ⎦.
B1 Rin C1 +C2 C12
+ 1
+ 1
C1
Rin (C1 +C2 )2 Rex Rcopper
(9.49)
B2
Note that the slope B1 is equal to 1 for the amplitudes of Iout , i.e., B1 , which
B2
are close to zero, but decreases to zero as B1 grows. Hence, if (9.48) is satisfied,
B1
there always exists an oscillation amplitude such that (9.49) becomes 1 and the
desired sustained oscillations are obtained. Although this suggests that the left hand
588 9 Feedback Electronic Circuits
B2
B1
C2 ≥ 10C1 , (9.51)
9.3 Design of Sinusoidal Waveform Oscillators 589
then it is ensured that the value of the factor between brackets in (9.48) is
approximately the equivalent parallel resistance of Rex and Rcopper . Hence, the
left hand in (9.48) is given by this equivalent parallel resistance (which is large
compared with Rin ) divided by the factor Rin (C1 + C2 )/C1 . This ratio can
be rendered slightly larger than 1 if (9.51) is used. Thus, the design rules for
the oscillator are summarized by (9.37), (9.50), (9.51), (9.42), and (9.48). It is
interesting to state that these conditions appear in the books concerned with the
electronic design of this class of oscillator [6], pp. 65, [8], pp. 9–13.
Finally, note the advantages of the frequency response techniques with respect
to the time response techniques (based on the location of the closed-loop system
poles) in this problem. When trying to apply the latter of these methods, a fifth-
order characteristic polynomial is found. When trying to use Routh’s criterion to
establish the conditions to obtain imaginary closed-loop poles, a complex problem
is found: the resulting conditions are expressed in a very complex manner and it
is difficult to find clear design rules such as those in (9.37), (9.42), (9.48), (9.50),
(9.51).
RE = 1[KOhm].
From iCQ = βiBQ it is found that iBQ = 6.5 × 10−3 [mA]. According to (9.18),
iR1Q = 1[mA] is proposed. With this and (9.17), (9.19), (9.20), the following is
computed:
R1 = 2[KOhm], R2 = 10[KOhm].
⎡ ⎤
1 ⎢ 1 ⎥
⎣ ⎦ = 1.1363,
Rin C1C+C 2 C12
+ 1
+ 1
1 Rin (C1 +C2 )2 Rex Rcopper
i.e., (9.48), (9.50), (9.37), are satisfied. On the other hand, CBP = 0.1 × 10−6 [F]
is used and ω1 C1BP = 0.883[Ohm]
RR11+R R2
2
= 1666[Ohm]. Furthermore,
0.883[Ohm]
hib = 20[Ohm]. Thus, all the design conditions established above
are satisfied. The voltage vo measured at the inductance terminals is shown in
Fig. 9.45. The frequency measured in this experiment is 1.388[MHz].
9.3 Design of Sinusoidal Waveform Oscillators 591
This means that the loop gain is smaller. Note that having a smaller loop gain
requires narrower oscillations; hence, a smaller incursion of the signal within the
transistor nonlinear region to achieve a unit loop gain, i.e., to ensure sustained
oscillations. Obtaining a larger oscillation amplitude in Fig. 9.45, when Rt =
10000[Ohm], is also explained in this manner. In fact, a slight distortion can be
observed at the bottom part of the sinusoidal waveform when Rt = 10000[Ohm].
Finally, in Figs.9.47a, b and 9.48a, the polar plots are shown for M(s), Zc (s)
and G(s)H (s) respectively, obtained with the numerical values referred to above
and Rt = 11000[Ohm]. Note the similarities between Figs. 9.47a and 9.41b, and
between Figs. 9.47b and 9.40b. Figures 9.42 and 9.48a are also very similar. The
apparent differences for the frequencies close to zero are because such a part cannot
be appreciated in Fig. 9.48a. This is verified in Fig. 9.48b, where a zoom-in is
presented in Fig. 9.48a, and it is observed that the polar plot is tangent to the positive
real axis in Fig. 9.42. It is observed in Fig. 9.48a that (9.52) is satisfied.
Figures 9.47a, b, 9.48a, and b were drawn using the following MATLAB code in
an m-file:
beta=200;
RE=1e3;
R1=2e3;
R2=10e3;
L=0.328e-3;
Rcobre=101.677e3;
C1=27e-12;
C2=200e-12;
C3=0;
Rex=100*Rcobre;
Rt=10e3;
VT=0.026;
IEQ=1.3e-3;
hib=VT/IEQ
Rin=Rt+RE*hib/(RE+hib);
num=[Rin^2*C1*C2 Rin*C1 0];
den=[Rin^2*C2*(C1+C2) Rin*(2*C2+C1) 1];
M=tf(num,den)
numzc=[L*Rin*(C1+C2) L 0];
a3=(L*C1*C2+L*C3*(C1+C2))*Rin;
a2=L*C1+L*C3+(Rcobre+Rex)/(Rcobre*Rex)*L*Rin*(C1+C2);
592 9 Feedback Electronic Circuits
0.1
0.08
0.06
0.04
0.02
Imaginary Axis
ω=0
0
ω→±∞
-0.02
-0.04
-0.06
-0.08
-0.1
-0.05 0 0.05 0.1 0.15
Real Axis
(a)
ω→–∞
ω=0
ω→+∞
(b)
Fig. 9.47 Polar plots using the numerical values for the circuit experimentally tested . (a) M(s).
(b) Zc (s)
9.3 Design of Sinusoidal Waveform Oscillators 593
0.8
0.6
0.4
0.2
Imaginary Axis
ω→0,±∞
0
-0.2
-0.4
-0.6
-0.8
-1
-1.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2
RealAxis
(a)
Nyquist Diagram
0.01
0.008
0.006
0.004
0.002
Imaginary Axis
−0.002
−0.004
−0.006
−0.008
−0.01
−0.01 −0.008 −0.006 −0.004 −0.002 0 0.002 0.004 0.006 0.008 0.01
Real Axis
(b)
Fig. 9.48 Polar plots using the numerical values of the circuit experimentally tested (continued) .
(a) G(s)H (s). (b) G(s)H (s) (zoom in)
594 9 Feedback Electronic Circuits
a1=Rin*(C1+C2)+(Rcobre+Rex)/(Rcobre*Rex)*L;
denzc=[a3 a2 a1 1];
Zc=tf(numzc,denzc)
GH=-M*Zc/Rin
figure(1)
nyquist(M)
axis([-0.05 0.15 -0.1 0.1])
figure(2)
nyquist(Zc)
figure(3)
nyquist(GH)
axis([-.01 .01 -.01 .01])
w=1/sqrt(L*( C1*C2/(C1+C2)+C3 ))
f=w/(2*pi)
vr = rπ ib + v1 , (9.53)
v1 = R3 ie = R3 (1 + β)ib ,
i.e.,
vr vr
ib = , R= = rπ + R3 (1 + β).
rπ + R3 (1 + β) ib
C
L11
+3
56K Q2
4700
1N914 +
1N914 1μ f 0.01μ f
5K
1K 10K
100K
0.01μ f
Q1
ib2 B E
ic2 C
R1
L22 β2 ib2 R2
rπ2
* Q2
E
R4
rπ
vr 1− = v1 ,
rπ + R3 (1 + β)
R3 (1 + β)
v1 = vr . (9.54)
rπ + R3 (1 + β)
ib B ic C
R υr +
rπ βib
–
Q1
ie E +
R3 v1
–
(a)
iL11 i ib
2
+
+ *
iC2 C B ib2 R3 L11 C R U2 (s)
R1 υ1
rπ2 + αR1 –
β2 ib2 vin2 R2 –
Q2 – 1 iC 2
Zin +
ie2 E
L22 U1 (s)
R4
*
–
(b) (c)
Fig. 9.51 Different sections of the circuit in Fig. 9.50 . (a) Transistor Q1 . (b) Transistor Q2 . (c)
Tuning and feedback circuit
where (αR1 ||R2 ||zin ) stands for the parallel equivalent resistance of αR1 , R2 , and
zin . Furthermore:
Moreover:
(αR1 ||R2 ||zin )
vin2 = v1 = zin ib2 ,
R3
(αR1 ||R2 ||zin ) ic2
ib2 = v1 = ,
zin R3 β2
(αR1 ||R2 ||zin )
ic2 = β2 v1 . (9.55)
zin R3
On the other hand, from Fig. 9.51c, the inductance matrix is found to be:
L11 L12
M= ,
L21 L22
because the arc depicted in Fig. 9.49 between L11 and L22 indicates that these coils
are magnetically coupled. Note that according to Sect. D.2, in Appendix D:
because iL11 and ic2 enter into the inductances L11 and L22 respectively at the
terminals with the polarity mark “∗’.’ This also means that the magnetic fluxes due
to iL11 and ic2 have the same sense. This is a necessary condition for a successful
operation of a regenerative RF receiver as it establishes positive feedback of the
electric current from the collector of transistor Q2 to the tuning circuit. Using (D.4),
in Appendix D, i.e.,
cof(Mj k )
Γkj = ,
det(M)
the invertances are computed to be:
L22
Γ11 = > 0, (9.57)
L11 L22 − L12 L21
L11
Γ22 = > 0,
L11 L22 − L12 L21
−L12
Γ12 = < 0,
L11 L22 − L12 L21
−L21
Γ21 = < 0,
L11 L22 − L12 L21
det(M) = L11 L22 − L12 L21 > 0.
Γ12 Γ22
Ic2 (s) = U2 (s) + U1 (s), (9.58)
s s
Γ11 1 Γ21
I (s) = sC + + U2 (s) + U1 (s), (9.59)
s R s
where U1 (s), U2 (s) are the Laplace transforms of voltages at nodes 1 and 2
respectively, as indicated in Fig. 9.51c, whereas Ic2 (s) and I (s) are the Laplace
598 9 Feedback Electronic Circuits
transforms of the collector current in the transistor Q2 , i.e., ic2 , and the electric
current entering from the antenna, i.e., i respectively.
According to Fig. 9.51c and to the convention adopted to define the polarity
marks in the coil terminals (see Sect. D.2, in Appendix D), if U2 (s) > 0 increases
then the terminal with the polarity mark in the coil L22 is positive, producing a
negative Ic2 (s), i.e., in the opposite direction defined for this current in Fig. 9.51c.
This fact is correctly predicted by the term Γs12 in (9.58), as Γ12 < 0. A similar
argument justifies the term Γs21 U1 (s) in (9.59), as Γ21 < 0 too.
Solving (9.58) for U1 (s), replacing in (9.59), using definitions in (9.57) and
rearranging, the following is found:
1
Cs L12
U2 (s) = I (s) + Ic2 (s) .
s2 + 1
RC s + 1
L11 C
L11
As U2 (s) = Vr (s), where Vr (s) = L{vr }, we can use (9.56) to obtain the block
diagram in Fig. 9.52 and:
Ic2 (s) γ C1 s
= .
I (s) s 2 + RC
1
− γ LL1112C s + 1
L11 C
It is clear from Fig. 9.52 that positive feedback exists from the collector circuit of
transistor Q2 to the tuning circuit. Furthermore, it is interesting to observe that
feedback is performed through the mutual inductance L12 > 0. This demonstrates
that positive feedback is present thanks to the magnetic coupling between the
inductances in the collector circuit of the transistor Q2 and the tuning circuit.
Note that the transfer function:
γ C1 s
G(s) = , (9.60)
s2 + 1
RC − γ LL1112C s + 1
L11 C
I(s) + 1
s U2(s) Ic2(s)
C
1 1 γ
s 2+ s +
RC L11 C
+
L12
L11
Fig. 9.52 Equivalent closed-loop block diagram of the circuit in Fig. 9.50
9.4 A Regenerative Radiofrequency Receiver 599
i.e.,
γ C1 1 L12
|G(j ω)| 1 = → ∞, as −γ → 0.
ω= L C
11
1
RC − γ LL1112C RC L11 C
Note that the last condition can be accomplished by suitably selecting γ , i.e.,
according to (9.56) by adjusting the potentiometer R1 , which implies modification
of α. This explains why the regenerative receivers are recognized to have very large
amplification gains. Moreover, it is recommended in the literature [10] to select the
feedback gain of a regenerative receiver such as that obtained just before sustained
oscillations appear. Note that G(s) in (9.60) is a second-order system with zero
damping if RC 1
− γ LL1112C = 0, which implies that sustained oscillations appear,
even when i = 0. This, however, is not good for a regenerative receiver as these
oscillations would dominate the circuit response; hence, the received radiofrequency
signal could not be processed. On the other hand, if the feedback gain is chosen
such that RC1
− γ LL1112C > 0 is small, then sustained oscillations are avoided, i.e.,
the circuit is stable, but |G(j ω)| 1 is still very large. Note that ω = L111 C
ω= L11 C
represents the frequency of the received signal that is selected to be processed, i.e.,
the frequency of the desired radio broadcast station.
For simulation purposes, the circuit in Fig. 9.49, introduced in [9], has the
following numerical values: L11 = 300 × 10−6 [H], C = 100 × 10−12 [F],
L12 = 2 × 10−6 [H], R1 = 9.7[KOhm], R2 = 100[KOhm], R4 = 1000 × 10 ×
103 /(11 × 103 )[OHm], β = β2 = 60, IBQ = 10 × 10−6 [A]. This allows a radio
signal of about 900[KHz] to be received. Using these values, we obtain the Bode
diagrams presented in Figs. 9.53, 9.54, 9.55, for different values of α. Note that the
magnitude of G(j ω) is greater than 30[dB] for all three values of α that have been
tested. Moreover, for α = 0.2619, the magnitude of G(j ω) is about 100[dB], which
represents an amplification of about 105 [A]/[A]. Thus, a very large gain is obtained
in this case.
Figures 9.53, 9.54, and 9.55 were drawn by executing the following several times:
MATLAB code in an m-file:
clc
clear all
L11=300e-6;
C=100e-12;
L12=2e-6;
R1=9.7e3;
600 9 Feedback Electronic Circuits
Bode Diagram
40
20
Magnitude (dB)
−20
−40
−60
90
45
Phase (deg)
−45
−90
106 107 108
Frequency (rad/s)
R2=100e3;
R4=1000*10e3/(11e3);
beta=60;
beta2=beta;
VT=0.026;
IBQ=10e-6;
rpi=VT/IBQ;
rpi2=rpi;
alfa=0.5/9.7%0.5/9.7%1.5/9.7%;%2.54/9.7;
zin=rpi2+R4*(1+beta2);
paralelo=1/( 1/(alfa*R1)+1/R2+1/zin );
R3=R1*(1-alfa)+paralelo;
gamma=beta2*paralelo/(zin*R3)*R3*(1+beta)/(rpi+R3*
(1+beta));
R=rpi+R3*(1+beta);
G=tf([gamma/C 0],[1 1/(R*C)-gamma*L12/(L11*C)
1/(L11*C)]);
w=2.4e8:0.000001e8:3.4e8;
bode(G)
9.5 Summary 601
Bode Diagram
60
40
Magnitude (dB)
20
−20
−40
90
45
Phase (deg)
−45
−90
106 107 108
Frequency (rad/s)
grid on
1/(R*C)-gamma*L12/(L11*C)
9.5 Summary
In this chapter, we have shown how to reduce the distortion produced by nonlinear
electronic circuits, how to implement analog controllers in practice using feedback
electronic circuits, and how to design and build electronic oscillator circuits
producing a sinusoidal waveform. The fundamental tool for solving these problems
is classical control, which includes the time response and the frequency response
approaches.
In the case of reducing distortion in nonlinear electronic circuits, the basic idea is
the use of feedback and a high loop gain to render the closed-loop system robust to
open-loop system uncertainties, i.e., nonlinearities. No stability analysis is required
for this solution because the circuits involved are assumed to have no dynamics, i.e.,
they can be modeled as static gains instead of differential equations.
602 9 Feedback Electronic Circuits
Bode Diagram
100
Magnitude (dB)
50
−50
90
45
Phase (deg)
−45
−90
106 107 108
Frequency (rad/s)
1. When is a system marginally stable? Why is this concept important in the design
of oscillator circuits?
2. Why is it said that it is not possible to design a completely linear oscillator
circuit? Why does a nonlinear electronic circuit solve this problem?
3. A bipolar junction transistor is a nonlinear electronic device, then why are
linear control techniques employed to design bipolar junction transistor-based
oscillator circuits?
4. Why are Zener diodes required in operational amplifier-based oscillator circuits?
Why are Zener diodes not employed in bipolar junction transistor-based oscilla-
tor circuits?
5. What is the so-called transistor small-signal model?
6. Why do you think oscillator circuits are positive feedback systems?
7. Why must an oscillator circuit be designed to be slightly unstable?
References
R L
+ i + T Θ Tc n 1
u ea Jm bL
Tp
bm JL
– –
n2 TL θ
Fig. 10.1 A loaded permanent magnet (PM) brushed direct current (DC) motor
Applying Kirchhoff’s voltage law (see Fig. 10.1), the following is found:
applied voltage = voltage drops in the mesh,
u = voltage drop at inductance + voltage drop at resistance +
+counter electromotive force,
di
u=L + R i + ea , (10.1)
dt
where, according to (2.92) in Chap. 2, the counter electromotive force is given as:
ea = ke Θ̇,
Newton’s Second Law must be applied separately to each one of the two bodies: the
motor’s rotor and its load.
inertia × angular acceleration = torques applied to inertia Jm ,
T = km i.
The addition on the right-hand side of (10.2) is algebraic, i.e., the signs indicate
the sense of the corresponding applied torque. A negative sign indicates that the
torque opposes the motion of the inertia Jm , whereas a positive sign indicates that
the torque favors the motion of the inertia Jm .
Because of the presence of a gear box, it is necessary to use (2.86) and (2.87),
Chap. 2, to conclude that:
n2
Θ = n θ, n= , (10.3)
n1
TL = n Tc , (10.4)
JL θ̈ = TL − bL θ̇ − Tp . (10.5)
The motor’s mechanical subsystem model is obtained using (10.2), (10.5), (10.3),
and (10.4) as:
608 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
1
Jm Θ̈ = km i − bm Θ̇ −
TL ,
n
1
Jm Θ̈ = km i − bm Θ̇ − JL θ̈ + bL θ̇ + Tp ,
n
1
n Jm θ̈ = km i − bm nθ̇ − JL θ̈ + bL θ̇ + Tp ,
n
n2 Jm + JL θ̈ + n2 bm + bL θ̇ = n km i − Tp . (10.6)
Defining:
J = n2 Jm + JL , b = n2 bm + bL , (10.7)
J θ̈ + bθ̇ = n km i − Tp . (10.8)
Finally, the complete motor mathematical model is given by (10.1) and (10.8), i.e.,
di
L = u − R i − n ke θ̇ , (10.9)
dt
J θ̈ = −b θ̇ + n km i − Tp . (10.10)
Note that the differential equation in (10.10) is identical to that presented in (2.118)
corresponding to the system shown in Fig. 2.29a, Chap. 2. The only differences are
because (2.118) is expressed in terms of an applied external torque (which is equal
to km i in a DC motor) and (2.118) does not take into account any external torque
applied on body 2 (Tp = 0), i.e., on the load.
The differential equations in (10.9) and (10.10) represent the mathematical model
of the DC motor-load system because the load position θ can be found as a function
of time by solving these differential equations if all the constants involved are known
in addition to the voltage applied at the armature terminals. Using the Laplace
transform in (10.9) and (10.10) by assuming zero initial conditions, the following is
found:
1
I (s) = [U (s) − n ke sθ (s)], (10.11)
sL + R
1
θ (s) = 2 [n km I (s) − Tp (s)], (10.12)
s J + sb
where I (s), U (s), θ (s) and Tp (s), stand for Laplace transforms of i, u, θ and Tp
respectively.
10.3 Electric Current Control 609
u = Ap ui . (10.13)
A common technique for motor control in industry [6], pp. 76, [7, 8], is to employ
an internal electric current loop. In the simplest version, this internal loop employs
a proportional electric current controller. This means that the control signal is
computed as:
where I ∗ (s) is the Laplace transform of i ∗ . Combining (10.11), (10.12), and (10.16),
the block diagram in Fig. 10.2a is found. As demonstrated in the Example 4.4,
Sect. 4.1, Fig. 10.2a can be simplified as shown in Figs. 10.2b and c. It is also
revealed in Example 4.4, Sect. 4.1, that from Fig. 10.2c, the following can be written:
where:
nkm
G1 (s) = 2k k
, (10.18)
sL+R
KAp+ 1 (sJ + b) + nKA m e
p
s
− sL+R
KAp + 1
G2 (s) = . (10.19)
n2 km ke
KAp + 1 (sJ + b) + KAp
sL+R
s
If the proportional gain K is chosen to be large enough, then it can be assumed that
[6], pp. 76:
sL + R n2 km ke
≈ 0, ≈ 0,
KAp KAp
nkm
G1 (s) = , (10.20)
s 2 J + sb
−1
G2 (s) = 2 . (10.21)
s J + bs
1
θ (s) = [nkm I ∗ (s) − Tp (s)], (10.22)
s2J + sb
which is represented by the block diagram in Fig. 10.2d. Note that the objective
of the electric current control shown in (10.15) is to render the motor’s electrical
dynamics negligible such that the motor model is now represented only by the
motor mechanical subsystem. This can be clearly seen if (10.22) and (10.12) are
compared. These expressions indicate that electric current can now be used as
the control variable instead of voltage. It is clear that voltage is still the variable
that is directly manipulated, as indicated in (10.15); however, for analysis and
10.3 Electric Current Control 611
U i ( s) T p ( s)
–
I *(s) + U ( s) 1 I(s) + 1 θ (s)
K Ap nkm
+ Ls+R Js 2 +bs
–
–
nke s
T p ( s)
I *(s) + – θ (s)
+ 1 I(s) + 1
KAp nkm
Ls+R Js 2 +bs
– –
nke
KA p
s
T p ( s)
–
I *(s) + KA p I(s) + 1 θ (s)
nkm
Ls+R+KA p Js 2 +bs
–
nke
KA p
s
T p ( s)
–
I *(s) + θ (s)
1
nkm Js 2 +bs
Fig. 10.2 Equivalent block diagrams for a PM brushed DC motor provided with a proportional
current loop and a power amplifier
design purposes it can be assumed that electric current is the variable that is
directly manipulated through the commanded current i ∗ . The purpose of the electric
current control (10.15) is to accomplish that the actual electric current i tracks the
commanded current i ∗ . A large value of K is very useful for this. Note that the
expression in (10.22) can be rewritten as:
612 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
1 1
θ (s) = [kI ∗ (s) − Tp (s)] (10.23)
s(s + a) J
b nkm
a= , k= .
J J
10.4 Identification
kA
ω(t) = 1 − e−at . (10.26)
a
The time constant τ can be measured as shown in Fig. 10.3 and, using τ = a1 , the
numerical value of a can be computed. On the other hand, defining the final value of
the velocity as ωf = limt→∞ ω(t) = kA a and, using the value of a just computed,
aω
k = Af can be found.
Some results obtained when performing the experiment described above are
shown in Fig. 10.4. The noise content in velocity measurements is evidence for a
well-known fact in control systems: velocity is a noisy signal. See Sect. 10.6 for an
explanation of why ω is measured in volts. In Fig. 10.4, i ∗ = A = 0.3[A] is used
and by direct measurement in Fig 10.4, the following is found:
time
Fig. 10.3 Velocity evolution in a PM brushed DC motor when a constant i ∗ = A is applied
These measurements are simplified and rendered more exact if a computer program
is employed to perform them. Using these values and the procedure described above,
614 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
The main objective of control design is to ensure that the desired transient and
steady-state response specifications are achieved. The transient response specifica-
tions refer to how fast the closed-loop system is desired to respond. This is achieved
by suitably assigning the closed-loop poles. On the other hand, the steady-state
specifications refer to the difference that is desired to exist between the measured
velocity ω and the desired velocity ωd when time increases. Moreover, this must
stand despite the presence of the external disturbance Tp (s). The controller is the
device responsible for ensuring that all these specifications are satisfied.
Suppose that the desired velocity is a constant, i.e., a step function. Then, ωd is a
constant that may be positive, negative or zero. As the plant in (10.24) has no poles
at s = 0, then the system type is 0. This means that the use of a proportional velocity
controller with the form i ∗ = kp (ωd − ω), with kp > 0, cannot achieve ω = ωd
in a steady state even if no external torque disturbance is present, i.e., even when
Tp = 0. The solution to this problem is a controller with an integral action to render
the system type 1, i.e., a proportional–integral (PI) controller. However, as explained
in Sect. 5.2.4, a PI controller cannot simultaneously achieve the desired transient
response specifications and a satisfactory rejection of external disturbances Tp (s).
It is for this reason that the design of a modified PI velocity controller is presented
in the following, which is capable of simultaneously achieving these requirements.
1
ω̇ + aω = ki ∗ − Tp . (10.29)
J
In the following, it is shown that the use of the controller:
t a
i ∗ = kp (ωd − ω) + ki (ωd − ω(r))dr + ωd + k1 (ω(0) − ωd ), (10.30)
0 k
10.5 Velocity Control 615
where ω(0) is the initial velocity, ensures that: 1) The motor velocity ω reaches
the desired constant velocity ωd in a steady state. 2) This is achieved with a time
constant that is arbitrarily assigned. 3) The effects of a constant disturbance Tp are
compensated for as fast as desired.
Replacing (10.30) in (10.29) and rearranging:
t
1
ω̇ + (a + kp k)(ω − ωd ) + ki k (ω(r) − ωd )dr = k1 k(ω(0) − ωd ) − Tp .
0 J
Defining:
kp = kp + k1 ,
and defining:
ki = ki k1 ,
then:
t . /
ω̇ + (a + kp k)(ω − ωd ) + k1 k ki (ω(r) − ωd ) + (ω̇(r) − ω̇d ) dr
0
1
= − Tp . (10.31)
J
As ωd is a constant, then ω̇d = 0. Hence, if:
ki = a + kp k,
t
. /
ξ = ω̇(r) + ki (ω(r) − ωd ) dr,
0
1
ξ̇ + k1 kξ = − Tp .
J
616 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
− J1
ξ(s) = Tp (s),
s + k1 k
or:
− J1 s
sξ(s) = Tp (s). (10.32)
s + k1 k
td
If Tp = td is a constant, i.e., Tp (s) = s, then:
− J1 s td
sξ(s) = .
s + k1 k s
This means that the effect of the constant disturbance disappears as time increases
and the remaining differential equation ω̇ + ki ω = ki ωd , which is stable if ki >
0, possesses the time constant τ = k1 and has a unit gain in a steady state. This
i
means that:
• If no perturbation exists (Tp = 0 and ξ̇ (t) = 0 for all t ≥ 0), the velocity
response is as that of a first-order system with time constant τ = k1 . The velocity
i
ω reaches the desired velocity ωd (which is constant) in a steady state.
• If a constant disturbance appears (Tp = td = 0), the deviation produced by
such a disturbance vanishes as time increases. Moreover, if a larger k1 is chosen
(such that the product k1 k > 0 is larger), then the deviation due to the disturbance
vanishes faster. If once the deviation due to the disturbance is taken to zero (when
ω = ωd ), a step change is commanded in the desired velocity ωd (a change in ωd
is commanded when the disturbance Tp is present), then the velocity responds as
if the disturbance Tp is not present, i.e., as in the previous item: with τ = k1 as
i
the time constant and velocity ω reaches its desired value ωd in a steady state.
10.5 Velocity Control 617
As the initial conditions are always assumed to be zero in classical control, then
ω(0) = 0 can be assumed and the controller in (10.30) becomes:
t a
i ∗ = kp (ωd − ω) + ki (ωd − ω(r))dr + − k1 ωd , (10.33)
0 k
which constitutes a simple PI controller with a constant feedforward term. Finally,
the tuning rule is summarized by:
kp = kp + k1 , (10.34)
ki = ki k1 ,
ki = a + kp k,
where:
• kp > 0 is chosen to define the desired time constant τ = 1
ki
= 1
a+kp k , which
1
is always less than the time constant of the plant to be controlled a , i.e.,
a very
convenient feature.
• k1 > 0 is chosen large for a fast rejection of the disturbance effects. This can
be done by trial and error or it can be computed recalling that k11k is the time
constant of the filter in (10.32), which is responsible for the elimination of the
deviation due to the disturbance.
Another, better known, way of designing a PI controller with the same advantages
found above is by using two-degrees-of-freedom controllers. These are presented in
the following section.
where:
Gc1 (s)Gp (s)
G1 (s) = ,
1 + (Gc1 (s) + Gc2 (s))Gp (s)
Gp (s)
G2 (s) = , (10.35)
1 + (Gc1 (s) + Gc2 (s))Gp (s)
618 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
k
Gp (s) = .
s+a
Also assume that Gc1 (s) and Gc2 (s) are PI controllers, i.e.,
Suppose that the closed-loop response is desired to be as that of a first- order with
a pole at s = −p1 , with p1 > 0. Then, the characteristic polynomial in the last
expression must satisfy:
s 2 + (a + kp k)s + ki k = (s + p1 )(s + f ),
= s 2 + (p1 + f )s + p1 f,
a + kp k = p1 + f, ki k = p1 f,
10.5 Velocity Control 619
i.e.,
p1 + f − a p1 f
kp = , ki = .
k k
On the other hand, to obtain a response of a first order with a pole at s = −p1 , the
transfer function in (10.36) must satisfy:
ω(s) p1 (s + f ) p1 (s + f ) p1
= 2 = = . (10.37)
ωd (s) s + (a + kp k)s + ki k (s + p1 )(s + f ) s + p1
skGc1 (s) = p1 (s + f ).
kp1 s + ki1 p1 p1 f
Gc1 (s) = , kp1 = , ki1 = .
s k k
kp2 s + ki2 f −a
Gc2 (s) = Gc (s) − Gc1 (s) = , kp2 = , ki2 = 0.
s k
This means that Gc2 (s) = kp2 is a proportional controller. On the other hand, the
second transfer function in (10.35) becomes:
k
ω(s) s+a
= kp s+ki k
,
D(s) 1+ s s+a
ks
= ,
s 2 + (a + kp k)s + ki k
ks
= . (10.38)
(s + p1 )(s + f )
Using this expression and the final value theorem, it can be verified that the effect
of a constant external disturbance D(s) = − Jtks d
vanishes as time increases.
Furthermore, this is achieved faster as f and p1 are larger. As p1 is fixed by the
desired response to a constant velocity command, then f is the free parameter. Thus,
f must be chosen to be large. According to Fig. 10.5, the controller is given as:
D(s)
+
! d (s) + I *(s) !(s)
Gc1 (s) Gp (s)
+ +
– –
Gc2 (s)
f
k1 = , p1 = ki ,
k
are defined. Thus, it is up to the reader to decide which of the approaches presented
in Sect. 10.5.1 or 10.5.2 is preferred.
w,[0,12.3]V
TL081
w,[0,5]V
Ω
+
-
8
GCD
9
Ω
+
10 7
Tx
MAX232
1 μF
11 6
12 5
1 μF
13 4
Rx Tx
+
Rx
DB9
14 3
1Ω
1 μF
15 2
1 μF
+
+
16 1
1 μF
MCD
+
u
+5V
TIP141
TIP145
2
4
POWER AMPLIFIER
1
+15V
5
DAC0800
0.1 μF
-15V
6
+15V
0.1 μF
7
13
8
TL081
Ω
+
-
3
12 11 10 9
0.01 μF
-15V
ui
16
CURRENT
CONTROL
Ω
330 Ω
Ω
21 20
+15V
19
Ω
22
TL081
Vref
23 18
+
-
24 17
25 16
PIC16F877A
26 15
Ω
27 14
28 13
29 12
30 11
+5V
31 10
[-3.5,3.5] A
– i*
32 9
+5V 8
33
TL081
34 7
Ω
35 6
+
-
36 5
37 4
38 3
39 2
40 1
Ω +5V
Fig. 10.6 Electric diagram of the complete velocity control system for a PM brushed DC motor
which results from the graphical relation presented in Fig. 10.7. Once “iastd” is com-
puted, it is delivered to the digital/analog converter through port D (PORTD=iastd).
The digital/analog converter works together with an operational amplifier TL081.
These devices are connected following the manufacturer’s suggestions [10]. This
ensures that, at the operational amplifier output, a voltage is obtained whose
numerical value corresponds to −i ∗ . This voltage is received by another operational
amplifier TL081 devoted to implementing the current controller, i.e., to compute:
ui = 100(i ∗ − i).
The reason why −i ∗ must appear at the indicated place in Fig. 10.6 has to do with
the sign operations performed by the operational amplifiers in this figure. On the
other hand, a unit gain power amplifier is composed of a third operational amplifier
TL081 together with two power transistors TIP141 and TIP145 in a complementary
symmetry connection.
The circuit MAX232 is devoted to sending the measured velocity ω and the
control signal i ∗ to a portable computer (through a USB to a series adapter)
whose unique purpose is the graphical representation of those variables. This
is performed through the variables “cuentaH=0x00” and “cuentaL=t_0” (to send
velocity) or “cuentaH=0x00” and “cuentaL=(iastd) &(0xFF)” (to send the control
10.6 Experimental Prototype 623
127
signal). These data are sent to the portable computer through the instructions:
putc(0xAA); putc(cuentaH); putc(cuentaL);. Finally, the timer TMR0 is employed
to fix the sample time T = 0.002[seg] (40 counts of timer 0).
According to Sect. 9.1.2, the block labeled “power amplifier,” in Fig. 10.6, allows
us to reduce the dead zone introduced by the power transistors in a complementary
symmetry connection. Moreover, with the indicated values Ap = 1 is accomplished
in (10.13) and (10.15). This results in Ap K = 100. This value has been chosen
because a good performance was obtained. It is important to stress that large
values such as Ap K = 700 are employed in commercial drivers for industrial
applications [8].
624 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
Tp1
wd1 k
Tp2
s+a
PID(s)
wd2 Add3
Add2 Add1 Scope
Add
a/k-k1 Datos
wd3
Gain
Fig. 10.8 MATLAB/Simulink diagram used to obtain the results in Fig. 10.9
Some simulation results obtained with the controller in (10.33) (or, equivalently,
with the controller in (10.40)), employing the MATLAB/Simulink diagram in
Fig. 10.8 are presented in Fig. 10.9. Starting from a zero initial velocity, the
following desired velocity is commanded:
⎧
⎨ 1.5, 0 ≤ t < 4
ωd = 2.5, 4 ≤ t < 12 . (10.41)
⎩
1.5, t ≥ 12
, which fixes the desired time constant as τ = 0.6231[s]. The reader can verify that
the labels in Fig. 10.9 prove that the desired time constant is accomplished when
applying the desired velocity steps. Also note that the effects of the disturbance Tp
are kept small and disappear very fast.
The wd and Tp blocks in Fig. 10.8 are suitably programmed to produce the
desired velocity defined in (10.41) and the disturbance Tp defined above respec-
tively. The PI controller block has kp and ki as the proportional and integral gains
respectively, whereas the To workspace block is programmed to save data as an
array with 0.001 as sample time. The graphical results in Fig. 10.9 were obtained by
executing the following MATLAB code in an m-file:
10.7 Simulation Results 625
3
2.5
X: 12.62
Y: 1.868
2 X: 4.629
w [V]
Y: 2.134
1.5
1
X: 0.6228
0.5 Y: 0.9479
0
0 2 4 6 8 10 12 14 16 18 20 22
3
2
1
i* [A]
0
−1
−2
−3
0 2 4 6 8 10 12 14 16 18 20 22
t [s]
a=0.3704;
k=2.4691;
T=0.6231; %time constant, sec
kpp=(1/T-a)/k
k1=40;
kp=kpp+k1;
kip=a+kpp*k;
ki=kip*k1;
Tp=2.5;
then simulation in Fig. 10.8 is run, and, finally, the following code is executed in an
m-file:
Ts=0.001;
t=0:Ts:22;
figure(1)
subplot(2,1,1)
plot(t,Datos(:,1),’b--’);
hold on
plot(t,Datos(:,2),’b-’);
hold off
axis([0 22 0 3])
ylabel(’w [V]’)
626 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
subplot(2,1,2)
plot(t,Datos(:,3),’b-’);
axis([0 22 -3.5 3.5])
xlabel(’t [s]’)
ylabel(’i* [A]’)
Some experimental results obtained with the controller in (10.33) (or, equivalently,
with the controller in (10.40)), employing the experimental prototype described
in Sect. 10.6, are presented in Fig. 10.10. Starting from a zero initial velocity, the
desired velocity in (10.41) is commanded. Also, disturbance Tp and the controller
gains are the same as those described in Sect. 10.7. The velocity measured in the
experiment is shown in Fig. 10.10. The white line represents the response obtained
in simulation for the system without disturbances:
ki 1
= a, τ= = 0.6231[s], (10.43)
kp kp k
according to the discussion in Sect. 5.2.4, with τ the desired closed-loop system
time constant. The desired velocity ωd is identical to that shown in (10.41) and a
disturbance is applied that is identical to that used in Fig. 10.10, i.e., it is applied via
software with a constant value Tp = 2.5 at t = 8[s] and disappears at t = 17[s].
The following is observed:
• Although the transient response is close to the desired one, it is not as good as
that in Fig. 10.10 (the thin line represents the desired transient response).
10.8 Experimental Results 627
ω 3
[V] 2.5
2
1.5
1 0:632 × 1:5
0.5
0
0 2 4 6 8 10 12 14 16 18 20 22
0:623
i* 3
[A] 2
1
0
-1
-2
-3
0 2 4 6 8 10 12 14 16 18 20 22
tiempo [s]
Fig. 10.10 Velocity control using the modified PI controller shown in (10.33) (or, equivalently,
with the controller in (10.40))
ω
[V]
0:623
i*
[A]
t [s]
Fig. 10.11 Classical proportional–integral (PI) velocity control using the tuning rule in (10.43)
628 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
• The measured velocity reaches the desired velocity in a steady state when no
external disturbance is applied, i.e., before t = 8[s].
• The deviation produced by the external disturbance is much larger than in
Fig. 10.10 and it vanishes much more slowly. In fact, this deviation is not
compensated for before a new change in the desired velocity appears at t = 12[s].
The same is observed when the disturbance disappears at t = 17[s]. According
to Sect. 5.2.4, this is because the dynamics of the disturbance rejection has a
dominant time constant that is equal to the motor open-loop time constant, a1 ,
which is 2.7[s] as indicated in (10.27).
The experimental results shown in Fig. 10.12 are obtained using a classical PI
controller whose gains are chosen according to:
ki l2 l3
= d, d = 1.4 < p1 , kp = , (10.44)
kp l1 k
1
l1 = abs(−p1 + d), l2 = abs(−p1 ), l3 = abs(−p1 + a), p1 = = 1.6.
0.6231
This tuning criterion is introduced in (5.25), Sect. 5.2.4, where τ = 0.6231[s] is
the slowest time constant present in the disturbance rejection dynamics. This time
constant is chosen to be equal to the desired time constant when the system responds
to the desired velocity because, according to (10.38), this is the slowest time constant
that is present in the disturbance rejection shown in Fig. 10.10 (f > p1 for the
numerical values employed). The desired velocity ωd is identical to that shown
in (10.41) and a disturbance is applied that is identical to that used in Fig. 10.10,
i.e., it is constant with value Tp = 2.5, it is applied via software at t = 8[s], and
disappears at t = 17[s]. The following is observed:
• The deviation due to the disturbance vanishes almost as fast as in Fig. 10.10.
• Although the transient response to the reference of velocity is very fast, it does
not correspond to the desired transient response represented by the thin line in
Fig. 10.12. As explained in Sect. 5.2.4, this is because the closed-loop system
has two poles, one assigned at s = −p1 , but the other is far to the left of this
point. Moreover, the pole located at s = − 0.6231
1
= −1.6 = −p1 is very close
to the zero at s = −d = −1.4, i.e., its effects are significantly compensated
for (cancelled) and only the dynamics of the fast pole located far to the left is
observed.
The experimental results in Figs. 10.11 and 10.12 corroborate the observations
presented in Sect. 5.2.4 on classical PI velocity control: there is no tuning rule
allowing us to compute the proportional and integral gains to simultaneously achieve
the desired specifications for the transient response to a velocity reference and for
a satisfactory disturbance rejection. This motivates the design of the modified PI
controller presented in (10.33) whose experimental results are shown in Fig. 10.10.
10.9 Microcontroller PIC16F877A Programming 629
ω 3
[V]
2.5
1.5
0.5
0
0 2 4 6 8 10 12 14 16 18 20 22
0:623 tiempo [s]
Fig. 10.12 Classical PI velocity control using the tuning rule in (10.44)
The flow diagram for the Microcontroller PIC16F877A programming when control-
ling velocity in a PM brushed DC motor is presented in Fig. 10.13. The complete
code is listed in the following. The reader is referred to [11] for a precise explanation
of each one of the instructions in the program.
#fuses HS,NOWDT,PUT,NOBROWNOUT,NOLVP,NOWRT,NOPROTECT,NOCPD
START
PARAMETERS
MEASURE VELOCITY.
YES APPLY A
DISTURBANCE
NO
INCREASE TIME.
Fig. 10.13 Flow diagram for microcontroller PIC16F877A programming when controlling veloc-
ity in a PM brushed DC motor
int8 cuentaH,cuentaL,puerto,AB,AB_1,aux;
int8 cont,iastd,cont2,cont3,cont4,t_0;
10.9 Microcontroller PIC16F877A Programming 631
float w,error,iast,wm1,kp,ki,ie,k,a,wd,tiempo,kpp,k3,kib,cte;
unsigned int u,i;
//------------Interrupt subroutine------------//
#int_rb void rb_isr() {
puerto=PORTB;
AB=((puerto)&(0x30))>>4;
aux=AB^AB_1;
if(aux!=0)
if(aux!=3)
if(((AB_1<<1)^AB)&(0x02))
cuenta--;
else
cuenta++;
AB_1=AB;
}
//------------Main program------------//
void main(void) {
setup_adc(ADC_CLOCK_INTERNAL ); //ADC (internal clock)
set_tris_a(0b11111111);
set_tris_b(0b11111111);
set_tris_c(0b10000000); //Serial communication
set_tris_d(0b00000000);
set_tris_e(0b11111111);
OPTION=0x07; //pre_scaler timer0, 1:256
PORTC=0;
TMR0=0;
cuenta=0;
AB=0;
AB_1=0;
enable_interrupts(global);
enable_interrupts(int_rb);
cont=4;
cont2=0;
cont3=0;
cont4=0;
PORTD=127;
k=2.4691;
a=1/2.7;
kpp=0.5;
k3=4.0;
kp=kpp+k3;
kib=a+k*kpp;
ki=kib*k3;
cte=a/k-k3;
tiempo=0.0;
wm1=0.0;
ie=0.0;
ADCON1=0x04;
ADCON0=0x81;
while(cont2<3)
{
while(cont3<255)
{
TMR0=0;
632 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
while(TMR0<255)
{
}
cont3++;
}
cont2++;
}
TMR0=0;
while(TRUE)
{
cont++;
ADCON0=0x81; //Changing to CH0
for(i=0;i<37;i++); //Stabilizing internal capacitor
t_0=read_adc(); //Read ADC
w=0.0196*t_0;
if(tiempo<4.0)
wd=1.5;
else
if(tiempo<12.0)
wd=2.5;
else
wd=1.5;
// wd=2.5;
error=wd-w;
/* Controller */
iast=kp*error+ki*ie+cte*wd;
ie=ie+0.002*error;
/* ___________________________________________ */
if(iast<-3.3)
iast=-3.3;
if(iast>3.3)
iast=3.3;
// iast=0.3;
iast=-iast;
if(tiempo>8.0)
{
if(tiempo<17.0)
iast=iast+2.5;
}
iastd=(unsigned int)(36.4286*iast+127);
PORTD=iastd;
wm1=w;
/*
// inter=(cuenta)&(0xFF00);
cuentaH=0x00; //inter>>8;
cuentaL=t_0;//(cuenta)&(0x00FF);
putc(0xAA); //Recognition serial port
putc(cuentaH); //Sending to serial port
putc(cuentaL);
if(cont==5)
{
cont=0;
cont4++;
if(cont4==255)
10.10 Frequency Response-Based Design 633
cont4=0;
}
*/
if(tiempo>8.0)
{
if(tiempo<17.0)
iast=iast-2.5;
}
iast=-iast;
iastd=(unsigned int)(36.4286*iast+127);
// inter=(cuenta)&(0xFF00);
cuentaH=0x00; //inter>>8;
cuentaL=(iastd)&(0xFF);
putc(0xAA); //Recognition serial port
putc(cuentaH); //sending to serial port
putc(cuentaL);
if(cont==5)
{
cont=0;
cont4++;
if(cont4==255)
cont4=0;
}
PC1=1; //waiting for sampling time
while(TMR0<40) // 1 count=(4/FXtal)*256 seg, 40=2 ms
{
}
PC1=0; //sampling time has arrived
TMR0=0;
tiempo=tiempo+0.002;
} //closing the infinite while
} //closing mian
B
A
[dB]
Fig. 10.14 Bode diagrams from the experimental data used for model identification. Continuous:
asymptotes. Dashed: experimental data (Table 10.1)
2. This experiment has been performed for several values of frequency ω, and the
results are presented in Table 10.1. Note that only the amplitude of the sinusoidal
functions is taken into account. Moreover, the phase φ is not considered.
3. The Bode diagrams obtained from Table 10.1 are presented in Fig. 10.14. One
0[dB/dec] asymptote and one −20[dB/dec] asymptote fit these experimental data
well. This means that the velocity motor model must have the following structure:
ω(s) k
= . (10.45)
U (s) s+a
a = 3.3 (10.46)
As the motor model in 10.45 has no pole at s = 0, then a controller with integral
action is required to render the system type 1. This ensures a zero steady-state
error if the desired velocity is constant. Hence, given the first-order structure of
the motor model, the design of a proportional–integral (PI) controller is well suited
(see Fig. 10.15).
This means that the open loop transfer function is given as:
kp s + ki k
G(s)H (s) = .
s s+a
636 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
Fig. 10.17 Experimental response of the control system in Fig. 10.16, i.e., an integral controller
of velocity with ki = 1, kp = 0
Bode Diagram
50
40
30
Magnitude (dB)
20 System: g
Frequency (rad/sec): 7.56
10 Magnitude (dB): −0.042
0
−10
−20
−30
−40
−50
−90
Phase (deg)
−135
System: g
Frequency (rad/sec): 7.57
Phase (deg): −156
−180
10−1 100 101 102
Frequency (rad/sec)
k
Fig. 10.18 Bode diagrams of the factor s(s+a) , where (10.46) and (10.47) are used
to find ζ = 0.5169. According to Table 6.5, this requires a 52◦ phase margin.
k
In Fig. 10.18 the Bode diagrams of the factor s(s+a) are presented where (10.46)
and (10.47) are used. It is observed that the crossover frequency is ω1 = 7.55[rad/s]
(to be kept) and the phase is −156◦ . This means that a 28◦ phase lead has to be
contributed by the controller, i.e., by the factor z + 1, when ω = ω1 = 7.55[rad/s].
In Fig. 10.19, it is found that a 28◦ phase lead is obtained when ωb = 0.53. Hence,
using ω = ω1 = 7.55[rad/s] b = 14.2453 is obtained. On the other hand, from the
magnitude condition:
1 −1.09
kp = 10 20 = 0.0619.
b
Finally, from ki = bkp , the following is found:
ki = 0.8821.
638 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
Bode Diagram
40
35
30
Magnitude (dB)
25
20
15
10 System: gc
Frequency (rad/sec): 0.53
5 Magnitude (dB): 1.09
0
90
Phase (deg)
45
System: gc
Frequency (rad/sec): 0.53
Phase (deg): 28
0
10−2 10−1 100 101 102
Frequency (rad/sec)
Fig. 10.19 Bode diagrams of the factor z + 1. The horizontal axis represents ω
b
Bode Diagram
50
40
30
Magnitude (dB)
20 System: ghc
Frequency (rad/sec): 7.54
10
Magnitude (dB): 0.0102
0
−10
−20
−30
−40
−50
−90
−100
Phase (deg)
−110
and the relations in (10.34). These gains were selected such that the time responses
are approximately the same. Note that the controller in (10.33) forces a first-order
response when step changes in the desired velocity are commanded. A constant
disturbance is applied for t ≥ 17[s] via software. This is done by adding the constant
2.5[V] to the voltage that is delivered by the controller, which has to be applied to
the motor. We realize that the effects of the disturbance are a little smaller for the
controller in (10.33), although the rejection time is almost the same.
Note that the disturbance rejection with both controllers is not so different than
what happens with the responses obtained in Sect. 10.8 for a classical PI controller
and controller in (10.33). The key to understanding this is to recall that the PI
controller in Sect. 10.8 is designed by imposing kkpi = a, which results in a slow
rejection of external disturbances, as explained in Sect. 5.2.4. On the other hand,
the classical PI controller in the present section is designed without imposing such
a constraint. Thus, a faster disturbance rejection is accomplished. Note, however,
that this design has been performed without taking into consideration the desired
specifications for the disturbance rejection response.
Figures 10.14, and 10.18 to 10.21, in addition to all computations involved in
controller design, were performed using the following MATLAB code in an m-file:
640 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
Step Response
1.4
System: M
Time (sec): 0.396
Amplitude: 1.21
1.2
1
System: M
Time (sec): 0.235
Amplitude: 0.998
Amplitude
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Time (sec)
Fig. 10.21 Simulation response of the control system in Fig. 10.15 when a unit step in the desired
velocity is applied. kp = 0.0619, ki = 0.8821, (10.46), and (10.47) are used
ω
[rad=s]
t [s]
u
[V]
t [s]
Fig. 10.22 Experimental response when using the control scheme in Fig. 10.15, with gains kp =
0.0619 and ki = 0.8821
10.10 Frequency Response-Based Design 641
ω
[rad=s]
t[s]
u
[V]
t[s]
Fig. 10.23 Experimental comparison of the control scheme in Fig. 10.15 (continuous) and the
controller in (10.33) (dashed)
clc
W=[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 2 3 4 5 6 7 8 9 10
20 30 40 50 60 70 80 90 100];
B=[18.68 18.85 18.85 18.07 17.68 18.46 18.46 18.46 17.67
17.67 16.1 14.14 12.17 11 9.42 8.25 7.46 6.68 6.29 3.15
2.35 1.96 1.57 1.18 1.18 0.79 0.79 0.79];
A=[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
magnitude=20*log10(B./A);
figure(1)
semilogx(W,magnitude,’r-’)
grid on
line([0.1 100],[25.5 25.5])
line([3.3 330],[25.5 -14.5])
a=3.3;
k=a*(10^(25.5/20))
trd=0.21; % tr desired
g=tf(k,[1 a 0]); % estimate DC motor model + integral ctrl
figure(2)
bode(g)
grid on
w1=7.55;
phase=-156;
Mpd=15;
zd=sqrt(log(Mpd/100)^2/(log(Mpd/100)^2+pi^2))
Kfd=52;
phased=-(180-52);
phase_lead=(156+phased) % 28 degrees
gc=tf([1 1],1)
figure(3)
642 10 Velocity Control of a Permanent Magnet Brushed Direct Current Motor
bode(gc)
grid on
b=w1/0.53;
kp=10^(-1.09/20)/b
ki=kp*b
ctrl=tf([kp ki],[1 0]);
motor=tf(k,[1 a]);
ghc=ctrl*motor;
figure(4)
bode(ghc)
grid on
M=feedback(ghc,1,-1)
figure(5)
step(M)
grid on
The electric diagram, in addition to the computer program used to evaluate control
algorithms, is identical to the electric diagram and the Builder 6 C++ code listed
in Chap. 12. The only difference is that in Chap. 12, two encoders have to be
read, whereas in the present chapter only one encoder is to be read. The sampling
period used in the present section was 0.01[s]. Also, a microcontroller PI16F877A
is used in Chap. 12 and in the present chapter. The code for programming this
microcontroller is identical in both chapters. Again, in the present chapter, only
one encoder has to be read. Thus, the code of the program is simpler in the present
case.
In particular, the frequency response experiments performed for model identi-
fication in Sect. 10.10.1 require the following voltage u = 2 + A sin(ω̄t)[V] to
be applied at the armature terminals of the motor. This is accomplished by writing
the program line “iast=2.0+A*sin(w t);,” provided that A=0.5 and w are defined as
constants in the non-executable part of the program. This is all we need, because,
according to Chap. 12, the control program and hardware are so contrived that
the numerical value of the variable “iast” appears as a voltage signal at the motor
armature terminals.
This prototype has been built because it presents some advantages when perform-
ing the frequency response experiments described in Sect. 10.10.1. When using the
prototype depicted in Fig. 10.6 for frequency response identification, the velocity
of the motor has a large drift, which poses difficulties for the measurement of the
velocity amplitude. Such a problem is eliminated with the new prototype.
10.12 Review Questions 643
10.11 Summary
References
In this chapter, we continue with the control of a permanent magnet (PM) brushed
DC motor, but now the position control problem is considered. To this aim, the
motor model in (10.23) is considered after a power amplifier and a current loop
have been included (see Sects. 10.2 and 10.3). This model is rewritten here for ease
of reference:
1 1
θ (s) = [kI ∗ (s) − Tp (s)], (11.1)
s(s + a) J
b nkm
a= , k= ,
J J
where θ (s) is the angular position to be controlled, I ∗ (s) is the input or the control
variable, and Tp (s) is an external torque disturbance.
11.1 Identification
In this section, an experiment is designed that allows us to know the values of the
constants k and a in the model (11.1). In the following, the way of performing
this experiment is explained. Suppose that no external disturbance is applied, i.e.,
Tp (s) = 0; hence, the model (11.1) becomes:
k
θ (s) = I ∗ (s). (11.2)
s(s + a)
i ∗ = kp (θd − θ ), (11.3)
θ (s) kp k ωn2
= 2 = 2 , (11.5)
θd (s) s + as + kp k s + 2ζ ωn s + ωn2
a
ωn = kp k, ζ = . (11.6)
2 kp k
According to (11.5) and Sect. 3.3.1, if the desired position θd is a step the
obtained time response θ (t) presents an overshoot and a rise time given as:
−√ ζ
π
Mp (%) = 100 × e 1−ζ 2 , (11.7)
1 1 − ζ2
tr = π − arctan , (11.8)
ωd ζ
if 0 ≤ ζ < 1. This can always be achieved using a large enough value for kp .
From (11.7) and (11.8), the following is found:
%
&
& ln2 Mp(%)
& 100
ζ =' , (11.9)
Mp(%)
ln2 + π2
100
1 1 − ζ2
ωd = π − arctan , (11.10)
tr ζ
ωd
ωn = . (11.11)
1 − ζ2
These measurements are simplified and rendered more exact if a computer program
is employed. Following the above procedure, the following is found:
Finally, it is important to state that, as in the case of the velocity model, it is not
necessary to compute the value of the factor 1/J appearing as coefficient of the
disturbance Tp (s) in (11.1). This is because Tp is also unknown and, despite this,
its effect can be compensated for.
The controller design is intended to ensure that the closed-loop transient and steady-
state response specifications is achieved. The transient response specifications refer
to the desired rise time and overshoot. These specifications are satisfied by suitably
assigning the closed-loop poles. On the other hand, the steady-state specifications
are achieved by ensuring that the measured position θ reaches its desired value θd
as time increases. The controller is a device designed in such a way that the desired
transient and steady-state response specifications are satisfied.
Suppose that the desired position is a constant or a step, i.e., θd = A is a constant.
As the plant in (11.1) has one pole at s = 0, then the system type is 1, which
ensures that θ = θd = A in a steady state, if a proportional position controller is
used and no external disturbance is present, i.e., if Tp = 0. This means that the
requirement to reach the desired position is naturally satisfied by the plant, i.e., the
DC motor. Hence, the controller design is to be performed merely to satisfy the
transient response specifications, i.e., to suitably assign the closed-loop poles. In the
case of a DC motor, there are two simple controllers allowing the closed-loop poles
to be suitably located: (i) Proportional position control with velocity feedback. (ii)
A lead compensator.
648 11 Position Control of a PM Brushed DC Motor
θ
[rad]
i*
[A]
t [s]
The block diagram resulting from the combination of (11.14) and (11.2) is depicted
in Fig. 11.3. The closed-loop transfer function is:
θ (s) kp k ωn2
= 2 = 2 ,
θd (s) s + (a + kv k)s + kp k s + 2ζ ωn s + ωn2
a + kv k
ωn = kp k, ζ = . (11.15)
2 kp k
11.2 Position Control When External Disturbances Are Not Present (Tp = 0) 649
θd(s) + + I*(s) k
θ(s)
kp s(s+a)
– –
kvs
Thus, it is always possible to find positive values for kv and kp such that the
desired ζ and ωn are obtained. This means that it is always possible to assign the
closed-loop poles (s + ζ ωn + j ωd )(s + ζ ωn − j ωd ) = s 2 + 2ζ ωn s + ωn2 , at any point
on the left half-plane, by a suitable selection of kp and kv . For instance, consider the
numerical values in (11.12). Suppose that overshoot and rise time are desired to be:
Using these data and (11.9)–(11.11), it is found that the closed-loop poles must be
located at:
s = −ζ ωn ± j ωd = −15.4009 ± j 30.0623,
with ζ = 0.4559 and ωn = 33.7776. Finally, using these values, (11.12), (11.15),
and (11.16), it is found that the following controller gains are required to achieve
the desired rise time and overshoot:
Some simulation results obtained when using these controller gains, the motor
parameters in (11.12), and the control scheme in Fig. 11.3 are shown in Fig. 11.4.
The desired position is θd = 1.5[rad]. From these results, it is possible to verify that
overshoot is 20% and rise time is 0.068[s], as desired. This simulation is performed
using the following MATLAB code in an m-file:
k=675.4471;
a=2.8681;
kp=1.6891;
kv=0.0414;
gm=tf(k,[1 a 0]);
velfeedck=tf(kv*[1 0],1);
gc1=feedback(gm,velfeedck,-1);
M=feedback(kp*gc1,1,-1);
figure(1)
650 11 Position Control of a PM Brushed DC Motor
1.5
Amplitude
System: untitled1
Time (sec): 0.0681
1 Amplitude: 1.5
0.5
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Time (sec)
Fig. 11.4 Proportional position control with velocity feedback. Simulation results
subplot(2,1,1)
step(M*1.5)
The experimental results obtained with controller (11.13) and gains in (11.17),
when θd is a step, are shown in Fig. 11.5. Overshoot and rise time measured in this
experiment are:
I ∗ (s) s+d
=γ , (11.18)
E(s) s+c
11.2 Position Control When External Disturbances Are Not Present (Tp = 0) 651
θ
[rad]
i*
[A]
t [s]
Fig. 11.5 Proportional position control with velocity feedback. Experimental results (θd =
1.5[rad])
where E(s) is the Laplace transform of the difference e = θd − θ , i.e., the system
error, whereas γ , d and c are positive constants to be computed and they are
constrained to satisfy d < c.
The block diagram resulting from the connection of (11.18) and (11.2) is shown
in Fig. 11.6. Note that the open-loop transfer function:
γ k(s + d)
G(s)H (s) = , (11.19)
s(s + c)(s + a)
has three poles, i.e., the closed-loop transfer function also has three poles and one
zero at s = −d. It is left as an exercise for the reader to find the closed-loop transfer
function to verify that it has the form:
θ (s) γ k(s + d)
= . (11.20)
θd (s) (s − p1 )(s − p2 )(s − p3 )
In this case, besides assigning the complex conjugate poles p1 and p2 at the
desired locations, it must be ensured that the third pole, at p3 , and the zero at s = −d
do not significantly modify the transient response. As discussed in Sect. 5.2.3, this
652 11 Position Control of a PM Brushed DC Motor
1.5
Amplitude
System: untitled1
Time (sec): 0.0684
1 Amplitude: 1.51
0.5
0
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Time (sec)
Fig. 11.7 Position control with a lead compensator. Simulation results (θd = 1.5[rad])
is achieved by setting:
ωn2
d = a, c = 2ζ ωn , γ = .
k
Using this tuning rule and the parameters in (11.12), it is found that use of the gains:
s = −ζ ωn ± j ωd = −15.4009 ± j 30.0623.
k=675.4471;
a=2.8681;
gm=tf(k,[1 a 0]);
d=a;
z=0.4559;
11.2 Position Control When External Disturbances Are Not Present (Tp = 0) 653
θ
[rad]
i*
[A]
t [s]
Fig. 11.8 Position control with a lead compensator. Experimental results (θd = 1.5[rad])
wn=33.7776;
c=2*z*wn
gamma=wn^2/k
gc=tf(gamma*[1 d],[1 c]);
M=feedback(gc*gm,1,-1)
figure(1)
subplot(2,1,1)
step(M*1.5,0.4)
td
Tp = td , Tp (s) = ,
s
where td is a constant different from zero. This means that the possibility that an
external agent applies a torque at the motor shaft is considered. The controller design
must be performed such that the effect of such a disturbance on the system output
must vanish as fast as possible.
In this class of applications, it is common to employ a proportional–integral–
derivative (PID) controller because its integral part is intended to cope with the
deviations due to the constant disturbance. However, as stated in Sect. 5.2.5, a tuning
rule is not at the disposal of the designer, allowing us to compute the PID controller
gains to simultaneously achieve the desired transient response specifications (rise
time and overshoot) and a satisfactory external disturbance rejection. Motivated by
this situation, two new controllers are introduced in the following sections that are
specially designed to simultaneously achieve these specifications.
The use of the inverse Laplace transform in (11.1) yields the following differential
equation:
1
θ̈ + a θ̇ = ki ∗ − Tp . (11.21)
J
It is shown next that the following controller allows us to find a tuning rule, solving
the problem described above:
t
i ∗ = κp (θd − θ ) − κd θ̇ + k1 κp k (θd − θ (r))dr − k1 (θ̇ − θ̇ (0)),
0
−k1 (a + κd k)(θ − θ (0)), (11.22)
where θd is a constant standing for the desired position whereas θ (0) and θ̇(0)
represent the position and the velocity initial values respectively. Using the fact that:
t
θ̇ − θ̇(0) = θ̈ (r)dr,
0
t
θ − θ (0) = θ̇ (r)dr,
0
11.3 Control Under the Effect of External Disturbances 655
θ̈ + (a + κd k)θ̇ + κp k(θ − θd )
t
. / 1
+k1 k θ̈ (r) + (a + κd k)θ̇(r) + κp k(θ (r) − θd ) dr = − Tp .
0 J
Applying the Laplace transform to (11.23) and assuming all initial conditions to be
zero, the following is obtained:
− J1
ξ(s) = Tp (s),
s + k1 k
or:
− J1 s
sξ(s) = Tp (s). (11.24)
s + k1 k
td
If the disturbance is constant, i.e., Tp (s) = s, then the final value theorem can be
used to find:
− J1 s td
= lim s = 0.
s→0 s + k1 k s
656 11 Position Control of a PM Brushed DC Motor
Hence, if k1 k > 0, the filter in (11.24) is stable and it is ensured that limt→∞ ξ̇ (t) =
0. Moreover, the larger is k1 k > 0 the faster ξ̇ (t) approaches zero. Note that
limt→∞ ξ̇ (t) = 0 implies that:
d t . /
θ̈ (r) + (a + κd k)θ̇(r) + κp k(θ (r) − θd ) dr,
dt 0
= θ̈ + (a + κd k)θ̇ + κp k(θ − θd ) → 0.
This means that the effect of a constant disturbance vanishes as time increases and
the only thing that remains is the differential equation θ̈ + (a + κd k)θ̇ + κp kθ =
κp kθd . This differential equation is stable if κp > 0 and κd > 0, has a unit gain in a
steady state, and the gains κp , κd , can be used to arbitrarily assign the poles of the
system. Thus:
• If no disturbance is present (Tp = 0 and ξ̇ (t) = 0 for all t ≥ 0), the response
in the position is as the response of a second-order system with rise time and
overshoot that can be arbitrarily assigned by suitably selecting κp and κd . The
position θ reaches the desired position θd (constant) in a steady state.
• If a constant disturbance appears (Tp = td = 0), the deviation that it produces
vanishes as time increases. Moreover, if a larger k1 is chosen (such that the
product k1 k > 0 is larger), then the deviation due to the disturbance vanishes
faster. If, once the deviation due to a disturbance vanishes (once θ = θd ), a
step change in the desired position θd is commanded (i.e., when the disturbance
Tp is still present), then the position response is identical to that obtained when
Tp = 0, i.e., the rise time and overshoot are identical as before and the position
θ reaches its desired value θd in a steady state.
As all initial conditions are assumed to be zero in classical control, then θ (0) = 0,
θ̇ (0) = 0, can be assumed and the controller in (11.22) becomes:
t
i ∗ = κp (θd − θ ) − κd θ̇ + k1 κp k (θd − θ (r))dr − k1 θ̇ − k1 (a + κd k)θ,
0
t
= [κp + k1 (a + κd k)](θd − θ ) − (κd + k1 )θ̇ + k1 κp k (θd − θ (r))dr
0
−k1 (a + κd k)θd ,
t
= KP (θd − θ ) − KD θ̇ + KI (θd − θ (r))dr − k1 (a + kd k)θd , (11.25)
0
KP = κp + k1 (a + κd k), KD = κ d + k 1 , KI = k1 κp k,
which constitutes a simple PID controller with a constant feedforward term. Note
that the derivative term does not contain a time derivative of the desired position.
Finally, the tuning rule of the controller in (11.25) is summarized as follows:
11.3 Control Under the Effect of External Disturbances 657
• κp > 0 and κd > 0 are chosen to fix the desired rise time and overshoot by
suitably assigning the roots of the characteristic polynomial s 2 + (a + κd k)s +
κp k, i.e.,
a + κd k = 2ζ ωn , κp k = ωn2 . (11.26)
• k1 > 0 is chosen large for a fast disturbance rejection. This can be done by trial
and error or it can be computed recalling that k11k is the time constant of the filter
in (11.24), which is responsible for the disturbance rejection.
Another, better known, way of designing a PID controller with the same
advantages is by using two-degrees-of-freedom controllers. These is presented in
the next section.
where:
Gc1 (s)Gp (s)
G1 (s) = ,
1 + (Gc1 (s) + Gc2 (s))Gp (s)
Gp (s)
G2 (s) = , (11.27)
1 + (Gc1 (s) + Gc2 (s))Gp (s)
D(s)
+
θd(s) + I*(s) θ(s)
Gc1(s) Gp(s)
+ +
– –
Gc2(s)
k
Gp (s) = . (11.28)
s(s + a)
The controller design presented in this section assumes that Gc1 (s) and Gc2 (s) are
PID controllers [5], chapter 10; hence:
k
θ (s) Gc1 (s) s(s+a)
= ,
θd (s) kd (s 2 +(α+β)s+αβ)
1+ s
k
s(s+a)
skGc1 (s)
= ,
s 2 (s + a) + kd k(s 2 + (α + β)s + αβ)
11.3 Control Under the Effect of External Disturbances 659
skGc1 (s)
= . (11.30)
s 3 + (a + kd k)s 2 + kd k(α + β)s + kd kαβ
Suppose that the desired transient response is described by two dominant complex
conjugate poles given as s = −σ + j ωd and s = −σ − j ωd , σ > 0, ωd > 0. Then,
the characteristic polynomial must satisfy:
a + kd k = 2σ + f, (11.31)
kd k(α + β) = σ 2
+ ωd2 + 2σf, (11.32)
kd kαβ = (σ 2 + ωd2 )f. (11.33)
θ (s) ρ(s + f )
= , (11.34)
θd (s) s + (2σ + f )s + (σ 2 + ωd2 + 2σf )s + (σ 2 + ωd2 )f
3 2
where, to obtain a transfer function with a unit gain in a steady state, the following
must be satisfied:
ρf = (σ 2 + ωd2 )f,
i.e.,
ρ = σ 2 + ωd2 . (11.35)
On the other hand, to render the transfer functions in (11.30) and (11.34) equal, the
following must be imposed:
where:
ρs + ρf 1
Gc1 (s) = = kp1 + ki1 , (11.36)
sk s
(σ 2 + ωd2 ) (σ 2 + ωd2 )f
kp1 = , ki1 = .
k k
660 11 Position Control of a PM Brushed DC Motor
This means that Gc1 (s) must be a proportional–integral (PI) controller. The
controller Gc2 (s) is obtained solving (11.29):
where (11.31), (11.32), (11.33), have been used. This means that Gc2 (s) is a PD
controller. Thus, according to Fig. 11.9, the controller is given as:
As in the previous sections, it is desired that the response to a position step command
has a rise time of 0.068[s] and a 20% overshoot, which corresponds to closed-loop
poles at s = −σ ± j ωd , where:
On the other hand, the value of f does not affect the transient response to a desired
reference because its effect is canceled (see (11.34)). What is then the effect of f
and how to compute it? The key to an answer is the following:
• According to (11.31), once σ , a, k, are fixed, the derivative gain kd is larger
if f is larger. According to the previous sections, large derivative gains are not
desirable because of noise amplification. Hence, a criterion is to select f as small
as possible.
• The transfer function in (11.27) is computed as:
θ (s) ks
= .
D(s) (s + σ + j ωd )(s + σ − j ωd )(s + f )
Note that the pole at s = −f cannot be canceled in this transfer function, i.e.,
its effect is very important in the transient response to an external disturbance.
11.3 Control Under the Effect of External Disturbances 661
Hence, the smaller f is, the slower the disturbance effect vanishes. In this respect,
note that the final value theorem can be used to verify that the zero that this
transfer function has at s = 0 ensures that the effect of a constant disturbance
vanishes in a steady state.
Thus, f must be selected such that a trade-off between a fast disturbance rejection
and noise attenuation is satisfied. Propose:
f = 40. (11.40)
k = 675.4471, a = 2.8681,
1
Gc1 (s) = 1.6891 + 67.5659 , (11.41)
s
Gc2 (s) = 0.1006s + 1.8241. (11.42)
One last observation. The reader can verify that the controller in (11.38) is identical
to the controller in (11.25) if (11.26) is satisfied and the following is established:
f
k1 = , σ = ζ ωn , σ 2 + ωd2 = ωn2 .
k
It is up to the reader to decide which of the approaches presented in Sects. 11.3.1
or 11.3.2 is preferred.
Some simulation results are presented in Fig. 11.10 when using the controller
in (11.43) and the motor parameters k = 675.4471, a = 2.8681. There, a step
change in the desired position is commanded and tr = 0.068[s], Mp (%) = 19.6%,
are measured, which are almost identical to the values specified above, i.e., tr =
0.068[s] and Mp (%) = 20%. A constant disturbance is also considered D(s) =
−Tp (s)/(J k) = −0.5/s. This disturbance is introduced via software as a signal
that adds to i ∗ , given in (11.43), from t = 0.7[s] on. Note that the steady-state
error is zero. On the other hand, a very good response is observed when the external
disturbance appears.
Some other simulation results are shown in Fig. 11.11 when using the con-
troller (11.43). In this case, the following desired position is commanded:
662 11 Position Control of a PM Brushed DC Motor
⎧
⎨ 1.5, 0 ≤ t < 1.5
θd = 3, 1.5 ≤ t < 4 . (11.44)
⎩
1.5, t ≥4
Comparing Figs. 11.10 and 11.11, it is clear that the desired transient and steady-
state response specifications are satisfied. Moreover, note that the step changes in the
reference commanded at t = 1.5[s] and t = 4[s] occur when the disturbance d(t) is
present and, despite this, the transient response specifications are still satisfied. Also
note that the deviations due to the disturbances vanish very fast.
Some experimental results are presented in Fig. 11.12 under the same conditions
as in Fig. 11.10. The following values are measured tr = 0.068[s] and Mp (%) =
19.3%. Note that these experimental results are very similar to the simulation results
in Fig. 11.10. It is stressed that the very good response observed when an external
disturbance appears is thanks to f = 40, and that such a large value is possible
because of the low noise content in the measured position θ .
Some other experimental results are shown in Fig. 11.13 that were performed
under the same conditions as the simulations in Fig. 11.11. Aside from the measured
position (continuous line) the response obtained in simulation (dashed line) is also
shown in Fig. 11.13. The simulation response is obtained with the second-order
system without disturbances θ̈ + 30.8018θ̇ + 1140.9θ = 1140.9θd , which satisfies
the design specifications tr = 0.068[s] and Mp (%) = 20%, with poles located at
s = −15.4009 ± j 30.0623. It is observed that both responses are almost identical
and they cannot be distinguished from each other in Fig. 11.13. This shows that
the desired transient and steady-state response specifications are satisfied in the
experiment. These experimental results corroborate the observations stated just
before (11.25).
The simulations in Figs. 11.10 and 11.11 were performed using the MAT-
LAB/Simulink diagram shown in Fig. 11.14 and the following steps: (1) Execute
the following MATLAB code in an m-file:
a=2.8681;
k=675.4471;
f=40;
Mp=20; %
tr=0.068; % sec
11.3 Control Under the Effect of External Disturbances 663
2 X: 0.103
Y: 1.793
1.5
X: 0.068
theta [rad]
Y: 1.499
1
0.5
0
0 0.2 0.4 0.6 0.8 1 1.2
3
2
1
i* [A]
0
−1
−2
−3
0 0.2 0.4 0.6 0.8 1 1.2
t [s]
Fig. 11.10 Position control using a two-degrees-of-freedom controller. Simulation results (θd =
1.5[rad])
(2) Run the simulation in Fig. 11.14. (3) Run the following MATLAB code in an
m-file:
Ts=0.001;
t=0:Ts:6.5;
figure(1)
664 11 Position Control of a PM Brushed DC Motor
3
theta [rad]
0
0 1 2 3 4 5 6
3
2
1
i* [A]
0
−1
−2
−3
0 1 2 3 4 5 6
t [s]
subplot(2,1,1)
plot(t,Datos(:,1),’b--’);
hold on
plot(t,Datos(:,2),’b-’);
hold off
axis([-0.1 6.5 0 4])
ylabel(’theta [rad]’)
subplot(2,1,2)
plot(t,Datos(:,3),’b-’);
axis([-0.1 6.5 -3.5 3.5])
xlabel(’t [s]’)
ylabel(’i* [A]’)
figure(2)
subplot(2,1,1)
plot(t,Datos(:,1),’b--’);
hold on
plot(t,Datos(:,2),’b-’);
hold off
11.3 Control Under the Effect of External Disturbances 665
θ
[rad]
i*
[A]
t [s]
θ
[rad]
i*
[A]
t [s]
kp
D1
Gain1
k
thetad1 D2
kd du/dt 2
Gain3 Derivative
thetad2
Add2 Add1 1 Scope
ki Add3
s
Gain2 Integrator
thetad3 kp2 Add Datos
Gain
D3
D4 D5
Fig. 11.14 MATLAB/Simulink diagram used for simulations in Figs. 11.10 and 11.11
To appreciate the advantages of the controller designed in Sects. 11.3.1 and 11.3.2,
some experimental results are presented in Figs. 11.15 and 11.16, when using the
following classical PID controller:
t
∗ d
i = kp (θd − θ ) + kd (θd − θ ) + ki (θd − θ (r))dr.
dt 0
11.3 Control Under the Effect of External Disturbances 667
θ
[rad]
i*
[A]
t [s]
The desired position and the external disturbance are the same used in Fig. 11.13,
i.e., those defined in (11.44) and (11.45). The measured position (continuous line)
is presented in addition to the response obtained in the simulation (dashed line).
The simulation response is, again, obtained from the system without disturbances
θ̈ + 30.8018θ̇ + 1140.9θ = 1140.9θd , which achieves tr = 0.068[s] and Mp (%) =
20%, with poles located at s = −15.4009 ± j 30.0623.
The classical PID controller design is performed according to Sect. 5.2.5. Using
the plant parameters:
k = 675.4471, a = 2.8681,
s = −15.4009 ± j 30.0623,
to achieve 0.068[s] as the rise time and 20% overshoot, the design parameter α =
0.01, and (5.30), (5.32), the following controller gains are obtained:
θ
[rad]
i*
[A]
t [s]
The corresponding experimental results are shown in Fig. 11.16. Note that the
deviation due to the disturbance varnishes very fast. However, the price to pay for
this improvement is that the response to a step change in the desired position does
not satisfy the desired specifications. This is the main drawback of classical PID
control: there is no tuning rule at the disposal of the designer to compute controller
11.4 Trajectory Tracking 669
In this section, a controller is designed that allows the motor position to reach a
time-varying desired position, i.e., θd (t) is no longer constant, but changes over
time. It is assumed that no external disturbance exists, i.e., Tp (s) = 0, and the
first and second time derivatives of θd (t) can be computed, i.e., θ̇d (t) and θ̈d (t) are
known and they are continuous. Consider the motor model in (11.1) once the inverse
Laplace transform is applied with Tp (s) = 0, i.e.,
θ̈ + a θ̇ = ki ∗ . (11.46)
Also consider the following controller, where θd , θ̇d and θ̈d are known:
1 d 2 θd (t) dθ (t) dθd (t) dθ (t)
i ∗ (t) = − k d − − k p (θ (t) − θd (t)) + a .
k dt 2 dt dt dt
(11.47)
Define the tracking error and its Laplace transform as ε(t) = θ (t) − θd (t) and E(s)
respectively. Then, (11.48) can be written as:
dε(0)
s 2 E(s) − sε(0) − + kd sE(s) − kd ε(0) + kp E(s) = 0, (11.49)
dt
and finally:
where the forced response is zero εf (t) = 0 because the differential equation
in (11.49) is not excited. Hence, ε(t) = εn (t), which tends toward zero as time
grows if the roots of the characteristic polynomial s 2 + kd s + kp have a negative real
part. This situation is desirable because if ε(t) tends toward zero, then θ (t) tends
toward θd (t) as time grows. On the other hand, as the characteristic polynomial
s 2 + kd s + kp is second-degree, according to Sect. 4.2, its two roots have a negative
real part if, and only if, all the coefficients of this polynomial have the same sign,
i.e., if, and only if, kp > 0 and kd > 0. This is the criterion for selecting the gains for
this controller. However, it is important to stress that the controller gains achieving
a good performance in practice must be selected within this set of gains by trial and
error. Some experimental results are shown in Fig. 11.17 when using a motor with
k = 25.26, a = 3.5201, together with the controller in (11.47), the controller gains:
kp = 363.88, kd = 22,
Note that θ reaches the desired position θd (t) despite these variables having different
initial values. It is important to state that, as a mathematical expression is known
for θd , which is given in (11.51), the corresponding expressions for θ̇d and θ̈d
are computed analytically by differentiation. This avoids problems due to noise
amplification.
The electrical diagram of the complete control system is presented in Fig. 11.18.
The main components are the following:
• PM brushed DC motor. Nominal voltage 20[V], nominal current 3[A]. Provided
with an optical encoder with 400 ppr, which requires +5 DC voltage.
• A portable computer with USB port.
• USB-series adapter.
• Microchip PIC16F877A Microcontroller.
• DAC0800LCN Digital/analog converter.
• TL084 quadruple operational amplifier.
• TL081 operational amplifier.
• MAX232 driver.
• TIP141 and TIP145 transistors.
Microcontroller PIC16F877A computes the control algorithm. Once the desired
position θd and the measured position θ are known, the microcontroller computes
the control signal i ∗ . This value is assigned to the variable “iast” according to
program listed in Sect. 11.6.
11.5 Prototype Construction 671
[v]
i*
[A]
t [s]
Fig. 11.17 Trajectory tracking. Motor measured position θ is represented by the dashed line. The
continuous line represents θd (t)
which corresponds to the relation shown in Fig. 11.19. The digital/analog converter
works together with an operational amplifier TL081. These devices are connected
according to the manufacturer’s specifications [1]. This ensures that, at the oper-
ational amplifier output, a voltage appears whose numerical value corresponds to
−i ∗ . This value is received by an operational amplifier TL081, which evaluates the
electric current controller [6, 7]:
ui = 100(i ∗ − i).
672 11 Position Control of a PM Brushed DC Motor
9 8
ENCODER
+
10 7
1 μF
Tx
MAX232
11 6
12 5 +5V
1 μF
Rx Tx 13 4
+
Rx
DB9
θ
14 3
1Ω
1 μF
1 μF
15 2
+
1 μF
16 1
MCD
+
u
+5V
TIP141
TIP145
2
4
POWER AMPLIFIER
1
+15V
5
0.1 μF
DAC0800
-15V
6
+15V
0.1 μF
7
13
8
TL081
Ω
+
-
3
12 11 10 9
0.01 μF
-15V
ui
16
CURRENT
CONTROL
Ω
330 Ω
Ω
21 20
+15V
19
Ω
22
TL081
Vref
23 18
+
-
24 17
25 16
PIC16F877A
26 15 Ω
Ω
27 14
28 13
29 12
30 11
+5V
31 10
[-3.5,3.5] A
9
–i*
32
+5V 8
33
TL081
34 7
Ω
35 6
+
-
36 5
B
37 4
38 3
Ω
39 2
+5V
A
40 1
Fig. 11.18 Electrical diagram of the complete position control system based on a PIC16F877A
microcontroller
Finally, a power amplifier with a unit gain is implemented with a third operational
amplifier TL081 and two power transistors TIP141 and TIP145 in a complementary
symmetry connection.
The driver MAX232 sends the measured position θ and the control signal i ∗
to a portable computer (through an USB series adapter) whose unique task is
to plot these variables. In the following, it is described how the microcontroller
PIC16F877A performs the controller task. It is stressed that the following exposition
is not intended to present deep explanations of how the microcontroller works.
We are merely presenting a general description of the microcontroller components
involved in the specific task to be performed. The program employed by the
microcontroller is listed in the next section.
11.6 Microcontroller PIC16F877A Programming 673
127
START
PARAMETERS
YES APPLY A
DISTURBANCE
NO
Fig. 11.20 Flow diagram for the programming of microcontroller PIC16F877A when controlling
the position in a permanent magnet (PM) brushed DC motor
#fuses HS,NOWDT,PUT,NOBROWNOUT,NOLVP,NOWRT,NOPROTECT,NOCPD
#usedelay(clock=20000000) //time basis
#use
rs232(baud=115200,XMIT=PIN_C6,RCV=PIN_C7,BITS=8,PARITY=N)
//Config.
11.6 Microcontroller PIC16F877A Programming 675
//serial port
//ports and registers addresses
#byte OPTION= 0x81
#byte TMR0 = 0x01
#byte PORTA = 0x05
#byte PORTB = 0x06
#byte PORTC = 0x07
#byte PORTD = 0x08
#byte PORTE = 0x09
#bit PC0 = 0x07.0
#bit PC1 = 0x07.1
//------------Variables declaration------------//
int16 inter,cuenta;
int8 cuentaH,cuentaL,puerto,AB,AB_1,aux,cont,iastd,cont2,
cont3,cont4;
float pos,error,iast,cuenta2,posm1,kp,kv,c,delta,v,kp1,ki1,
kp2,kd2,ie;
unsigned int u;
//int1 ban;
//------------Encoder interrupt subroutine------------//
#int_rb void rb_isr() {
puerto=PORTB;
AB=((puerto)&(0x30))>>4;
aux=AB^AB_1;
if(aux!=0)
if(aux!=3)
if(((AB_1<<1)^AB)&(0x02))
cuenta--;
else
cuenta++;
AB_1=AB;
}
//------------Main program------------//
void main(void) {
setup_adc(ADC_CLOCK_INTERNAL ); //ADC (internal clock)
set_tris_a(0b11111111);
set_tris_b(0b11111111);
set_tris_c(0b10000000); //serial communication
set_tris_d(0b00000000);
set_tris_e(0b11111111);
OPTION=0x07; //pre_scaler timer0, 1:256
PORTC=0;
TMR0=0;
cuenta=0;
AB=0;
AB_1=0;
enable_interrupts(global);
enable_interrupts(int_rb);
cont=4;
cont2=0;
cont3=0;
cont4=0;
PORTD=127; // iast=0 is set
kp=1.6891;
676 11 Position Control of a PM Brushed DC Motor
kv=0.0414;
c=30.8018;
delta=1.6891;
v=0.0;
kp1=1.6891;
ki1=67.5659;
kp2=1.8241;
kd2=0.1006;
posm1=0.0;
ie=0.0;
while(cont2<3) // a 10-s waiting period is introduced
{
while(cont3<255)
{
TMR0=0;
while(TMR0<255)
{
}
cont3++;
}
cont2++;
}
TMR0=0;
while(TRUE) // control loop
{
cont++;
cuenta2=(signed int16)cuenta;
pos=cuenta2*0.0039; // 3.1416 rad/(2*400 cuentas)
error=1.5-pos;
/* Identification */
// iast=0.5*error;
/* ___________________________________________ */
/* Lead compensator */
// iast=delta*(error+v);
// v=(-c*v+(2.8-c)*error)*0.001+v;
/* ___________________________________________ */
/* 2-degrees-of-freedom controller */
iast=kp1*error+ki1*ie-kp2*pos-kd2*(pos-posm1)/0.002;
ie=ie+0.002*error;
/* ___________________________________________ */
iastd=(unsigned int)(36.4286*iast+127);
PORTD=iastd;
posm1=pos;
/* // uncomment if it is desired to send position to computer
// every 10 ms
if(cont==5)
{
cont=0;
inter=(cuenta)&(0xFF00);
cuentaH=inter>>8;
cuentaL=(cuenta)&(0x00FF);
putc(0xAA); //recognition serial port
putc(cuentaH); //sending to serial port
putc(cuentaL);
cont4++;
if(cont4==255)
cont4=0;
}
*/
/* // uncomment if it is desired to send control signal to
// computer every 10 ms
iast=-iast; // plot +i*
if(cont4>70) // plot control signal without disturbance
iast=iast+0.5;
iastd=(unsigned int)(36.4286*iast+127);
if(cont==5)
{
cont=0;
inter=(cuenta)&(0xFF00);
cuentaH=0x00; //inter>>8;
cuentaL=(iastd)&(0xFF);
putc(0xAA); //recognition serial port
putc(cuentaH); //sending to serial port
putc(cuentaL);
cont4++;
if(cont4==255)
cont4=0;
}
*/
PC1=1; //waiting for sampling time
while(TMR0<40) //each cuenta=(4/FXtal)*256 s,
// (40=2 ms, sampling period)
{
}
PC1=0; //sampling time has arrived
TMR0=0;
} //closing the infinite while
} //closing main
678 11 Position Control of a PM Brushed DC Motor
The controller presented in Sect. 11.4, for trajectory tracking, was experimentally
implemented using a personal computer and a data acquisition board. The reason
for this is that the sine and cosine trigonometric functions involved in the controller
are time-consuming for the microcontroller PIC16F877A. This problem disappears
when a personal computer is employed. The following are the main control system
components.
• Personal computer Pentium II, 233 MHz
• Data acquisition board Advantech PCL-812PG [4]. Fifteen analog/digital input
channels with a unique 12-bit successive approximations analog/digital con-
verter, with an analog range [−5, +5][V]. Two digital/analog output channels,
each based on a 12-bit digital/analog converter with analog range [0, +5][V]. It
is also provided with two programmable timers employed to fix the sampling
period. In Fig. 11.17, the sampling period was set to de 0.005[s].
• PM brushed DC motor. Nominal voltage 24[V], nominal current 2.3[A].
• Position sensor. 1[KOhm] Precision potentiometer, 10 turns.
The block diagram of the complete control system is shown in Fig. 11.21.
The potentiometer used as a position sensor, Fig. 11.21, delivers a voltage θ in the
range [0, +5][V]. This is very convenient as the analog/digital converter has an
analog range [−5, +5][V]. From the voltage at the potentiometer, the analog/digital
converter delivers a code, “codei ,” within the range 0 to 2n = 4096 because it
is a 12-bit converter. From this code, the variable ua is retrieved, which must be
numerically identical to the voltage at the potentiometer θ . According to Fig. 11.22,
this can be performed by computing:
10.0
ua = codei − 5.0.
4096.0
This must be performed by the computer.
Fig. 11.21 Block diagram and interfaces of the personal computer-based position control system
679
680 11 Position Control of a PM Brushed DC Motor
code
4096
codeo = (−i ∗ ) + 2048,
6
has to be sent to the digital/analog converter. Hence, the digital/analog converter
delivers a voltage ud in the range 0[V] to +5[V]. Thus, an analog electronic circuit
must be employed to convert this voltage in the range 0[V] to +5[V] into the
range -3[V] to +3[V], which corresponds to the values taken by −i ∗ . According
to Fig. 11.24 this is accomplished by an operational amplifier-based analog circuit
performing the following mathematical operation:
6
−i ∗ = ud − 3.
5
11.7 Personal Computer-Based Controller Implementation 681
5 ud
–3
This function is performed by the block labeled “output interface” in Fig. 11.21.1
The operational amplifier shown in the block labeled “current control” in
Fig. 11.21 performs the mathematical operation indicated in (10.14) with K = 30.
The power amplifier is identical to that presented in Sect. 10.6.2.
The flow diagram for the PC programming when controlling the position in a
PM brushed DC motor is presented in Fig. 11.25. All the control algorithms were
programmed in Borland C++. The following is the code that was employed.
#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <iostream.h>
int alto,bajo,dato,salida,i;
/*------------------encoder variables----------*/
//volatile int alto_dig=0,bajo_dig=0,dato_dig=0;
volatile float y,ir,ym1,v,dv,nv,e,ninte;
1 All operational amplifiers used in Fig. 11.21 are TL081. The first three amplifiers have their
terminals “+” to ground whereas the operational amplifier connected to the transistor bases has
its terminal “+” connected to ui .
682 11 Position Control of a PM Brushed DC Motor
START
PARAMETERS
YES APPLY A
DISTURBANCE
NO
Fig. 11.25 Flow diagram for the PC programming when the controlling the position in a PM
brushed DC motor
void Inicializa(void);
outportb(base+11,6);
//CAD starts by clock and datum software transfer
outportb(base+9,0);// gain 1
void Inicializa(void) {
strcpy(Direccion,"c:\\motorcd\\sigue.txt");
if( (fp=fopen(Direccion,"w+")) == NULL)
{
cout<<"File cannot be created";
exit(1);
}
}
void Cierra(void) {
fclose(fp);
}
686 11 Position Control of a PM Brushed DC Motor
θ (s) k
= . (11.52)
U (s) s(s + a)
a = 3.653 (11.53)
5. The parameter k is found by trial and error until the data obtained from the model
in (11.52) fit the experimental data well:
k = 62. (11.54)
Although the motor model in 11.52 has one pole at s = 0, a controller with integral
action is desirable to compensate for constant torque disturbances, e.g., the friction
effects. Hence, given the second-order structure of the motor model, the design of a
PID controller is well suited (see Fig. 11.27).
This means that the open loop transfer function is given as:
k d s 2 + kp s + ki k
G(s)H (s) = .
s s(s + a)
11.8 Frequency Response-Based Design 687
B
A
[dB]
!
[rad=s]
Fig. 11.26 Bode diagram from experimental data used for model identification. Continuous:
experimental data (Table 11.1). Dashed: data from the model in (11.52)
688 11 Position Control of a PM Brushed DC Motor
θd(s) + k k θ(s)
s 2+k p s+ k i k
d d
kd s s(s+a)
–
Bode Diagram
40
35
30
Magnitude (dB)
25
20
15
System: planta
10
Frequency (rad/sec): 7.88
5 Magnitude (dB): −0.00621
0
−5
−10
−179
−179.5
Phase (deg)
−180
System: planta
Frequency (rad/sec): 7.88
−180.5 Phase (deg): −180
−181
100 101
Frequency (rad/sec)
k
Fig. 11.28 Bode diagrams of the factor s2
, where (11.54) is used
k s
G(s)H (s) = kd z2 (z + 1) , z= , z1 = a,
s2 z2
kp = kd (z1 + z2 ), k i = k d z1 z2 . (11.55)
Hence, the factor sk2 is considered the “plant to be controlled” and the factor kd z2 (z+
1) the “controller.”
The Bode diagrams of the factor sk2 are presented in Fig. 11.28 where (11.54) is
used. The crossover frequency is ω1 = 7.88[rad/s] and the phase is −180◦ . This
means that the phase margin is 0◦ . It is chosen to maintain the same crossover
frequency and to design a 20% overshoot. Hence, using:
11.8 Frequency Response-Based Design 689
Bode Diagram
40
35
30
Magnitude (dB)
25
20
15
10 System: zM1
Frequency (rad/sec): 1.09
5 Magnitude (dB): 3.41
0
90
Phase (deg)
45
System: zM1
Frequency (rad/sec): 1.09
Phase (deg): 47.5
0
10−2 10−1 100 101 102
Frequency (rad/sec)
Fig. 11.29 Bode diagrams of the factor z + 1. The horizontal axis represents ω
z2
ln2 (Mp /100)
ζ = ,
ln2 (Mp /100) + π 2
it is found that ζ = 0.4559 is required. According to Table 6.5, this means that a
47.5◦ phase margin is needed. Hence, a 47.5◦ phase lead has to be contributed by
the controller, i.e., by the factor z + 1, when ω = ω1 = 7.88[rad/s]. It is observed
in Fig. 11.29 that a 47.5◦ phase lead is obtained when zω2 = 1.09. Hence, using
ω = ω1 = 7.88[rad/s], the following is obtained: z2 = 7.2294. On the other hand,
from the magnitude condition:
kp = 1.0177, ki = 2.4697.
690 11 Position Control of a PM Brushed DC Motor
Bode Diagram
80
60
Magnitude (dB)
40
20 System: gh
Frequency (rad/sec): 7.86
Magnitude (dB): 0.017
0
−20
−40
−90
Phase (deg)
−135
System: gh
Frequency (rad/sec): 7.89
Phase (deg): −132
−180
10−1 100 101 102 103
Frequency (rad/sec)
kd s 2 +kp s+ki
Fig. 11.30 Bode diagrams of the transfer function s
k
s(s+a) . kd = 0.0935, kp = 1.0177,
ki = 2.4697, and (11.53), (11.54) are used
1.2
1
System: M
Time (sec): 0.192
Amplitude: 1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
Fig. 11.31 Simulation response of the closed loop system in Fig. 11.27. kd = 0.0935, kp =
1.0177, ki = 2.4697
θ
[rad]
t[s]
u
[V]
t[s]
Fig. 11.32 Experimental results for the control scheme in Fig. 11.27. kd = 0.0935, kp = 1.0177,
ki = 2.4697
692 11 Position Control of a PM Brushed DC Motor
θ
[rad]
t[s]
u
[V]
t[s]
Fig. 11.33 Experimental comparison of the control scheme in Fig. 11.27 (continuous line) and
controller in (11.38) (dashed line)
The electric diagram in addition to the computer program used to evaluate the
control algorithms is identical to the electric diagram and the Builder 6 C++ code
presented in Chap. 12. The only difference is that in Chap. 12 two encoders have
to be read, whereas in the present chapter only one encoder is to be read. Also, a
microcontroller PIC16F877A is used in Chap. 12 and in the present chapter. The
code for programming this microcontroller is identical in both chapters. Again, in
the present chapter only one encoder has to be read. Thus, the code for programming
is simpler in the present chapter.
In particular, the identification experiments described in Sect. 11.8.1 require to
the voltage signal u = A sin(ωt)[V] to be applied at the motor armature terminals.
This is performed by writing the code line “iast=A*sin(w t),” provided that A=3 and
w are defined as constants at the beginning of the program. This is all that we have
to do as software and hardware are so contrived that the numerical value of “iast”
appears as the voltage at the motor armature terminals.
This prototype has been built because it presents some advantages when perform-
ing the frequency response experiments described in Sect. 11.8.1. When using the
prototype depicted in Fig. 11.18 for frequency response identification, the motor
position has a large drift, which poses difficulties for the measurement of the
position amplitude. Such a problem is eliminated with the new prototype. See
Chap. 12.
11.9 Summary
The position of a PM brushed DC motor has been controlled under the effect
of an external torque disturbance. Two controllers have been tested: a classical
PID controller and a modified PID controller. Although both controllers solve the
problem, the modified PID controller has a better performance. As this controller
requires numerical values of the motor parameters, an experimental identification
of the motor model is also presented. In this chapter, it has also been shown how to
tune a classical PID controller using the numerical values of the plant parameters.
However, the main advantage of this controller is that it can be tuned by a trial
and error procedure, i.e., without any information about the plant parameters (see
Sect. 5.3 in Chap. 5). On the other hand, a PD position controller has also been
designed to solve the trajectory tracking problem. This is a complex task requiring
the exact values of the motor parameters. Detailed explanations are included on how
to implement these controllers using a microcontroller and a personal computer. The
reason for using a personal computer is that the implementation of the PD controller
for trajectory tracking requires computation of sine and cosine functions, which
consumes too much time when using a microcontroller.
When a control system is implemented in practice, it is very important that the
signal processing performed by the software and hardware precisely corresponds
References 695
to the mathematical operations indicated by the controller. Control systems that are
built in this book satisfy this requirement and this can be corroborated by following
their careful descriptions.
1. Consider the PID position control of a DC motor. What would happen if either
the torque disturbance or the desired position were not constant?
2. Industrial robots employ PID controllers, even for trajectory tracking. How do
you think that this task can be accomplished (see Sect. 6.7.4)?
3. How does each one of the classical PID controller gains affect the response of a
position control system? If a disturbance were rejected very slowly, how would
you modify the controller gains to improve performance?
4. In Chap. 10, it was shown that a PI controller is suitable for compensating for
the effects of an external torque disturbance in a velocity control system, Why
do you think that a PID controller has to be used instead of a PI controller in
the case of position control?
5. List some advantages and disadvantages when using a microcontroller or a
personal computer to implement digital controllers.
6. A PM brushed DC motor can also be controlled without using an internal
electric current loop if it is assumed that the armature inductance is negligible,
especially in small motors. What changes must be performed in the circuits of
Figs. 11.18 and 11.21 to work without an electric current loop?
7. Describe the time response and the frequency response methods presented in
this chapter to experimentally identify the parameters of a DC motor.
8. What is a lead compensator?
9. What are the advantages of using lead compensators as position controllers?
10. From the theoretical point of view, the response of a position control system can
be rendered as fast and as well damped as desired using a PID controller. List
some problems arising in practice when the PID controller gains are too large.
References
θ1 θ2
Fig. 12.1 A mechanical system with two bodies and one spring
I2 θ̈2 = applied torques on the load,
which yields:
Finally:
Using the Laplace transform in (12.1), assuming that all initial conditions are zero
and solving for θ1 (s), the following is found:
1 K
I1 I1
θ1 (s) = b1
T (s) + b1 K 2
θ (s). (12.3)
s2 + I1 s + K
I1 s2 + I1 s + I1
Using the Laplace transform in (12.2), assuming that all initial conditions are zero
and solving for θ2 (s), yields:
K
I2
θ2 (s) = b2 K 1
θ (s). (12.4)
s2 + I2 s + I2
b2
s2 + I2 s + K
I2
1
I1
G1 (s) = .
b1 b2 b1 b2 b2 K b1 K
s4 + I1 + I2 s3 + I1 I2 + K
I1 + K
I2 s2 + I2 I1 + I1 I2 s
1
i= (u − kb θ̇1 ).
R
These last expressions are the dynamical model of the servomechanism and their
parameters are experimentally identified in the next section.
700 12 Control of a Servomechanism with Flexibility
In this section, some experiments are performed to obtain the numerical parameters
of the plant mathematical models presented in Sect. 12.1. It is important to state that
the measurement of the individual parameters such as inertias, stiffness constants
or viscous friction coefficients is not a practical solution in this plant. This is
because such parameter identification procedures would imply either plant disas-
sembly or complicated and inaccurate measurement procedures, i.e., for viscous
friction coefficient measurement. Thus, in this section a more convenient model
identification procedure for this plant is employed: a frequency response-based
model identification procedure. This is described in what follows.
The following identification procedure has been performed on the experimental
prototype described in Sect. 12.4 whose dynamical model has been presented in
Sect. 12.1.
1. A sinusoidal voltage signal is applied at the armature terminals of the PM brushed
DC motor used as an actuator: u(t) = A sin(ωt), where t is time in seconds, ω is
in radians/second, and A = 3[V].
2. Under the action of this applied voltage, it is found that the motor rotor position
θ1 and the load position θ2 are given, in a steady state, as θ1 (t) = B1 sin(ωt + φ1 )
and θ2 (t) = B2 sin(ωt + φ2 ).
3. This experiment is repeated for the angular frequencies ω shown in Table 12.1.
4. The corresponding values of B1 and B2 are measured and they are shown in
Table 12.1. The phase angles φ1 and φ2 are not presented because the minimum
phase property of the model renders the measurement of these variables unnec-
essary.
5. Define the magnitude functions |G1u (j ω)| and |G2u (j ω)| as the ratios B1 /A
and B2 /A respectively, for each ω in Table 12.1. Using these data compute
and plot, in Figs. 12.2 and 12.3, the decibel valued magnitudes |G1u (j ω)|dB =
20 log (|G1u (j ω)|) and |G2u (j ω)|dB = 20 log (|G2u (j ω)|).
6. Fit to these data some straight lines whose slopes are either 0[dB/dec] or an
integer multiple of ±20[dB/dec], as shown in Figs. 12.2 and 12.3.
7. Obtain the zero and pole locations of the corresponding transfer functions from
the corner frequencies defined by these straight lines and the corresponding
transfer function gain as the constant that has to be introduced to fit the data
obtained from these transfer functions to the experimental data.
According to the identification procedure listed above, we realize that, in
Fig. 12.2, two lines with slopes of −20[dB/dec] and −40[dB/dec] are enough to
fit the experimental data. Hence, from Fig. 12.2 we conclude that real poles exist for
G1u (s), which are located at s1 = 0 and s2 = −5. Moreover, the resonance peak
implies that a corner frequency exists at ωn1 = 62.83[rad/s], which must be due to
a pair of complex conjugate poles. This means that G1u (s) includes the factor:
12.2 Experimental Identification 701
B1
A
[dB]
!
[rad=s]
B2
A
[dB]
!
[rad=s]
1
,
s2 + 2ζ1 ωn1 s + ωn1
2
where ζ1 is unknown. Hence, the coefficient 2ζ1 ωn1 has to be found by trial and
error until the data obtained from the above factor fit the resonance peak. Thus, the
following is found:
1 1
= 2 .
s2 + 2ζ1 ωn1 s + ωn1
2 s + 8s + 62.832
Finally, note that the −40[dB/dec] asymptote remains unchanged, despite the above-
mentioned second-order factor appearing. Moreover, a notch exists just before ω =
ωn1 . These features are clear evidence that the following factor is present in G1u (s):
The numerical coefficients in this factor have been found by trial and error until
this model fits the notch. Finally, to match the gain of the experimental data, it was
necessary to include 175 as the transfer function gain. Thus, we have found that:
175(s 2 + 3s + 53.682 )
G1u (s) = . (12.9)
s(s + 5)(s 2 + 8s + 62.832 )
12.2 Experimental Identification 703
In Fig. 12.2, we can see that the data obtained from this mathematical model fit the
experimental data very well. Moreover, the structure of G1u (s) in (12.9) perfectly
fits the structure of G1u (s) in (12.8), i.e., both of them have four poles, one of them
at the origin, and two zeros.
On the other hand, in Fig. 12.3 the experimental data used to identify G2u (s) are
presented. We realize that these data fit the asymptotes with slopes −20[dB/dec],
−40[dB/dec] and −80[dB/dec] very well. This implies that G2u (s) includes poles
at s1 = 0, s2 = −5 and a corner frequency exists at ωn1 = 62.83[rad/s], which
is due to a pair of complex conjugate poles. This means that G2u (s) includes the
factor:
1 1
= 2 ,
s 2 + 2ζ1 ωn1 s + ωn1
2 s + 8s + 62.832
where the coefficient 2ζ1 ωn1 = 8 has been estimated by trial and error, until data
obtained from this model fit the experimental resonance peak. Finally, the gain of
the transfer function is found to be 520000, as this factor renders it possible that
data obtained from the following transfer function:
520000
G2u (s) = , (12.10)
s(s + 5)(s 2 + 8s + 62.832 )
fit the experimental data, as shown in Fig. 12.3. Note that the structure of G2u (s)
in (12.10) fits the structure of G2u (s) in (12.7) very well, i.e., both of them have
four poles, one at the origin, and no zeros are present.
Figures 12.2 and 12.3 were drawn using the following MATLAB code in an
m-file:
clc
f=[0.4 0.5 0.6 0.7 0.8 0.9 1 2 3 4 5 6 7 8 8.5 9 10 12 15 20];
thetam=[60 48 32 26.5 23 17 15 4.5 1.9 2.4-1.35 1.03-0.4
0.68-0.3 0.2 0.09 0.05 0.2-0.122 0.8-0.18 0.57-0.38
0.1 0.05]/2;
theta2=[55 45 32 26.5 23 17 15 4.5 2.5 2.6-1.25 1.2-0.15
0.9-0.02 0.9 0.93 1.1 0.65+0.47 1.9 0.11 0.03 0]/2
u=[6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6]/2;
w=2*pi*f;
magm=thetam./u;
mag2=theta2./u;
magmdB=20*log10(magm);
mag2dB=20*log10(mag2);
c=conv([1 0],[1 5]);
d=conv(c,[1 8 62.83^2]);
gm=tf(175*[1 3 53.68^2],d)
g2=tf(520000,d)
w2=0.5:0.1:150;
[m2,f2]=bode(g2,w2);
[m,f]=bode(gm,w2);
for i=1:length(w2),
704 12 Control of a Servomechanism with Flexibility
mm(i)=20*log10(m(1,1,i));
mm2(i)=20*log10(m2(1,1,i));
fm(i)=f(1,1,i);
fm2(i)=f2(1,1,i);
end
length(w2)
length(magmdB)
length(mm)
figure(1)
semilogx(w,magmdB,’k+’,w2,mm,’r--’)
grid on
line([4 400],[18 -62])
line([0.5 5],[34 14])
figure(2)
semilogx(w,mag2dB,’k+’,w2,mm2,’r--’)
grid on
line([4 400],[18 -62])
line([0.5 5],[34 14])
line([6.3 630],[50 -110])
From (12.10), it is easy to find that the poles of G2u (s) are located at:
The simplest controller that we should test is a proportional one, i.e., to obtain a
closed-loop system such as that shown in Fig. 12.4. From the root locus diagram
presented in Fig. 12.5, it is clear that very oscillatory responses are expected or even
instability.
This may suggest the use of a PD controller with transfer function:
kp kp
P D(s) = kp + kd s = kd s + = kd (s + b), b= .
kd kd
This means that a PD controller introduces one open-loop zero at s = −b. The
corresponding closed-loop block diagram is shown in Fig. 12.6. From the root locus
diagram depicted in Fig. 12.7, we realize that this is not a good solution either as
instability problems or a very slow and oscillatory response are expected to appear
no matter what the value of b. To corroborate these observations, in Fig. 12.8,
12.3 Controller Design 705
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−7 −6 −5 −4 −3 −2 −1 0 1 2
Real Axis
Fig. 12.6
Proportional–derivative (PD) G2u(s)
control of system in (12.10)
we present the experimental responses when using a PD controller for the load
position. Note that instability is observed even when a very small proportional gain
is used. These findings motivate us to design more complex controllers for θ2 . Some
different approaches are tested in the following sections.
To motivate the design based on this approach, let us first use intuitive ideas to
explain the main steps of the procedure. From (12.9), it is easy to find that G1u (s) =
θ1 (s)
U (s) has poles located at:
Root Locus
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−7 −6 −5 −4 −3 −2 −1 0 1
Real Axis
(a)
Root Locus
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−7 −6 −5 −4 −3 −2 −1 0 1
Real Axis
(b)
Fig. 12.7 Root locus diagrams for the closed-loop system in Fig. 12.6
kp1
P D1 (s) = kp1 + kd1 s = kd1 (s + b1 ), b1 = .
kd1
12.3 Controller Design 707
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.8 PD control of θ2 . Experimental results. Continuous: kp2 = 2.3, kd2 = 0.1. Dashed:
kp2 = 0.23, kd2 = 0.1 . (a) θ2 . (b) θ1 . (c) Applied voltage, u
708 12 Control of a Servomechanism with Flexibility
Root Locus
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−50 −45 −40 −35 −30 −25 −20 −15 −10 −5 0
Real Axis
Fig. 12.10 Root locus diagram for G(s)H (s) = kd1 (s + b1 )G1u (s)
The equivalent closed-loop block diagram and the corresponding root locus diagram
are presented in Figs. 12.9 and 12.10 respectively. Note that two complex conjugate
closed-loop poles exist, which are close to the complex conjugate zeros at s5 =
−1.5 + 53.659j and s6 = −1.5 − 53.659j . It is not difficult to verify that these
open-loop zeros are also closed-loop zeros. Hence, any oscillation produced by
these closed-loop poles on θ1 (t) would be kept small if a large value for kd1 is
used. Furthermore, the closed-loop poles on the other two branches of the root locus
diagram in Fig. 12.10 move away from the origin and approach the negative real
axis as kd1 is chosen to be larger. Therefore, a fast and well-damped response for θ1
can be ensured by using a large value for kd1 .
Assume that the control of the motor position θ1 has been accomplished such
that a desired value θ1d is tracked very fast and without oscillations, i.e., assume
that θ1 ≈ θ1d all the time. Hence, using (12.4) we can write:
K
I2
θ2 (s) = b2
θ (s).
K 1d
(12.11)
s2 + I2 s + I2
From this expression, θ1d (s) can be designed as the output of the following PID
controller, which is driven by the position error e = θ2d − θ2 :
12.3 Controller Design 709
s b2
s2 + I s +IK
2 2
Root Locus
Imaginary Axis
Real Axis 0
Fig. 12.12 Root locus diagram for the closed-loop system in Fig. 12.11
The corresponding closed-loop block diagram and the root locus diagram are
depicted in Figs. 12.11 and 12.12 respectively. The main idea is to force the branches
starting at the roots of s 2 + bI22 s+ IK2 to be attracted by the open-loop zeros contributed
by the PID controller in (12.12). This would reduce any oscillation due to these
closed-loop poles [2], section 10–8. Thus, the remaining closed-loop pole can be
chosen to be real, negative, and far away from the origin, by selecting a large kd2 .
Now, the above ideas are applied to control the load position θ2 . In the following,
the design is performed without neglecting any open-loop pole or zero. A control
system with two loops is to be designed. The internal loop is designed as a PD
710 12 Control of a Servomechanism with Flexibility
controller for the motor position θ1 . The main objective is to strongly reduce the
oscillations in this variable. The external loop must be designed as a PID controller
for the load position θ2 . The output of this PID controller is to be used as the desired
value for the motor position θ1 .
The internal loop is defined by the following PD controller:
where V1 (s) represents the desired value for θ1 , which is defined when designing the
external loop. Replacing T (s) = km U (s)/R − km kb sθ1 (s)/R and (12.13) in (12.3),
and solving for θ1 (s):
km
(kd1 s + kp1 ) RI
θ1 (s) =
1
V1 (s)
b1 (kd1 +kb )km kp1 km
s2 + I1 + RI1 s + I1 +
K
RI1
K
I1
+ θ2 (s).
b1 (kd1 +kb )km kp1 km
s2 + I1 + RI1 s+ K
I1 + RI1
Kkm
RI1 I2 (kd1 s + kp1 )
θ2 (s) = G3 (s)V1 (s), G3 (s) = , (12.14)
N (s)
N (s) = s 4 + a3 s 3 + a2 s 2 + a1 s + a0 ,
b1 kd1 km kb km b2
a3 = + + + ,
I1 RI1 RI1 I2
K kp1 km b2 b1 kd1 km kb km K
a2 = + + + + + ,
I1 RI1 I2 I1 RI1 RI1 I2
b2 K kp1 km K b1 kd1 km kb km
a1 = + + + + ,
I2 I1 RI1 I2 I1 RI1 RI1
K kp1 km
a0 = .
I2 RI1
where θ2d is a constant representing the desired value for θ2 . The closed-loop block
diagram is depicted in Fig. 12.13.
The PD controller shown in (12.13) is designed experimentally by trial and error
using step changes for v1 (t) (L{v1 (t)} = V1 (s)). However, we stress that the load is
12.3 Controller Design 711
[rad]
t [s]
[V]
t [s]
Fig. 12.14 PD control of θ1 . Experimental results. Top figure: continuous line θ1 , dashed line θ2 .
Bottom figure: applied voltage u. The desired position is set to θ1d = π [rad]
present in the mechanism when performing these experiments. The values for kp1
and kd1 are selected as those achieving a fast and well-damped response for θ1 (t).
The limit for the achievable fastest response is keeping, for most of the time, the
applied voltage below 3[V], which has been used as the maximal applied voltage
during the identification experiments. Hence, we have found the fastest and well-
damped response in θ1 (see Fig. 12.14), using the following controller gains:
Comparing this expression, (12.8), (12.9) and G3 (s) in (12.14), we conclude that:
712 12 Control of a Servomechanism with Flexibility
Kkm
= 5.043 × 105 ,
RI1 I2
a3 = 13 + 175kd1 ,
a2 = 3988 + 175kp1 + 3 × 175kd1 ,
a1 = 1.974 × 104 + 3 × 175kp1 + 175 × 53.682 kd1 ,
a0 = 5.043 × 105 kp1 .
s7 = −10,
As explained before, V1 (s) has to be selected as the output of the PID controller.
kd2 (s + z1 )(s + z2 )
P I D2 (s)G3 (s) =
s
5.043 × 104 s + 5.043 × 105
× .
s 4 + 30.5s 3 + 4215s 2 + 7.069 × 104 s + 5.043 × 105
(12.18)
Thus:
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−15 −10 −5 0 5
Real Axis
Fig. 12.15 Root locus diagram for the open-loop transfer function in (12.18), (12.19). Some
closed-loop poles are shown corresponding to three particular values of kd2 : triangle up kd2 =
0.0008, square kd2 = 0.0018, triangle down kd2 = 0.0028
are chosen to render the cancellation of these badly damped plant poles with the
zeros contributed by the PID controller possible. The derivative gain is computed
as follows. In Fig. 12.15 we present the root locus diagram corresponding to
the open-loop transfer function in (12.18), (12.19), as kd2 goes from 0 to +∞.
Note that, although the open-loop poles at s8 = −6.304 + 61.7989j and s9 =
−6.304 − 61.7989j , are successfully cancelled out, branches starting at the poles
s10 = −8.946 + 7.1167j and s11 = −8.946 − 7.1167j converge to an asymptote
close to the imaginary axis as kd2 increases. Hence, the deteriorating performance.
On the other hand, a large kd2 moves a real closed-loop pole toward the left,
thus rendering the system response faster. The following values kd2 = 0.0008,
kd2 = 0.0018, and kd2 = 0.0028 have been chosen. Using these data, (12.19)
and (12.17), the following PID controller gains are obtained for each one of these
cases:
These three sets of PID controller gains must be employed together with the
PD gains in (12.16). The system response is presented in Fig. 12.16 when using
these three sets of PID controller gains. From these experimental results, it is
714 12 Control of a Servomechanism with Flexibility
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.16 PID control of θ2 . Experimental results. Continuous: PID gains in (12.21). Dashed:
PID gains in (12.20). Dash–dot: PID gains in (12.22). Desired load position θ2d = π . (a) θ2 .
(b) θ1 . (c) Applied voltage, u
12.3 Controller Design 715
concluded that the PID controller gains in (12.21) achieve the best performance. In
Fig. 12.17, the simulation response obtained when a unit step change is commanded
on the desired load position is presented. The Bode diagrams obtained from the
corresponding closed-loop transfer function are also presented. The reason for this is
to show the reader that the same information can be obtained from the time response
and from the frequency response: i) The PID gains in (12.20) produce the slowest
response (the smallest bandwidth), without overshoot (without a resonance peak).
ii) The PID gains in (12.22) produce the fastest response (the largest bandwidth)
with a clear overshoot (a clear resonance peak). iii) The PID gains in (12.21)
produce an intermediate response time (an intermediate bandwidth) with a very
small overshoot (a negligible resonance peak).
In Fig. 12.16, it is observed that tr = 0.23[s] and Mp = 14.53% have been
obtained experimentally as rise time and overshoot respectively for the PID gains
in (12.21). On the other hand, in Fig. 12.17, it is observed that tr = 0.294[s]
and Mp = 3% have been obtained in simulation as the rise time and overshoot
respectively for the PID gains in (12.21). The differences between these values are
reasonable; hence, it is concluded that the identified model is accurate enough for
our purposes. Furthermore, the experimental responses in Fig. 12.16 and the closed-
loop poles shown in Fig. 12.15 for each set of the above PID gains, corroborate the
predictions in the previous paragraphs on the system performance. Also note that
a zero steady-state error is accomplished. This is possible, despite the presence of
nonlinear static friction, because of the integral action of the PID controller used in
the external loop.
On the other hand, recall that the proposed design procedure is intended to
cancel out the plant’s badly damped open-loop poles with the PID controller
zeros. Hence, it is natural to wonder what would happen if such poles are not
successfully cancelled out. This problem may appear because of inaccuracies in
model identification that are always present to some extent. In Figs. 12.18 and 12.19
some experimental results are presented when using the internal loop PD controller
gains in (12.16), but the external loop PID controller gains are computed such that
the PID zeros do not cancel out the open-loop poles at −6.304 ± 61.7989j . In
Figs. 12.20 and 12.21 some root locus diagrams are presented corresponding to the
closed-loop diagram in Fig. 12.13 when the PID zeros are selected as in Figs. 12.18
and 12.19. The location of the corresponding closed-loop poles are indicated with
triangles.
In Figs. 12.22 and 12.23, the simulation closed-loop response and Bode diagrams
for the above cases are presented. Note that the experimental and simulation time
responses in Figs. 12.18 and 12.22 respectively are similar for the purposes of this
study. However, what we want to compare are the experimental time responses
to information provided by the Bode diagrams. Consider, for instance, the case
of the PID zeros at −14 ± 77j . It is observed in Fig. 12.23 that the resonance
peak exists at ω ≈ 10[rad/s]. By measuring the oscillation period in Fig. 12.18,
it can be verified that the overshoot in time response is due to a frequency
component of approximately 10[rad/s]. On the other hand, it is also observed that the
experimental time response contains small-amplitude, high-frequency oscillations.
716 12 Control of a Servomechanism with Flexibility
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
Time (sec)
(a)
Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
−100
0
−45
Phase (deg)
−90
−135
−180
10−1 100 101 102 103
Frequency (rad/sec)
(b)
Fig. 12.17 PID control of θ2 . Simulation results. Continuous: PID gains in (12.21). Dashed: PID
gains in (12.20). Dash–dot: PID gains in (12.22) . (a) Time response of θ2 when a unit step change
is commanded. (b) Closed-loop Bode diagrams
12.3 Controller Design 717
[rad]
t [s]
(a)
[rad]
t [s]
(b)
Fig. 12.18 PID control of θ2 when the zeros of the PID controller do not cancel out the open-
loop poles of the plant located at −6.304 ± 61.7989j exactly. Experimental results. Continuous:
PID controller gains in (12.21). (a) Dashed: PID zeros at −14 ± 45j . Dash–dot: PID zeros at
−14 ± 77j . (b) Dashed: PID zeros at −3.2 ± 45j . Dash–dot: PID zeros at −3.2 ± 77j . In all cases
kd2 = 0.0018. (a) θ2 . (b) θ2
[V]
t [s]
(a)
[V]
t [s]
(b)
Fig. 12.19 PID control of θ2 when the zeros of the PID controller do not cancel out the open-
loop poles of the plant located at −6.304 ± 61.7989j exactly. Experimental results. Continuous:
PID controller gains in (12.21). (a) Dashed: PID zeros at −14 ± 45j . Dash–dot: PID zeros at
−14 ± 77j . (b) Dashed: PID zeros at −3.2 ± 45j . Dash–dot: PID zeros at −3.2 ± 77j . In all cases
kd2 = 0.0018. (a) Applied voltage, u. (b) Applied voltage, u
loop complex conjugate poles are compensated for very fast by the presence of the
PID zeros, which are also closed-loop zeros. The effects of these zeros are (see
Fig. 12.23a): i) A phase lag contributed by a pair of complex conjugate closed-loop
poles is only observed in a limited range of frequencies, i.e., ω ∈ [40, 200][rad/s].
12.3 Controller Design 719
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−15 −10 −5 0 5
Real Axis
(a)
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−15 −10 −5 0 5
Real Axis
(b)
Fig. 12.20 Root locus diagrams when the PID zeros do not cancel out the undesired open-loop
poles at −6.304±61.7989j exactly. Triangles represent closed-loop poles in each case. In all cases
kd2 = 0.0018. (a) PID zeros at −14 ± 45j . (b) PID zeros at −3.2 ± 45j
ii) The resonance peak at ω ≈ 60[rad/s] is kept small by the pair of complex
conjugate closed-loop zeros. This means that even an inexact cancellation of the
badly damped poles is useful to attenuate the undesired oscillations due to the
720 12 Control of a Servomechanism with Flexibility
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−35 −30 −25 −20 −15 −10 −5 0 5
Real Axis
(a)
Root Locus
100
80
60
40
Imaginary Axis
20
−20
−40
−60
−80
−100
−30 −25 −20 −15 −10 −5 0 5 10 15 20
Real Axis
(b)
Fig. 12.21 Root locus diagrams when the PID zeros do not cancel out the undesired open-loop
poles at −6.304±61.7989j exactly. Triangles represent closed-loop poles in each case. In all cases
kd2 = 0.0018. (a) PID zeros at −14 ± 77j . (b) PID zeros at −3.2 ± 77j
12.3 Controller Design 721
system flexibility. Hence, these results support the arguments that we have employed
to propose our design procedure. Note that similar conclusions can be obtained by
analyzing the system responses for the other cases in the figures referred to.
Once the problem is understood, the controller grains can be computed using the
root locus. The internal PD controller gains and the external PID controller gains
are computed. According to (12.17) and (12.18), the external PID controller gains
can be computed using the root locus once the poles of G3 (s) are known. Recall
that G3 (s) has four poles, a pair of them are the badly damped open-loop poles,
which have to be cancelled out by zeros of the PID controller. Suppose that this
is the case. Hence, it can be assumed that the cascade connection of the external
PID controller and G3 (s) only has two poles located at p1 and p2 on the left half-
plane and one pole at the origin. Also note that G3 (s) has one zero at −kp1 /kd1 .
According to Fig. 12.24, given a desired closed-loop pole at sd , we can use the root
locus to compute the required location of the poles at p1 and p2 . Recall that the
root locus method performs a design by satisfying two conditions: the magnitude
condition and the angle condition. Thus, these two conditions are enough to solve
for two unknowns, i.e., p1 and p2 . However, G3 (s) possesses another unknown:
the zero at −kp1 /kd1 . To eliminate this third unknown it is proposed to modify the
internal loop: instead of using a PD controller, the following proportional controller
with velocity feedback is designed to control the motor position θ1 :
The reader can verify that the use of this controller modifies G3 (s) to:
Kkm
RI1 I2 kp1
G3 (s) = ,
N(s)
with N (s) a polynomial that is identical to the polynomial given in (12.14). This
means that the poles of G3 (s) remain unchanged, but now G3 (s) does not possess
any zeros. Hence, it is now possible to apply the root locus method to only compute
p1 and p2 , as in Fig. 12.24.
As a result of the procedure in the previous paragraph, we obtain the PID
controller gains kp2 , kd2 , ki2 , and the specific values p1 , p2 , for a pair of poles of
G3 (s). According to (12.14), the denominator coefficients of G3 (s) depend on the
design parameters kp1 and kd1 . Hence, two poles of G3 (s) can be directly assigned
at p1 and p2 by suitable selection of kp1 and kd1 . In the following, we explain how
this procedure is to be performed.
722 12 Control of a Servomechanism with Flexibility
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
Time (sec)
(a)
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8
Time (sec)
(b)
Fig. 12.22 Simulation results. Step response when the PID zeros do not cancel out the undesired
open-loop poles at −6.304 ± 61.7989j exactly. Continuous: PID zeros at −6.304 ± 61.7989j . (a)
Dashed: PID zeros at −14 ± 45j , dash–dot: PID zeros at −14 ± 77j . (b) Dashed: PID zeros at
−3.2 ± 45j , dash–dot: PID zeros at −3.2 ± 77j . In all cases kd2 = 0.0018. (a) θ2 . (b) θ2
12.3 Controller Design 723
a Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
−100
0
Phase (deg)
−90
−180
−270
10−1 100 101 102 103
Frequency (rad/sec)
b Bode Diagram
20
0
Magnitude (dB)
−20
−40
−60
−80
−100
0
−90
Phase (deg)
−180
−270
−360
10−1 100 101 102 103
Frequency (rad/sec)
Fig. 12.23 Closed-loop Bode diagrams when the PID zeros do not cancel out badly damped open-
loop poles at −6.304±61.7989j exactly. Continuous: PID zeros at −6.304±61.7989j . (a) Dashed:
PID zeros at −14 ± 45j , dash–dot: PID zeros at −14 ± 77j . (b) Dashed: PID zeros at −3.2 ± 45j ,
dash–dot: PID zeros at −3.2 ± 77j . In all cases kd2 = 0.0018
724 12 Control of a Servomechanism with Flexibility
sd
l1
θ1 l0
p1
l2 θ0
p0
θ2
p2
Fig. 12.24 Computation of the open-loop poles at p1 and p2 , given a desired closed-loop pole
at sd
Given some values for the desired rise time tr and overshoot Mp , the desired
closed-loop pole, sd =Re(sd )±Im(sd )j , can be computed as:
ln2 (Mp /100) 1 1 − ζ2
ζ = , ωn = π − arctan ,
ln2 (Mp /100) + π 2 tr 1 − ζ 2 ζ
Re(sd ) = −ζ ωn , Im(sd ) = ωn 1 − ζ 2 .
Assume that p1 and p2 are complex conjugate, i.e., p1 =Re(p1 )+Im(p1 )j and
p2 =Re(p2 )+Im(p2 )j , with Re(p1 )=Re(p2 ) and Im(p1 ) = −Im(p2 ). From
Fig. 12.24 we have:
◦ Im(sd )
θ0 = 180 − arctan ,
−Re(sd )
θ2 = 180◦ − (θ0 + θ1 ),
Im(sd ) − Im(p2 ) Im(sd ) − Im(p1 )
tan(θ2 ) = , tan(θ1 ) = .
−(Re(p2 ) − Re(sd )) −(Re(p1 ) − Re(sd ))
Based on the several root loci depicted above and to simplify the problem, we
propose θ1 to be:
θ1 = 15◦ .
Finally:
l0 = Im2 (sd ) + Re2 (sd ),
l1 = (Im(sd ) − Im(p1 ))2 + (Re(p1 ) − Re(sd ))2 ,
l2 = (Im(sd ) + Im(p1 ))2 + (Re(p1 ) − Re(sd ))2 ,
l0 l1 l2
kd2 = Kkm
. (12.24)
RI1 I2 kp1
The above procedure results in precise values for p1 and p2 . Now, it is required to
compute suitable values for kp1 and kd1 , which render p1 and p2 poles of G3 (s),
i.e., the residue must be zero when dividing N(s) by a second-order polynomial
with p1 and p2 as roots:
N (s)
=
s 2 − (p1 + p2 )s + p1 p2
[a − p1 p2 (a3 + p1 + p2 ) + c(p1 + p2 )]s + a0 − p1 p2 c
s 2 +(a3 +p1 +p2 )s+c+ 1 ,
s 2 − (p1 + p2 )s + p1 p2
c = (a2 − p1 p2 ) + (p1 + p2 )(a3 + p1 + p2 ),
a1 − p1 p2 (a3 + p1 + p2 ) + c(p1 + p2 ) = 0, a0 − p1 p2 c = 0, (12.25)
with the polynomial N(s) and the coefficients a0 , a1 , a2 , a3 , defined in (12.14). Note
that a0 , a1 , a2 , a3 depend on kp1 and kd1 . Thus, both conditions in (12.25) can be
solved for kp1 and kd1 to find:
Using these expressions and (12.23), the following gains for the internal controller
are found:
Using these values, the poles of G3 (s) can be computed to be located at:
As the zeros of the external PID controller must be chosen to cancel out the badly
damped poles of G3 (s), choose:
kp2 ki2
= z1 + z2 , = z1 z 2 ,
kd2 kd2
the following gains for the external PID controller are found:
In Fig. 12.25, some experimental results obtained with the controller gains in (12.26)
and (12.27) are presented. In this experiment, it is observed that the rise time is
0.26[s] and overshoot is 8.19%. Note that these values are close to the desired values
tr = 0.23[s] and Mp = 10%. These results corroborate the correctness of our design
procedure.
On the other hand, carefully observing Fig. 12.25 it is possible to note that
the control signal obtained with the design based on the root locus, i.e., with the
controller gains in (12.26), (12.27), does not remain constant once the mechanism
12.3 Controller Design 727
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.25 PID control of θ2 . Experimental results. Continuous: PID gains in (12.21). Dashed: the
design of the internal controller for θ1 and the external PID controller for θ2 is carried out using
the root locus. The controller gains are given in (12.26) and (12.27) respectively. (a) θ2 . (b) θ1 . (c)
Applied voltage, u
728 12 Control of a Servomechanism with Flexibility
stops moving. Moreover, this response is shown on a larger time axis in Fig. 12.26
where some slow oscillations are observed in both θ2 and the applied voltage, which
eventually vanish. This behavior is reminiscent of a limit cycle that may be produced
by a dead zone nonlinearity due to static friction at the motor shaft. To explain this
phenomenon, in Sect. 8.3, it is suggested that the equivalent block diagrams shown
in Fig. 12.27might be obtained. The block diagram in Fig. 12.27a corresponds to
the control scheme used to obtain the results represented by a continuous line in
Fig. 12.25. This results in the equivalent block diagram in Fig. 12.27c, where:
b2
1 s2 + I2 s + K
I2
H1 (s) = kp2 + kd2 s + ki2 + K
,
s I2
G(s) = (kp1 + kd1 s)H1 (s)G2u (s). (12.28)
The block diagram in Fig. 12.27b corresponds to the control scheme used to obtain
the results represented by a dashed line in 12.25. This results in the equivalent block
diagram in Fig. 12.27c where:
b2
s2 + I2 s + K
I2
H2 (s) = kp1 H1 (s) + kd1 s K
,
I2
G(s) = H2 (s)G2u (s). (12.29)
The Bode diagrams and polar plots of G(s) in (12.28) and (12.29), using the
corresponding numerical values, are shown in Fig. 12.28. Note that the polar plot
of G(s) in (12.29) crosses the negative real axis at the left of −1. Hence, according
to Sect. 8.3, a limit cycle exists. On the contrary, as this is not the case for the
polar plot of G(s) in (12.28) a limit cycle does not exist in that case. Moreover,
the Bode diagrams for both cases are similar. The only significant difference is
that the Bode diagrams for G(s) in (12.29) show a small phase lag, which is
responsible for crossing the −180◦ phase line, forcing the polar plot to cross the
negative real axis at the left of −1. Recall that, aside from the numerical values,
the only significant difference between G(s) in (12.28) and (12.29) is the use of
a PD controller and a proportional controller with velocity feedback respectively
in the internal loop. Moreover, the reader may plot the Bode diagrams and the
polar plot for G(s) in (12.28) using the numerical values in (12.26) and (12.27)
to verify that a limit cycle does not exist in such a case. Hence, it is concluded that
the zero of the internal PD controller is instrumental in avoiding the appearance of
limit cycles. Note that, although the limit cycle eventually disappears, the induced
oscillations worsen performance a little. Also note that using a PD controller
instead of a proportional controller with velocity feedback together with the gains
in (12.26) and (12.27) results in a transient response that does not satisfy the design
requirements tr = 0.23[s] and Mp = 10%. Of course, additional fine tuning is
always possible. Thus, if the observed performance deterioration is acceptable, the
12.3 Controller Design 729
4.5
3.5
2.5
[rad]
1.5
0.5
0
0 5 10 15
t[s]
(a)
10
8
6
4
2
[rad]
0
−2
−4
−6
−8
−10
0 5 10 15
t[s]
(b)
Fig. 12.26 Response corresponding to the dashed line in Fig. 12.25 presented on a larger time
axis. (a) θ2 . (b) Applied voltage, u
control design based on the root locus is a good solution. If slow oscillation is not
desired, the control scheme with an internal loop driven by a PD controller and an
external loop driven by a PID controller, with controller gains in (12.16), (12.21), is
preferred.
730 12 Control of a Servomechanism with Flexibility
U(s)
kp1 + kd1s DEAD
ZONE
θ1(s) b
s 2+I 2s+IK
2 2
K
I2
(a)
+ U(s)
kp1 DEAD
ZONE
θ1(s) b
s 2+I 2s+IK
k d1s K
2 2
I2
θ1(s) b
s 2+I 2s+IK
2 2
K
I2
0 + DEAD
U(s)
G (s)
ZONE
(c)
Finally, according to Sect. 6.5.2 an additional phase lag of −ωT [rad] must be
considered in Fig. 12.28a to take into account the effects of time delay induced by
the digital implementation of controllers in experiments. The sampling period used
in these experiments was 0.01[s]; hence, T = 0.01[s] may be assumed to consider
the worst case time delay.
The crossover frequency in Fig. 12.28a for G(s) in (12.28) is ω ≈ 13[rad/s]
and −ωT × 180◦ /π = −7.44◦ is the additional maximal phase lag contributed by
the digital implementation of the controllers. This results in an approximately 43◦
phase margin. Thus, good performance is still expected in the experiments, which
is corroborated in Fig. 12.25.
On the other hand, the crossover frequency in Fig. 12.28a for G(s) in (12.29)
is ω ≈ 32[rad/s] and −ωT × 180◦ /π = −18.33◦ is the additional maximal
phase lag contributed by the digital implementation of controllers. This results in
an approximate 51◦ phase margin. Thus, good performance is still expected in
experiments, which is corroborated again in Fig. 12.25.
12.3 Controller Design 731
Bode Diagram
100
Magnitude (dB)
50
−50
45
0
Phase (deg)
−45
−90
−135
−180
−225
10−1 100 101 102 103
Frequency (rad/sec)
(a)
Nyquist Diagram
5
2
Imaginary Axis
−1
−2
−3
−4
−5
−30 −25 −20 −15 −10 −5 0
Real Axis
(b)
Fig. 12.28 (a) Bode and (b) polar plots. Continuous: G(s) in (12.28). Dashed: G(s) in (12.29)
732 12 Control of a Servomechanism with Flexibility
In the previous study we designed an inner loop for the motor position θ1 , driven
by a PD controller, and an external loop for the load position θ2 , driven by a PID
controller. The reader may wonder why not design a PID controller for θ1 and a PD
controller for θ2 ? Motivated by this question, such a control scheme is designed in
the following. The proposed control scheme is described by:
1
U (s) = kp1 + kd1 s + ki1 (V2 (s) − θ1 (s)), (12.30)
s
V2 (s) = (kp2 + kd2 s)(θ2d (s) − θ2 (s)), (12.31)
This results in the closed-loop system shown in Fig. 12.29b. Note that the open-
loop transfer function in Fig. 12.29b has no pole at the origin, as c0 = 0. Hence,
if the desired position θ2d is a constant in time, then a nonzero steady-state error
is obtained. Thus, to ensure a zero steady-state error at least one pole at the origin
is required in the open-loop transfer function. This means that a PID controller is
necessary for the load position θ2 , i.e., the following must be used:
1
V2 (s) = kp2 + kd2 s + ki2 (θ2d (s) − θ2 (s)), (12.33)
s
12.3 Controller Design 733
a
V 2(s) U(s)
kp2 + kd2s kp1 + kd1s + ki1 1s
θ 1(s) b
s 2+I 2s+IK
2 2
K
I2
b
V 2(s) k mK k d1s 2+k p1s+k i1
kp2 + kd2s RI 1I 2 M(s)
Fig. 12.29 Block diagram of the closed-loop control system when using (12.30) and (12.31)
a
V 2(s) U(s)
kp2 + kd2s + ki2 1s kp1 + kd1s + ki1 1s
θ 1(s) b
s 2+I 2s+IK
2 2
K
I2
b
V 2(s) k mK k d1s 2+k p1s+k i1
kp2 + kd2s + ki2 1s
RI 1I 2 M(s)
Fig. 12.30 Block diagrams of the closed-loop control system when using (12.30) and (12.33)
instead of (12.31). Then, the closed loop system in Fig. 12.30 is obtained. As
proposed in the previous study, the idea is to use the zeros of the PID controller
in (12.33) to cancel out two badly damped poles of (12.32). This defines two gains
of the external PID controller, i.e., kp2 and ki2 . Hence, the closed-loop system has
four poles and there are four remaining controller gains, i.e., kp1 , kd1 , ki1 , kd2 . It is
possible to proceed to obtain the closed-loop characteristic polynomial to show that
its four coefficients can be arbitrarily assigned using kp1 , kd1 , ki1 , kd2 . This means
that the closed-loop poles can be assigned arbitrarily by suitably selecting these
controller gains. Hence, it is possible to compute the controller gains exactly by
equating the closed-loop characteristic polynomial as s 4 + d3 s 3 + d2 s 2 + d1 s + d0 =
(s −p1 )(s −p2 )(s −p3 )(s −p4 ), where pi , i = 1, . . . , 4, are the desired closed-loop
poles. However, this is not performed because it is more important for us to show
that sustained oscillations exist in the closed-loop response. This is shown below.
734 12 Control of a Servomechanism with Flexibility
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 0.2 0.4 0.6 0.8 1 1.2 1.4
Time (sec)
Fig. 12.31 Simulation results. Response of the load position θ2 when using the controller gains
in (12.34)
Using a trial and error procedure it is found that the following controller gains:
produce the closed-loop response shown in Fig. 12.31, where tr = 0.254[s] and
Mp = 8%. In Fig. 12.32 the response obtained experimentally is presented when
using the controller gains in (12.34). It is observed that the rise time and overshoot
values are 0.22[s] and 16.25% respectively. Note that these experimental data are
close to data obtained in simulations. However, it is observed in Fig. 12.32 that it
seems that the system has not finished responding. Hence, the same response is
presented over a larger interval of time in Fig. 12.33. Note that sustained oscillations
exist. This is known as a limit cycle. According to Sect. 8.3, a limit cycle may appear
when hard nonlinearities are present. In the present mechanism, a hard saturation
called dead zone appears as an effect of static friction present at the motor shaft. To
study this limit cycle, the closed loop system in Fig. 12.30 must be represented as
shown in Fig. 12.34a. From this diagram Fig. 12.34b is obtained where:
b2
1 s2 + I2 s + K
I2
G4 (s) = kp2 + kd2 s + ki2 + K
,
s I2
12.3 Controller Design 735
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.32 Experimental results obtained when using the controller gains in (12.34). (a) θ2 . (b) θ1 .
(c) Applied voltage, u
736 12 Control of a Servomechanism with Flexibility
1
G5 (s) = kp1 + kd1 s + ki1 G4 (s)G2u (s).
s
The Bode and polar plots of the transfer function G5 (s) are presented in
Fig. 12.35. Note that the polar plot of G5 (s) crosses the negative real axis at the
left of (−1, 0). Hence, according to Sect. 8.3, the existence of a limit cycle is
theoretically justified. Moreover, as a −180◦ phase is obtained at ω = 5.73[rad/s],
the limit cycle is theoretically predicted to appear at a frequency of 0.912[Hz]. A
frequency of 0.5747[Hz] is measured in Fig. 12.33. Thus, taking into account that
uncertainties are always present in theoretical models, it is concluded that these
experimental results have been correctly predicted by theory.
The plots in Fig. 12.35 were drawn using the following MATLAB code in an
m-file:
clc
c=conv([1 0],[1 5]);
d=conv(c,[1 8 62.83^2]);
num1=175*[1 3 53.68^2];
g1=tf(num1,d);
g2u=tf(520000,d);
%%% PID1
ki1=3;
kp1=0.8;
kd1=0.12;
PID1=tf([kd1 kp1 ki1],[1 0]);
%%% PID2
kd2=0.002;
kp2=0.02535;
ki2=7.625;
PID2=tf([kd2 kp2 ki2],[1 0]);
fg=tf([1 3 53.68^2],53.68^2);
g4=parallel(PID2,fg);
g5=PID1*g4*g2u;
figure(1)
bode(g5,{1,1000})
grid on
figure(2)
nyquist(g5,{5,1000})
t=0:0.001:15;
%%{
figure(3)
plot(t,Datos(:,1),’k-’);
axis([-0.5 15 0 4])
ylabel(’\theta_2 [rad]’)
xlabel(’t [s]’)
12.3 Controller Design 737
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.33 Experimental results. Response in Fig. 12.32 displayed on a larger time interval. (a) θ2 .
(b) θ1 . (c) Applied voltage, u
738 12 Control of a Servomechanism with Flexibility
U(s)
kp1 + kd1s + ki1 1s DEAD
ZONE
θ1(s) b
s 2+ I 2s+IK
2 2
K
I2
(a)
0 + DEAD
U(s)
G5(s)
ZONE
(b)
Fig. 12.34 Closed-loop diagrams for limit cycle analysis
grid on
%}
In Fig. 12.36 the MATLAB/Simulink diagram used to perform the simulation in
Fig. 12.37 is shown. This simulation is executed under the same conditions as the
experimental results in Fig. 12.33. This means that the PID controller parameters
were chosen as in (12.34) and θ2d = π [rad]. The To work space block saves data
in an array with 0.001 as the sampling time. The dead zone block was programmed
with δ = 0.3 because this results in oscillations with an amplitude that is similar
to that obtained in the experiments. After executing the MATLAB code above, run
the simulation in Fig. 12.36 and, finally, execute the MATLAB code above again to
obtain Fig. 12.37.
According to the discussion at the beginning of this section, the main problem in
controlling θ2 directly is that G2u (s) has poles that are located close to the imaginary
axis. Hence, a possible solution to this control problem may be to replace such open-
loop poles for some others located at more convenient regions of the complex plane.
In the following, we present two different ways of using this approach to design a
closed-loop control system such as that depicted in Fig. 12.38.
12.3 Controller Design 739
Bode Diagram
60
50
40
Magnitude (dB)
30
20
10
0
−10
−20
−30
−40
90
0
Phase (deg)
−90
−180
−270
100 101 102 103
Frequency (rad/sec)
(a)
Nyquist Diagram
1.5
0.5
Imaginary Axis
−0.5
−1
−1.5
−6 −5 −4 −3 −2 −1 0 1
Real Axis
(b)
52e4
d(s)
Gu2
PID(s) num1(s)
PID(s) Scope
theta2d d(s)
Add1
Add
Gu1 Datos
3.5
2.5
θ2 [rad]
1.5
0.5
0
0 5 10 15
t [s]
Fig. 12.37 Simulation results obtained under the same conditions as the experimental results in
Fig. 12.33
(s + 5)(s 2 + 8s + 62.832 )
Gc (s) = γ , (12.35)
(s − p1 )(s − p2 )(s − p3 )
12.3 Controller Design 741
135°
p3 45°
p1 = 0 Re(s)
p2
–45°
–135°
where the poles with nonpositive real parts p1 , p2 , p3 and the constant γ > 0 must
be determined by a design procedure, in this case, the root locus method.
First, suppose that p1 = 0. The root locus diagram obtained from the open loop
transfer function:
is shown in Fig. 12.39. Note that four asymptotes exist whose angles can be
computed using:
±180◦ (2q + 1)
Asymptote angles = , q = 0, 1, 2, . . . , n = 4, m = 0,
n−m
to find ±45◦ and ±135◦ . As no open-loop zero exists, the branches starting at the
pair of open-loop poles located at s = 0 are immediately pushed into the complex
right half-plane. This means closed-loop instability for any γ > 0 and any p2 , p3
in the complex left half-plane. Hence, to minimize the closed-loop oscillations,
p1 , p2 , p3 must be proposed to be real and negative. Moreover, the design based
on the root locus method requires two conditions to be satisfied: the angle condition
and the magnitude condition. This means that the design problem can be analytically
solved if only two unknown quantities exist. In the control problem at hand, this can
be accomplished if we propose p1 = p2 = p3 = p < 0 as only p < 0 and γ > 0
are hence unknown.
Given some values for the desired rise time tr and overshoot Mp , the desired
closed loop pole sd =Re(sd )±Im(sd )j can be computed as:
742 12 Control of a Servomechanism with Flexibility
sd
l l0
θ0
θ
p p0
ln2 (Mp /100) 1 1 − ζ2
ζ = , ωn = π − arctan ,
ln2 (Mp /100) + π 2 tr 1 − ζ 2 ζ
Re(sd ) = −ζ ωn , Im(sd ) = ωn 1 − ζ 2 .
The solution of this problem using the root locus method requires us to consider the
situation depicted in Fig. 12.40. Note that:
◦ Im (sd )
θ0 = 180 − arctan ,
abs(Re (sd ))
180◦ − θ0
θ= .
3
Moreover:
Im (sd ) Im (sd )
tan(θ ) = ⇒p=− − Re (sd ) ,
−(p − Re (sd )) tan(θ )
l0 = Re2 (sd ) + Im2 (sd ), l = (p − Re (sd ))2 + Im2 (sd ),
γ 520000 l 3 l0
= 1 ⇒ γ = .
l 3 l0 520000
Proposing tr = 0.23[s] and Mp = 10% as desired values and using the above
expressions the following is found:
p = −36.6439, γ = 0.6892.
(s + 5)(s 2 + 8s + 62.832 )
Gc (s) = 0.6892 . (12.37)
(s + 36.6439)3
The experimental results obtained with the controller in (12.37) are presented in
Fig. 12.41. Note that a 0.28[s] rise time and a 15% overshoot are obtained. We note
that a nonzero steady-state error is obtained that is due to nonlinear friction present
in the real physical system but is not considered during the modeling stage. To
render the steady- state error zero, closing an external loop around the closed-loop
system shown in Fig. 12.38 was attempted. This external loop was designed to be
driven by either a PI or a PID controller. However, in both cases, bad performances
were found. In particular, when using the PI controller, a limit cycle was observed.
It is left as an exercise for the reader to mathematically show that such a limit cycle
is expected to appear.
Another common way of designing the closed-loop control system in Fig. 12.38
is the so-called polynomial-based pole assignment approach, which is described
below. First, assume that the controller and the plant are expressed as:
D(s) F (s)
G2u (s) = , Gc (s) = , (12.38)
C(s) E(s)
D(s) = d0 ,
C(s) = s 4 + c3 s 3 + c2 s 2 + c1 s + c0 ,
F (s) = f3 s 3 + f2 s 2 + f1 s + f0 ,
E(s) = e3 s 3 + e2 s 2 + e1 s + e0 .
The closed-loop transfer function of the control system in Fig. 12.38 is given as:
θ2 (s) F (s)D(s)
M(s) = = .
θ2d (s) E(s)C(s) + F (s)D(s)
744 12 Control of a Servomechanism with Flexibility
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.41 Direct control of the load position θ2 . Experimental results. Continuous: PID controller
with gains in (12.21). Dashed: use of controller in (12.37). (a) θ2 . (b) θ1 . (c) Applied voltage, u
12.3 Controller Design 745
The closed-loop poles are the roots of the polynomial at the denominator, i.e.,
E(s)C(s) + F (s)D(s). This approach consists in assigning:
E(s)C(s) + F (s)D(s) = s 7 + a6 s 6 + a5 s 5 + a4 s 4 + a3 s 3 + a2 s 2 + a1 s + a0 ,
7
= (s − λi ),
i=1
Qx = y, x = [e3 , e2 , e1 , e0 , f3 , f2 , f1 , f0 ]T , y = [1, a6 , a5 , a4 , a3 , a2 , a1 , a0 ]T ,
⎡ ⎤
1 0 0 0 0 0 0 0
⎢ c3 1 0 0 0 0 0 0⎥
⎢ ⎥
⎢c c3 1 0 0 0 0 0 ⎥
⎢ 2 ⎥
⎢ ⎥
⎢c c2 c3 1 0 0 0 0 ⎥
Q=⎢ 1 ⎥.
⎢ c0 c1 c2 c3 d0 0 0 0 ⎥
⎢ ⎥
⎢0 c0 c1 c2 0 d0 0 0 ⎥
⎢ ⎥
⎣0 0 c0 c1 0 0 d0 0 ⎦
0 0 0 c0 0 0 0 d0
According to theorem 7.1, pp. 181, and lemma 7.1, pp. 82, in [1], the matrix Q is
nonsingular if, and only if, the polynomials D(s) and C(s) have no common root.
In such a case, an unique solution exists for x, which is given as:
x = Q−1 y. (12.39)
It is not difficult to realize that in the problem at hand, D(s) and C(s) have no
common root, as:
D(s) = d0 = 520000,
C(s) = s 4 + c3 s 3 + c2 s 2 + c1 s + c0 = s(s + 5)(s 2 + 8s + 62.832 ).
= s 4 + 13s 3 + 3988s 2 + 1.974 × 104 s.
Using these data to construct the matrix Q, (12.39) and proposing the following
desired closed-loop poles:
Is it important to stress that a stable solution for this problem is strongly dependent
on proposing a suitable set of desired closed-loop poles. This mean that an unstable
controller may result for some choices of the desired closed-loop poles. Although
stability may be concluded for the closed-loop system, performance obtained in
practice deteriorates severely if the controller is unstable or if some of its zeros are
in the right half-plane. Hence, such solutions must be avoided.
Some experimental results obtained with the controller in (12.40) are presented
in Fig. 12.42. Note that the rise time is 0.288[s] and overshoot is 10%. The
reader can verify that the desired closed-loop complex conjugate poles located at
λ1 = −7.0212 + 9.5795j and λ2 = −7.0212 − 9.5795j , are intended to produce
0.23[s] and 10% as rise time and overshoot respectively. Thus, the experimental
response is close to these desired values for the accuracy limits of these experiments.
Finally, note that a nonzero steady-state error is obtained, which is due to nonlinear
friction present in the real physical system but is not considered during the modeling
stage. To render the steady- state error zero, closing an external loop around the
closed-loop system shown in Fig. 12.38 was attempted. This external loop was
designed to be driven by either a PI or a PID controller. However, in both cases,
bad performances were found. In particular, when using the PI controller a limit
cycle was observed to. It is left as an exercise for the reader to mathematically show
that such a limit cycle is expected to appear.
[rad]
t [s]
(a)
[rad]
t [s]
(b)
[V]
t [s]
(c)
Fig. 12.42 Direct control of the load position θ2 . Experimental results. Continuous: PID controller
with gains in (12.21). Dashed: use of controller in (12.40). (a) θ2 . (b) θ1 . (c) Applied voltage, u
748 12 Control of a Servomechanism with Flexibility
The electrical diagram of the complete control system is shown in Fig. 12.44. A
PIC16F877A microcontroller is used as a data acquisition board. This microcon-
troller communicates with a personal computer (Pentium 4, Windows XP), via the
serial port. The microcontroller receives the position of both the motor and the load
and sends these data to the personal computer. The personal computer evaluates the
control algorithm and sends the voltage signal to be applied to the motor back to the
microcontroller . A MAX232IC renders communication of the microcontroller via
the serial port possible. A L298N IC dual H bridge actuates as a power amplifier
and applies the commanded voltage at the motor armature terminals. The L298N IC
is configured such that both its H bridges are connected in parallel, to be capable
of handling up to 4[A]. This integrated circuit is driven via one of the pulse-width
modulation (PWM) modules of the microcontroller. A 74L08 IC, AND logic, is
used to adapt the PWM signal to the logic of the L298N dual H bridge.
The C code used to program the microcontroller PIC16F877A is presented
in Sect. 12.5. After defining some libraries and constants, an interruption is
listed that is devoted to counting pulses from both encoders used to measure
the motor and the load positions. In the executable part of the program, there is
an infinite cycle represented by a “while(true)” instruction. Within this loop, a
recognition code is first sent to the computer using “putc(0xAA);.” Then, the motor
position and, finally, the load position are sent to the computer via the instructions
“putc(cuentaH1); putc(cuentaL1); putc(cuentaH2); putc(cuentaL2);.” The instruc-
tion “do-while(TMR0<196)” has two purposes: i) To set the sample period to
10[ms]. ii) To wait for the voltage data to be sent back by the computer once the
control algorithm has been evaluated. After that, the voltage to be applied to the
motor is sent to the PWM module as a duty cycle using “set_pwm1_duty(pwm);.”
12.4 Experimental Prototype Construction 749
computer
to
Incremental
encoders
The conversion to duty cycle requires the voltage information from the lowest 7 bits
of the variable “dato” to be extracted, as the highest bit contains the voltage sign
information. Once the sample period has elapsed, the do while (TMR0<196) cycle
repeats again.
750 12 Control of a Servomechanism with Flexibility
The code of the program executed by the personal computer is listed in Sect. 12.6.
After defining some libraries, constants, the controller gains among them, and
variables, the executable part of the program starts with the instruction “void
ProcessByte(BYTE byte).” The instructions that follow are devoted to waiting for
the recognition code “0xAA” to be sent by the microcontroller. Once this code is
recognized, the motor and the load positions are received. Then, the motor and the
load velocities are computed by numerical differentiation. After that, four control
algorithms are coded. The first one is a PD controller used to directly control
the load position. This control algorithm was used to perform the experiments
presented in Fig. 12.8. The second control algorithm is the multi-loop nested PID
controllers used to perform all experiments in Sect. 12.3.1. The third and fourth
control algorithms are controllers used to perform the experiments in Figs. 12.41
and 12.42 respectively. The reader is referred to Appendix F for an explanation on
how these controllers are numerically implemented.
The control signal or voltage to be applied at the motor terminals is represented
by the variable “iast.” This variable is saturated, converted into the range [0, 255],
and finally confined to the lowest 7 bits of an 8-bit word, as the highest bit is
devoted to containing the voltage sign. A byte with this information is sent to the
microcontroller by means of the instruction “MainForm->send_byte(pwm);.” After
that, several variables are saved in a text file named “MONIT.TXT.” Finally, the
current time is increased by 10[ms] using “t=t+Ts;,” the program returns to the
beginning of the instruction “void ProcessByte(BYTE byte)” and stays there waiting
again for the recognition code “0xAA.” We stress that the sample time is fixed by
the microcontroller and the computer merely increases the time by 10[ms] when the
executable part of program reaches its end.
The flow diagram for the microcontroller PIC16F877A programming when used
as an interface between the mechanism with flexibility and a PC, is shown in
Fig. 12.45. We refer to [3, 4], for a complete explanation of instructions employed
in the program listed below. We do not try to present a detailed explanation of this
program. Our intention is merely to show the reader how a microcontroller can be
used as part of a closed-loop control system.
#include<16f877A.h>
#include<stdlib.h>
#include<math.h>
#fuses HS,NOWDT,PUT,NOBROWNOUT,NOLVP,NOWRT,NOPROTECT,NOCPD
#use delay(clock=20000000) // Xtal freq
#use rs232(baud=115200,XMIT=PIN_C6,RCV=PIN_C7,BITS=8,PARITY=N)
//ports and registers addresses
#byte OPTION= 0x81
#byte TMR0 = 0x01
#byte PORTA = 0x05
12.5 Microcontroller PIC16F877A C Program 751
PARAMETERS
cuenta1++;
}
AB_1=AB;
BC=((puerto)&(0xC0))>>6;
aux=BC^BC_1;
if(aux!=0)
if(aux!=3)
if(((BC_1<<1)^BC)&(0x02))
{
cuenta2--;
}
else
{
cuenta2++;
}
BC_1=BC;
}
//------------main program------------//
void main(void)
{
set_tris_a(0b11111111);
set_tris_b(0b11111111);
set_tris_c(0b10000000); //pin config.
set_tris_d(0b00000000);
set_tris_e(0b00000000);
OPTION=0x07; //pre_scaler timer0, 1:256
setup_ccp1(CCP_PWM); //PWM configuration
setup_timer_2(T2_DIV_BY_16,255,1);//T=(1/clock)*4*t2div*(period+1)
PORTC=0;
TMR0=0;
cuenta1=0;
cuenta2=0;
set_pwm1_duty(0);
AB=0;
AB_1=0;
BC=0;
BC_1=0;
enable_interrupts(global);
enable_interrupts(int_rb);
PC0=1;
while(TRUE)
{
inter=(cuenta1)&(0xFF00);
cuentaH1=inter>>8;
cuentaL1=(cuenta1)&(0x00FF);
inter=(cuenta2)&(0xFF00);
cuentaH2=inter>>8;
cuentaL2=(cuenta2)&(0x00FF);
12.6 Personal Computer Builder C++ Program 753
PD3=1;
putc(0xAA); //sending serial port
putc(cuentaH1);
putc(cuentaL1);
putc(cuentaH2);
putc(cuentaL2);
PD3=0;
PD2=1; //waits for sampling time
do
{
if(kbhit())
{
dato=getc();//getting datum
if(dato>=128)
{
PD0=0;
PD1=1;
dato=dato-128;
pwm=dato<<1;
}
else
{
PD0=1;
PD1=0;
pwm=dato<<1;
}
set_pwm1_duty(pwm); //sending pwm
}
}
while(TMR0<196); //each count = (4/FXtal)*256 sec
PD2=0; //sampling time has arrived
TMR0=0;
} //closing the infinite while
} //closing main
The flow diagram for PC programming when used to control a mechanism with
flexibility is presented in Fig. 12.46. We refer to [5] for a complete explanation
of instructions employed in the program listed below. We do not try to present a
detailed explanation of this program. Our intention is merely to show the reader
how a computer program can be used to implement control algorithms.
#include <vcl.h>
#pragma hdrstop
#include "Main.h"
#include <math.h>
#include <stdio.h>
754 12 Control of a Servomechanism with Flexibility
PARAMETERS
LOAD VELOCITIES.
#include <share.h>
#include <conio.h>
#include <dos.h>
//----------------------------------------------------------
#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
//----------------------------------------------------------
#define Ts 0.01
#define pprp 1000.0
#define pprb 400.0
#define pi_ 3.14159265358
#define fte 11.5
#define cpH 1.5
//-------------controller gains-------------------
#define kp1 0.8
#define kd1 0.12
#define ki1 3.0
FILE *ptrMonit;
TMainForm *MainForm;
unsigned char flagcom=0,flagfile=0,signo_sal,pwm,iastd;
unsigned short int pos,pos2; /
float VM=fte-cpH,ef=0.0,ef_1=0.0,e2_1=0.0,ef2,e2,iast;
12.6 Personal Computer Builder C++ Program 755
float pwmf,t=0.0,escp=pi_/(2*pprp);
float escb=pi_/(2*pprb),vo=fte-cpH,escs=127/VM,Voltaje;
float w,factor=6.0*pi_/255.0;
float fact2=2.0*pi_,alfa=1.0,a1,spvf=pi_,vv=0.0,ii,v;
float v2,pvff,pvff_1,ep_1=0.0;
float pvf_1=0.0,pvf2_1=0.0,p_1=0,p2_1=0,pvf=0,pvf2=0;
float s2t1,vc,v2c,V_q,theta1d,e,f,u,u1,ie=0.0,ie2=0.0;
float u2,A=0.3,iTs=1/Ts;
float x1,x2,x3,x1m=0.0,x2m=0.0,x3m=0.0,ief=0.0;
//--------------------------------------------------
void ProcessByte(BYTE byte)
{
if(flagcom!=0)
flagcom++;
if((byte==0xAA)&&(flagcom==0))
{
pos=0;
pos2=0;
flagcom=1;
}
if(flagcom==2)
{
pos=byte;
pos=pos<<8;
}
if(flagcom==3)
{
pos=pos+byte;
}
if(flagcom==4)
{
pos2=byte;
pos2=pos2<<8;
}
if(flagcom==5)
{
pos2=pos2+byte;
pvf=(signed short int)pos;
pvf=escb*pvf; // motor
pvf2=(signed short int)pos2;
pvf2=-escp*pvf2; // load
// velocities computation
// *************************************
if(abs(pvf-pvf_1)<60.0)
{
v=(pvf-pvf_1)*iTs; // motor velocity
}
pvf_1=pvf;
// *******************************
if(abs(pvf2-pvf2_1)<60.0)
v2=(pvf2-pvf2_1)*iTs; // mass 2 velocity
ef2=spvf2-v2; // mass 2 velocity error
pvf2_1=pvf2;
756 12 Control of a Servomechanism with Flexibility
// *************************************
ef=u2-pvf;
iast=(kp1*ef+kd1*(ef-ef_1)/Ts+ki1*ief);
ief=ief+Ts*ef;
// iast=(kp1*ef-kd1*(pvf-ep_1)/Ts);
ef_1=ef;
e2_1=e2;
ep_1=pvf;
iast=-8.351*x1m-0.05483*x2m-1.24*x3m+0.6892*ef;
x1m=x1;
x2m=x2;
x3m=x3;
*/
/*
ef=spvf-pvf2;
x1=(-94.04*x1m-45.15*x2m-16.65*x3m+8.0*ef)*Ts+x1m;
x2=64.0*x1m*Ts+x2m;
x3=32.0*x2m*Ts+x3m;
iast=-4.465*x1m+0.9454*x2m-0.3866*x3m+0.4408*ef;
x1m=x1;
x2m=x2;
x3m=x3;
*/
/* ========== control polynomials =======================*/
/* ============ Frequency response ==================*/
// iast=3.0*sin(w*t);
/* ============ Frequency response==================*/
// *****************************************************
// * iast stands for voltage applied to motor *
// *****************************************************
if(iast>VM)
12.6 Personal Computer Builder C++ Program 757
{iast=VM;}
if(iast<-VM)
{iast=-VM;}
pwmf=iast;
pwmf=escs*pwmf;
pwm=(unsigned char)abs(pwmf);
if(pwmf<0)
pwm=pwm+128;
//screen exhibition
MainForm->Edit1->Text = FloatToStr (v);
MainForm->Edit2->Text = FloatToStr (v2);
MainForm->Edit3->Text = FloatToStr (pvf);
MainForm->Edit4->Text = FloatToStr (pvf2);
MainForm->Edit5->Text = FloatToStr (iast);
MainForm->Edit6->Text = FloatToStr (t);
MainForm->Edit7->Text = FloatToStr (E);
/*open/close a file*/
if(flagfile==0)
if((ptrMonit=fopen("MONIT.TXT", "w"))==NULL){}
flagfile=1;
/*write to file*/
fprintf(ptrMonit,"%3.3f\t%3.3f\t%3.3f\t%3.3f\t%3.3f\n",t,spvf,
%pvf,pvf2,iast);
t=t+Ts;
}//closing if flagcom 3 now flagcom 5
}
//-------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner), SerialPort(1, ProcessByte), fAcknowledge(true)
{
if (SerialPort.IsReady() != TRUE)
MessageBox(NULL, "Problems with port", "Error", MB_OK);
}
//-------------------------------------------------------------
void TMainForm::send_byte(unsigned char byte_sal)
{
if (fAcknowledge == false)
return;
SerialPort.WriteByte(byte_sal);
fAcknowledge = false;
}
//-------------------------------------------------------------
void TMainForm::Acknowledge()
{
fAcknowledge = true;
}
758 12 Control of a Servomechanism with Flexibility
12.7 Summary
Position control of a rotative mechanism composed of two bodies that are joined
at their shafts through a rotative spring is analyzed, designed, and experimentally
tested in this chapter. Several approaches to controller design are used and all these
designs are experimentally tested to appreciate their advantages and disadvantages.
The reason for including this control problem is that this plant cannot be controlled
using a single-loop PID controller; hence, a more elaborate control scheme is
required. In this chapter, therefore, it is shown how to perform this task.
One approach to control design is to use a two-loop control scheme, with the
external loop driven by a classical PID controller. The idea is to use the PID
pair of zeros to approximately cancel out the badly damped plant poles, i.e., to
reduce the oscillations. This approach successfully stabilizes the closed-loop system
and renders the steady-state error zero. Another approach is to use a single-loop
controller that is intended to replace the undesired badly damped dynamics of the
plant by other more suitable dynamics. The drawback of this approach is the lack
of an integral action in the controller that results in a steady-state error that is
different from zero. However, this approach is useful for showing how to implement
controllers that are given in terms of a transfer function: the realization of transfer
functions using the steady-state representation is very useful in this respect.
6. The plant identification has been performed using the frequency response
approach. What are the advantages of this approach in this example with respect
to the identification method used in Chaps. 15 and 16?
References
Magnetic levitation systems are very important at present because of their numerous
applications. This equipment is also known as MagLev. One of the main reasons for
the use of magnetic levitation systems is their capacity to eliminate friction between
mechanical pieces. Some application examples are high-velocity trains, traveling
by floating upon a rail [1], magnetic bearings [2] that avoid friction, and, hence,
wear of the mechanical pieces and high-precision positioning control systems [3]
thanks to friction elimination. Because of their practical importance, this equipment
is often employed as a workbench to test the performance of classical control and
some advanced control techniques [4–8, 10].
In this chapter, a simple magnetic levitation system is designed that may be seen
as the basic principle of the more complex applications cited above. This magnetic
levitation system is depicted in Fig. 13.1. It consists of a ferromagnetic ball that
receives the upward effect of a magnetic force produced by an electromagnet. This
ball also receives the downward effect of gravity. The ball must levitate at a desired
distance from the electromagnet. The main problem in accomplishing this task is
the open-loop instability of the system, which can be seen as follows.
Suppose that the electromagnet exerts a constant upward force on the ball that is
equal to the downward force of gravity. Then, these forces exactly cancel out and the
ball remains levitating in space. Everyday experience tells us that the electromagnet
force on the ball increases as the ball approaches the electromagnet, whereas the
gravity force is always the same. Suppose now that, because of some disturbance,
the ball moves upward from the position where it was levitating. This renders
the force of the electromagnet greater than the gravity force and, hence, the ball
continues moving upward until the electromagnet is reached. On the other hand, if
the ball moves slightly downward from the position where it was levitating, then
the gravity force is greater than the electromagnet force and the ball continues to
fall. This situation is a description of system instability: when an unstable system is
slightly disturbed, the system variables diverge from the values that they possessed
at the point where the system was at rest.
Electromagnet
Ball
Note that the electromagnet electric circuit is merely a series RL circuits involving
the applied voltage u, and the electromagnet winding inductance and resistance (see
Fig. 13.1). Applying the Kirchhoff’s voltage law, the following is found:
applied voltage = voltage drops in the mesh,
13.1 The Complete Nonlinear Mathematical Model 763
L(y)
k0 + k
k0
Either of the functions (13.2) or (13.3) can be chosen to represent L(y), as long
as they fit the experimental data. It is explained in Sect. 13.4.2 how to perform
an experiment to identify the inductance parameters. In this chapter, the general
symbol L(y) is still used to represent the inductance to allow the reader to employ
the results that are presented next for any of the cases in (13.2) and (13.3). Only
at the final design stage, when the numerical values need to be specific, will we
proceed to use (13.2) because this expression fits our experimental data better (see
Sect. 13.4.2).
∂E(i, y)
F = , (13.4)
∂y
1
E(i, y) = L(y) i 2 , (13.5)
2
where E(i, y) is the magnetic energy stored in the complete magnetic system
(electromagnet and ball).
Applying Newton’s Second Law to the ball, the mechanical subsystem model is
obtained (see Fig. 13.1):
mass × acceleration = forces on the ball,
d 2y
m = electromagnet force + ball weight,
dt 2
d 2y
m = F (i, y) + mg,
dt 2
d 2y 1 ∂L(y) 2
m = i + mg, (13.6)
dt 2 2 ∂y
1 ∂L(y) 2
F (i, y) = i .
2 ∂y
13.2 Approximate Linear Model 765
The reader can use either (13.2) or (13.3) to verify the following property:
∂L(y)
< 0, (13.7)
∂y
for all positive y, i.e., for any realizable ball position. Note that the weight mg
appears with a positive sign in (13.6) because it favors the increment of y. On the
other hand, the force F (i, y) also appears affected by a positive sign because it
is defined in the sense where y increases. However, its value is negative because
of (13.7), which implies that its effect opposes the increments in y, i.e., it really
opposes the ball weight. Thus, the property in (13.7) is instrumental in the ball
levitating.
Replacing ψ = L(y)i in (13.1), the following is obtained:
di ∂L(y)
L(y) =u−R i− ẏ i.
dt ∂y
di ∂L(y)
L(y) = u−R i− ẏ i, (13.8)
dt ∂y
d 2y 1 ∂L(y) 2
m 2
= i + mg. (13.9)
dt 2 ∂y
According to Sect. 7.3.2, the operation points are the pairs (x ∗ , u∗ ) satisfying:
⎡ ⎤
∂L(x2∗ ) ∗ ⎡ ⎤
1
L(x2∗ ) u∗ − R x1∗ − ∂x2 x3 x1∗ 0
⎢ ⎥
f (x ∗ , u∗ ) = ⎢
⎣ x3∗ ⎥ = ⎣0⎦,
⎦ (13.13)
∗
1 ∂L(x2 ) ∗ 2 0
g+ 2m ∂x2 x1
∂L(x2∗ )
where L(x2∗ ) and ∂x2 indicate that those functions are evaluated at x2 = x2∗ .
Hence:
x3∗ = 0, (13.14)
%
&
& 2mg
x1∗ = ' ∂L(x ∗ ) , (13.15)
− ∂x22
u∗ = Rx1∗ . (13.16)
∂L(x ∗ )
Recall that − ∂x22 > 0, because of (13.7). The value x2∗ = yd is proposed by the
designer as it stands for the ball’s desired position.
13.2 Approximate Linear Model 767
According to (7.22), (7.23), (7.24) in Sect. 7.3.2, the nonlinear model given
in (13.11), (13.12), can be approximated by the following linear model:
ż = Az + Bv, (13.17)
⎡ ∂f (x, u) ∂f (x, u) ∂f (x, u) ⎤
1 1 1
⎢ ∂x1 ∂x2 ∂x3 ⎥
⎢ ⎥
⎢ ∂f (x, u) ∂f (x, u) ∂f (x, u) ⎥
⎢ 2 2 2 ⎥
A=⎢ ⎥ ,
⎢ ∂x1 ∂x2 ∂x3 ⎥
⎢ ⎥
⎣ ∂f (x, u) ∂f (x, u) ∂f (x, u) ⎦
3 3 3
∂x1 ∂x2 ∂x3 x=x ∗ ,u=u∗
⎡ ⎤
∂f1 (x,u)
⎢ ∂u (x,u) ⎥
B = ⎣ ∂f2∂u ⎦ ,
∂f3 (x,u)
∂u x=x ∗ ,u=u∗
Recall that the operation point (x ∗ , u∗ ) represents four constant scalar values.
Applying the Laplace transform to each row in (13.17), together with the values
given in (13.18), the following is obtained:
1 1
Z1 (s) = [a13 sZ2 (s) + V (s)], (13.19)
s − a11 L(x2∗ )
a31
Z2 (s) = 2 Z1 (s), (13.20)
s − a32
where Z1 (s), Z2 (s), V (s), stand for the Laplace transforms of the functions of time
z1 = x1 −x1∗ , z2 = x2 −x2∗ and v = u−u∗ respectively. These expressions constitute
the approximate linear model to be used for analysis and controller design. Recall
that, according to Sect. 7.3, all information obtained from (13.19) is valid only if
both x and u remain close to the operation point (x ∗ , u∗ ).
768 13 Control of a Magnetic Levitation System
13.3.1 Ball
The ball must be made of ferromagnetic material and, also, it must be light enough.
On the other hand, to make the measurement of its position easy, the ball must
not be too small. These requirements were satisfied by selecting a Styrofoam
ball of approximately 0.03[m] in diameter, suitable for the position sensor to
be constructed, and inserting iron tacks on its surface with the help of glue.
Although the resulting surface is not perfectly even, this idea was proven to work in
experiments.
13.3.2 Electromagnet
0:1μF
1N60P
0:001μF
i d + x *1
SW2 – x*1 =A d
1k
–15V
220Ω
220Ω
SW1
220Ω
220Ω
220Ω
position
sensor
pipe casing is painted in black to avoid lighting disturbances. A visible light hand
lamp is placed in front of the other end of the metal pipe casing. The assembly
is placed under the electromagnet such that, when the levitating ball touches the
electromagnet, the light is completely blocked, i.e., the photoconductive cell does
not receive light and its electric resistance is very high. As the ball moves away
from the electromagnet (downward), the light intensity on the photoconductive cell
increases, i.e., its electric resistance decreases. This allows the voltage at the point
yv in Fig. 13.3 to increase as the ball position increases, i.e., when the ball moves
770 13 Control of a Magnetic Levitation System
z2v = As z2 . (13.21)
13.3.4 Controller
According to Sect. 9.2, the operational amplifier placed between the points A and
B in Fig. 13.3 implements a proportional–integral–derivative (PID) controller with
a sign change. Later in this chapter, it is explained how to select R1 , R2 , C1 and C2
for correct controller gain selection.
The two operational amplifiers after T 1 in Fig. 13.3 are employed to implement a
proportional–integral (PI) electric
t current controller that performs the mathematical
operation kpi (id − i) + kii 0 (id (r) − i(r))dr with kpi = 4.7 and kii = 10000 (see
Sect. 9.2). The result of this operation is delivered to the power amplifier at the input
of the operational amplifier TL081 used as a comparator in a pulse-width modulator
(PWM).
The power amplifier is PWM-based. This amplifier has a triangular wave generator
whose value Vt changes between 0[V] and 12.5[V] (top of Fig. 13.3). The frequency
of this signal determines the frequency of the PWM, i.e., 1.53[KHz]. As explained
in Sect. 13.5, this frequency satisfies the design requirements. The triangular wave
signal is compared (TL081, in Fig. 13.3) with the signal delivered by the electric
current controller to generate a PWM signal. This signal is applied at the base of an
NPN TIP141 transistor devoted to connecting and disconnecting the power voltage
13.4 Experimental Identification of the Model Parameters 771
Vs =12.5[V] (see Fig. 13.3). This power amplifier is modeled by the gain:
Vs 12.5
Ap = = = 1. (13.22)
peak-to-peak voltage of Vt 12.5
The diode at the TL081 operational amplifier output, which is used as a comparator,
is intended to avoid negative voltages. As the voltage delivered by the operational
amplifier is alternating current at 1.53[kHz], a radiofrequency amplitude modulated
detector 1N60P diode is employed. The 6.8[KOhm] resistance limits the electric
current, whereas the capacitor at the transistor base is useful for noise filtering.
A set of constant voltages are applied at the electromagnet terminals and the
resulting electric current is measured. These pairs of values are plotted in Fig. 13.4
with the symbol “+” and it is found that a straight line fits them. The slope of this
straight line corresponds to the electromagnet internal resistance R that was found
to be R = 2.72[Ohm].
u
[V]
i [A]
The ball is placed at different positions, y, which are measured from the elec-
tromagnet’s bottom surface to the ball’s upper surface. Using an RLC meter, the
inductance L(y) is measured between the terminals of the electromagnet at each
of these positions. As the electromagnet operates at 1.53[KHz], because this is
the PWM power amplifier operation frequency, the inductance measurements were
performed at 1[KHz]. This is the closest frequency to 1.53[KHz] allowed by the
RLC meter used for the measurements. In Fig. 13.5, the symbol “+” represents the
measured values. Then, several values are proposed for the parameters k0 , k, a and
they are used to compute the function L(y) given in (13.2) at each y used in the
experiment. In Fig. 13.5, the continuous line represents the function L(y) that fits
the experimental data best. This was achieved using the following parameters to
compute L(y):
k0 = 36.3 × 10−3 [H], k = 3.5 × 10−3 [H], a = 5.2 × 10−3 [m]. (13.23)
The ball is placed at different positions, y, from the electromagnet’s bottom surface.
The voltage yv in Fig. 13.3 is measured for each of these positions. In Fig. 13.6, the
symbol “+” represents the experimental data that were obtained. It is found that a
L(y)
[H]
y [m]
Fig. 13.5 Experimental identification of the parameters k, k0 , and a defining L(y) in (13.2)
13.5 Control System Structure 773
2.5
1.5
yv [V]
0.5
0
0 0.005 0.01 0.015 0.02 0.025
y [m]
straight line with a 100[V/m] slope fits to these points well. This means that the
sensor gain is:
yv z2v
As = = = 100[V/m]. (13.24)
y z2
Note that the sensor gain also relates z2v and z2 if yv∗ = 100x2∗ is selected (recall
that y = x2 and x2∗ = yd ). Note that the sensor behavior is linear.
The control system to be designed is depicted in Fig. 13.7. Using the expressions
in (13.18), the section between V (s) and Z2 (s) in the block diagram in Fig. 13.8a
is obtained. Note that the constant u∗ is added and subtracted in Fig. 13.7. It is
clear that adding and subtracting the same quantity is equivalent to zero, which
correctly represents the situation shown in the electric diagram in Fig. 13.3 where
774 13 Control of a Magnetic Levitation System
Power
amplifier
Electromagnet
Optical
sensor
Ball
A PI electric current controller is included in Fig. 13.7 just before the power
amplifier. The reason for including this current loop is the closed-loop performance
improvement achieved by rendering the electrical dynamics faster. Throughout
Sect. 13.5.1, it is assumed that the switch SW2 selects “x1∗ ”.1 Then, id + x1∗ appears
affected by a positive sign directly at the adder placed at the input of the PI electric
current controller. In the following, the advantages of using a PI electric current
controller instead of a simple proportional controller are explained.
Suppose that the current loop is provided with a proportional electric current
controller, i.e., suppose that the block PI in Fig. 13.7 is replaced by a simple gain
kpi . Then, replacing:
a 13s
U *(s)
Z 5(s) + Z 4(s) k pis+k ii
– V(s) 1
+
1
Z 1(s) a 31 Z 2(s)
Ap L x* s – a 11 s 2 – a 32
– s + 2 +
X *1(s) –
+
k d s 2+k ps+k i
Ad s
As
I d (s)
a 13s
–
X *1(s)
+ k d s 2+k ps+k i
Ad s
As
+ + 1 Z 1(s) Z 2(s)
k pis+k ii 1 a 31
s
Ap L x* s – a 11 s 2 – a 32
+ – 2
Z 5(s)
sL(x *)
2 a 13s
(k pis+k ii )A p
–
X *1(s)
+
k d s 2+k ps+k i
Ad s
As
Z 5(s) Z 2(s)
– G p(s)
–
X *1(s)
+
k d s 2+k ps+k i
Ad s
As
X *1(s)
–
+ Z 2(s) + –Z 2(s)
0 As k d s 2+k ps+k i
Ad G p(s)
s
–
Fig. 13.8 Equivalent block diagrams of the control system. The disturbance −X1∗ (s) is only taken
into account when the switch SW2 is open in Fig. 13.3 or, equivalently, when the switch SW2
selects the signal “0” in Fig. 13.7
776 13 Control of a Magnetic Levitation System
di ∂L(y)
L(y) = kpi Ap (id + x1∗ − i) − R i − ẏ i.
dt ∂y
Once the steady state is reached (when all the variables remain constant in time),
the latter expression implies that:
kpi Ap
i= (id + x1∗ ).
kpi Ap + R
We stress that id + x1∗ represents the electric current desired to flow through the
electromagnet to keep the ball levitating. This current is determined by a PID
position controller and feedforward of the desired electric current at the operation
point.
Note that i ≈ id + x1∗ if kpi is chosen to be large. However, the drawback of
using large values for kpi is the amplification of the noise contained in id and i. As
a consequence, the ball vibrates excessively and levitation is not possible. Hence,
an alternative solution to a proportional electric current control must be employed.
di ∂L(y)
L = u−R i− ẏ i,
dt ∂y
t
u = Ap kpi (id + x1∗ − i) + kii (id (r) + x1∗ − i(r))dr ,
0
where kpi , kii , are positive constants standing for the proportional and integral gains
respectively of the PI electric current controller. Replacing u in the first equation and
differentiating once with respect to time, the following is found:
d 2i di did d ∂L(y)
L = −(R + Ap kpi ) + Ap kii (id + x1∗ − i) + Ap kpi − ẏ i .
dt 2 dy dt dt ∂y
(13.25)
Assuming that the steady state has been reached, i.e., that all the variables have
become constant, the latter expression implies:
i = id + x1∗ ,
13.5 Control System Structure 777
because Ap and kii are different from zero. This means that the use of a PI electric
current controller allows the electric current through the electromagnet i to equal the
desired current id + x1∗ , in a steady state. Note that this is achieved without requiring
kpi or kii to be large: the only requirements are kii = 0 and that the current loop
is stable. Thus, the problems due to noise that are present in a proportional current
controller are strongly attenuated by a PI electric current controller.
It is important to state that the use of a PID electric current controller is
not recommended because of the additional noise amplification produced by the
time derivative of the electric current error. Furthermore, in this application, the
additional derivative term does not produce any improvement with respect to what
is achieved with a PI electric current controller. See Sect. 3.8.5 for a discussion on
this point. Thus, a PI electric current controller has been selected.
The electric current id is defined as the output of a PID position controller for
the ball. A block with the gain Ad is included in Fig. 13.7 between the PID position
controller and id . This is because in the electric diagram of Fig. 13.3 an adder is
included, which introduces this gain, performing the operation id + x1∗ . This value
represents the electric current that must flow through the electromagnet to levitate
the ball at the desired position. This means that id = 0 is possible if i = x1∗ in a
steady state. However, as seen later, x1∗ is not exactly known and this motivates the
use of a PID position controller, which achieves i = x1∗ in a steady state, despite the
fact that x1∗ is not exactly known. Finally, between the PID position controller and
the ball position measurement the position sensor gain As is included (see Fig. 13.7).
The block diagram of the complete system that has just been described is shown in
Fig. 13.8a.
Note that z1 = x1 − x1∗ is the signal that is fed back in the current loop of
this block diagram. Hence, the input of the PI electric current controller is z4 =
id + x1∗ − x1 in the block diagram of Fig. 13.8a if the switch SW2 is closed in
Fig. 13.3 or, equivalently, the switch SW2 selects the signal x1∗ in Fig. 13.7. In this
case, the signal −X1∗ (s) on the left of the block diagrams in Fig. 13.8 must not be
considered.
On the other hand, if the switch SW2 is open in Fig. 13.3 or, equivalently, the
switch SW2 selects the signal “0” in Fig. 13.7, then the signal −X1∗ (s) on the left of
the block diagrams in Fig. 13.8 must be considered. This is to render z4 = z5 − z1 =
(id − x1∗ ) − (x1 − x1∗ ) = id − x1 the signal that appears at the input of the PI electric
current controller.
As described above, an external position loop is used in Fig. 13.7, which includes
a PID controller. However, it is important to understand why a PID controller has
been chosen.
As previously stated, the signal U ∗ (s) represents a disturbance (constant in time
as u∗ is constant) in the block diagram of Fig. 13.8a. Hence, a PI electric current
778 13 Control of a Magnetic Levitation System
= 0,
where U ∗ (s) = ds , with d a constant such that u∗ (t) = d. This means that the
deviation in z1 (t), in a steady state, due to the constant disturbance u∗ (t) = d, is
zero for any d = 0. This proves that a PI electric current controller eliminates any
deviation that such a disturbance may produce in a steady state. Thus, the presence
of the disturbance −U ∗ (s) in Fig. 13.8a is ignored in following. This allows the
block diagram in Fig. 13.8b to be obtained.2 The block diagram in Fig. 13.8c is
obtained from Fig. 13.8b after some block algebra. From Figs. 13.8c, d is obtained,
where:
a31 Ap (kpi s + kii )
Gp (s) = − ,
[sL(x2∗ )(s − a11 ) + (kpi s + kii )Ap ](s 2 − a32 ) − a13 a31 L(x2∗ )s 2
(13.26)
or:
a31 Ap (kpi s + kii )
Gp (s) = − , (13.27)
b4 s 4 + b3 s 3 + b2 s 2 + b1 s + b0
b4 = L(x2∗ ),
b3 = −a11 L(x2∗ ) + kpi Ap ,
b2 = kii Ap − a32 L(x2∗ ) − a13 a31 L(x2∗ ),
b1 = a11 a32 L(x2∗ ) − kpi Ap a32 ,
b0 = −kii Ap a32 .
2 IfSW2 is closed in Fig. 13.3 or, equivalently, SW2 selects the signal x1∗ in Fig. 13.7, then the
signal −X1∗ (s) at the left of the block diagrams in Fig. 13.8 must not be considered.
13.5 Control System Structure 779
Finally, an equivalent block diagram is shown in Fig. 13.8e such that the closed-loop
system appears to be negative feedback.
It is not difficult to realize that the characteristic polynomial of Gp (s) has positive
and negative coefficients. This means that Gp (s) is an unstable transfer function and
this is a direct consequence of the fact that the magnetic levitation system is open-
loop unstable. This behavior was intuitively explained in the introduction to this
chapter. To render the closed-loop system stable, the position controller must include
a derivative term. On the other hand, the position controller must also include an
integral term to compose a PID controller with transfer function:
kd s 2 + kp s + k i
.
s
There are two main reasons for choosing a PID controller, which are explained as
follows.
• Achieving a zero steady-state position error when a constant disturbance is
present. As previously explained, when the switch SW2 is closed in Fig. 13.3
or, equivalently, when SW2 selects the signal x1∗ in Fig. 13.7, the signal −X1∗ (s)
on the left in block diagrams of Fig. 13.8 must not be considered.
However, if the switch SW2 is open in Fig. 13.3 or, equivalently, if SW2 selects
the signal “0” in Fig. 13.7, then the signal −X1∗ (s) on the left in the block
diagrams of Fig. 13.8 must be considered. In such a case, −X1∗ (s) represents
a constant disturbance in time, i.e., x1∗ = f is constant. It is important to
stress that a similar disturbance appears even when the switch SW2 is closed
in Fig. 13.3, but x1∗ is not exactly known. This is the case when the ball weight or
the inductance is not exactly known (see (13.15)). The steady-state position error
is studied in the following when a PID controller is employed.
From Fig. 13.8e the following is found:
sGp (s)
Z2 (s) = X∗ (s).
s + As Ad (kd s 2 + kp s + ki )Gp (s) 1
= 0,
where X1∗ (s) = fs . Note that Gp (s) has no poles at s = 0; hence, the factor s
Z2 (s)
at the numerator of X ∗ cannot be cancelled out. This means that the constant
1 (s)
∗
disturbance x1 (t) = f does not produce any steady-state error thanks to the
integral part of the PID position controller.
780 13 Control of a Magnetic Levitation System
• The transfer function Gp (s) has no poles at s = 0. Hence, the system type is 1
only because of the integral part of the controller. This ensures that the position
error is zero in a steady state when constant position references are commanded.
The external position loop, driven by the PID controller, is positive feedback, as
observed in Figs. 13.8a, b, c, and d. This is concluded from the fact that is z2 =
x2 − x2∗ (where x2 = y), instead of x2∗ − x2 , the error used as input for the PID
position controller once it passes through the position sensor (also see Fig. 13.7). As
observed in Fig. 13.8e, this results in the following open-loop transfer function:
kd s 2 + kp s + ki
Ad As Gp (s) ,
s
According to the above discussion, the closed-loop control system has two con-
trollers: a PI electric current controller and a PID position controller. To design the
PID position controller using either the root locus or frequency response methods,
the poles and zeros of Gp (s) need to be known. However, these poles and zeros
depend on kpi and kii , the PI electric current controller gains. Hence, the design of
the PID position controller requires knowledge of the PI electric current controller
gains. However, this task can be simplified using a criterion that is commonly
employed in electromechanical systems, and is described in the following.
In electromechanical systems, it is desirable to design the PI electric current
controller such that the “electrical dynamics is fast enough”. This means that the
electric current through the electromagnet i must reach its desired value id + x1∗
very fast and both must remain close to each other all the time. It was stated above
that this is accomplished in a steady state using a PI electric current controller with
13.6 Controller Design 781
Z 5(s) a 31 Z 2(s)
s2 – a 32
k d s 2+k ps+k i
Ad s
As
+ Z 2(s) – Z 2(s)
0 As k d s 2+k ps+k i
Ad
– a 31
s s 2 – a 32
–
Fig. 13.9 Block diagrams when the electric current loop is fast enough . (a) Z5 (s) = Z1 (s)
because I (s) = Id (s) + X1∗ (s). (b) −a31 > 0
positive values for kpi and kii . However, it is now required now that i = id +x1∗ , even
during the system transient response. The way of achieving this is by using large
positive values for both kpi and kii because, in such a case, (13.26) is simplified to:
a31
Gp (s) = − . (13.28)
s 2 − a32
Thus, the block diagrams in Figs. 13.8d and e become those presented in Fig. 13.9.
Note that the dynamics of the whole magnetic levitation system is reduced to the
mechanical subsystem represented in (13.20) because i = id + x1∗ , i.e., Z5 (s) =
Z1 (s).
Then, if the electric current loop is fast enough, the PID controller can be
designed by only taking into account the mechanical dynamics of the magnetic
levitation system, i.e., using the block diagram in Fig. 13.9b. Recall that the PID
controller transfer function can be written as:
k
k d s 2 + kp s + ki s 2 + kpd s + kkdi
= kd , (13.29)
s s
(s + q1 )(s + q2 ) kp ki
= kd , q1 + q2 = , q1 q2 = .
s kd kd
where q1 , q2 and kd are some positive constants that have to be computed during
the design stage. Once these values are known, kp and ki can be obtained using
the expressions in (13.29). Note that, according to (13.29), the open-loop transfer
function in Fig. 13.9b is:
782 13 Control of a Magnetic Levitation System
−a31 kd Ad As (s + q1 )(s + q2 )
G(s)H (s) = . (13.30)
s(s 2 − a32 )
The root locus diagram corresponding to the block diagram in Fig. 13.9b is
presented in Fig. 13.10. The location of −q1 and −q2 in Fig. 13.10 are proposed
to pull the root locus diagram into the left half-plane, i.e., to render the closed-loop
system stable. We stress that kd is the gain to be adjusted from 0 to +∞ to select
the desired closed-loop poles belonging to the root locus (thick lines) in Fig. 13.10.
Consider the case when the desired position is x2∗ = yd = 0.006[m]. Using
this, (13.14), (13.15), (13.16), the expressions in (13.18), the numerical values in
Sect. 13.4, and Ad = 4.7 (see the operation amplifier labeled T 1 in Fig. 13.3), the
following is found:
−a31 5911
Ad As = 2 ,
s 2 − a32 s − 1752
If kd = 0.0277 is chosen, the closed-loop poles and zeros are located at:
√
– a32
–q1 –q2 √
a32
Fig. 13.10 Root locus diagram for the block diagram in Fig. 13.9b
13.6 Controller Design 783
and, using (13.29), (13.32), the following controller gains are found:
If kd = 0.0277 × 0.8 = 0.0222 is chosen, the closed-loop poles and zeros are
located at:
and, using (13.29), (13.32), the following controller gains are found:
Finally, if kd = 0.0277 × 1.2 = 0.0333 is chosen, the closed-loop poles and zeros
are located at:
and, using (13.29), (13.32), the following controller gains are found:
In Fig. 13.11 the time response when z1 (0) = 0, z2 (0) = 1, z3 (0) = 0 is presented
and the controller gains in (13.34), (13.36), (13.38) are used. These simulations
have been performed by executing the following MATLAB code several times in an
m-file:
clc;
clear all;
factor=0.7*0.0396*1.2;%1, 0.8 ,1.2
q1=29.9355;
q2=1.3045;
nume=conv([1 q1],[1 q2]);
PID=tf(factor*nume,[1 0]);
g=tf(5911,[1 0 -1752]);
gh=g*PID;
M=feedback(gh,1,-1);
dn1=pole(M);
zero(M);
784 13 Control of a Magnetic Levitation System
0.8
0.6
Amplitude
0.4
0.2
−0.2
−0.4
−0.6
Fig. 13.11 Plot of z2 (t) when z1 (0) = 0, z2 (0) = 1, z3 (0) = 0. Continuous: controller gains
in (13.38). Dashed: controller gains in (13.34). Dotted line: controller gains in (13.36)
It is observed that the position error converges to zero as time increases in all the
cases, i.e., z2 (t) → 0 as t → ∞, which is possible because the closed-loop system
is stable and because we are using a position controller with an integral part, i.e., a
PID position controller.
13.6 Controller Design 785
Also note, in Fig. 13.11, that a considerable overshoot exists in the position error
z2 (t) in all three cases. This overshoot is larger for the controller gains in (13.36)
and smaller for the controller gains in (13.38). Note, however, that according
to (13.33), (13.35), (13.37), all the closed-loop poles are real in all three cases;
hence, they should not produce any overshoot. The explanation for this phenomenon
is presented in Example 8.5, Chap. 8, in the present book and it follows the ideas
exposed in section 8.6.5 of [16]:
From (13.31), it is observed that there is an open-loop unstable pole located at
√
s = a32 = 41.8569. The magnitude of this pole is much greater than that of
the slowest (stable) closed-loop poles in (13.33), (13.35), (13.37). According to
Sect. 8.1.2, in the present book, and section 8.6.5 in [16], the direct consequence
of these facts is the overshoot observed in Fig. 13.11 and this does not require the
existence of any complex conjugate closed-loop poles. Moreover, we also realize
from (13.33), (13.35), (13.37), that the two slowest closed-loop poles approach
the closed-loop zeros located at s = −29.9355, s = −1.3045 as kd increases.
This means that the effects of such slowest poles is less important in the response
of z2 (t) as kd increases, i.e., this response tends to be dominated by the third
√
closed-loop pole, which is located at the left of s = − a32 = −41.8569
(see (13.33), (13.35), (13.37)). As the magnitude of this pole is larger than that
√
of the unstable open-loop pole at s = a32 = 41.8569, the overshoot decreases in
Fig. 13.11 as kd increases.
The above discussion suggests that choosing a large kd might be a good design
criterion. However, it is explained in Sect. 13.6.3 that a large value for kd may result
in instability because the closed-loop poles representing the electrical dynamics
are pushed into the right half-plane as kd increases. It is shown in Sect. 13.6.3
that a good performance is found in experiments when using the controller gains
in (13.34).
According to the previous sections, the gains for the PI electric current controller
have to be chosen to be large. However, these controller gains cannot be chosen to
be too large in practice because this would amplify noise, which would result in a
poor closed-loop performance. Hence, the PI electric current controller gains must
be selected as the largest gains that do not cause performance to deteriorate. Thus,
the selection of this controller gains can only be achieved through experimental
essays. The following criterion is suggested:
“Choose kpi and kii as the largest positive values that do not introduce
important vibrations as a consequence of noise amplification. For this reason, it
is recommended to choose kii larger than kpi ”.
The controller gains that have been tested experimentally are presented in
Table 13.1. The PI electric current controller is implemented using the TL082
operational amplifier placed before the TL081 operational amplifier used as a
786 13 Control of a Magnetic Levitation System
comparator (see Fig. 13.3). At the input of that operational amplifier there is a
1[KΩ] resistance and there are a series resistance and capacitor at the feedback
path. Thus, according to Table 9.1, a PI controller is correctly implemented with
gains computed as:
R 1
kpi = , kii = , (13.39)
1000 1000C
where R, C are the resistance (in Ohms) and the capacitance (in farads) at the
feedback path. The corresponding circuit component values used to implement the
controller gains for each case are also presented in Table 13.1.
On the other hand, recall that the PID position controller is implemented using
the operational amplifier placed between points A and B in Fig. 13.3. According to
Table 9.1, the gains of this controller are given as:
R2 C1 1
kpa = + , kda = R2 C1 , kia = (13.40)
R1 C2 R1 C 2
Moreover, in Sect. 13.3.3 it was explained that the 10[KOhm] resistances connected
to the point VP 1 introduce a 1/2 constant gain. As this gain must be considered a
part of the controller we conclude that:
As indicated in both Tables 13.1 and 13.2, the experimental essays were
performed setting yd = x2∗ = 0.006[m] as the desired position for the ball. This
desired position was set by using the switch SW1 in Fig. 13.3 to select yv∗ = 0.6[V].
Also, in all experiments, the switch SW2 was kept open in Fig. 13.3.
It was observed experimentally that the best performance is obtained when kii =
10000 is used, i.e., the ball levitates at the desired position and any vibration due to
noise is not present. Thus:
were selected as the correct values for the PI electric current controller gains. This
is why a 4.7[KΩ] resistance and a 0.1[μF] capacitance are included in Fig. 13.3
at the feedback path of the TL082 operational amplifier, which implements the PI
electric current controller (that located before the TL081 operational amplifier used
as a comparator).
Once the controller gains in (13.42) are fixed, it must be verified that the
base frequency of the PWM power amplifier is correctly selected. Using x2∗ =
0.006[m], (13.14), (13.15), (13.16), the expressions in (13.18), the numerical values
given in (13.42), and Sect. 13.4, in addition to Ad = 4.7 (see the operational
amplifier labeled T 1 in Fig. 13.3), it is found that the internal-most loop in
Fig. 13.8c, represented by the transfer function:
Ap (kpi s + kii )
L(x2∗ )s 2 + (−a11 L(x2∗ ) + Ap kpi )s + Ap kii
0.8
0.6
0.4
Amplitude
0.2
−0.2
−0.4
−0.6
Fig. 13.12 Plot of z2 (t) when z1 (0) = 0, z2 (0) = 1, z3 (0) = 0, and zero initial conditions for
both integral parts of the controllers
is presented in Fig. 13.12. This was performed according to the block diagram in
Fig. 13.8e, i.e., using the open-loop transfer function:
kd s 2 + kp s + ki
Ad As Gp (s)
s
with Gp (s) given in (13.26), setting x2∗ = 0.006[m] and the controller gains given
in (13.42) and Table 13.2. The simulation in Fig. 13.12 was executed using the
following MATLAB code in an m-file:
clc;
clear all;
%%%%%% data %%%%%%
k0=36.3e-3; % Hy
k=3.5e-3; % Hy
a=5.2e-3; % m
Ap=1; % Power amplifier
As=100; % V/m, Position sensor
Ad=4.7; %
m=0.018; % Kg, Ball mass
g=9.81; %m/s^2, gravity acceleration
Ra=2.72; % Winding resistance
13.6 Controller Design 789
0;
0;
0;
1];
nume1r=conv(nume,[kpi kii]);
cc=-factor*nume1r*Ad*As*Ap*a31;
C=[cc(4) cc(3) cc(2) cc(1) 0];
estado=ss(A,B,C,0);
figure(1)
initial(estado,[1/cc(4) 0 0 0 0],2)
axis([-0.1 2 -0.7 1.2])
grid on
Note that the results in Fig. 13.12 are almost identical to those shown in Fig. 13.11.
The only difference is constituted by some high-frequency oscillations present in
Fig. 13.12, which must be produced by the fast electric dynamics that has been
neglected in Fig. 13.11. As a matter of fact, in Fig. 13.13 we present the root locus
diagram corresponding to the block diagram in Fig. 13.8e. In Fig. 13.13a a zoom-
in is presented around the origin, which is very similar to the root locus diagram
sketched in Fig. 13.10, i.e., when the electric dynamics is neglected. In Fig. 13.13b a
zoom-out of the same root locus diagram is presented where it is possible to see two
horizontal branches that are due to the fast electric dynamics. These branches place
two closed-loop complex conjugate poles at about s = −19 ± 500j . These poles
are high-frequency and they are not very well damped. Thus, they are responsible
for the high-frequency oscillations observed in Fig. 13.12.
Some experimental results are presented in Fig. 13.14 when step changes are
applied from yd = z2∗ = 0.006[m] to yd = z2∗ = 0.008[m] and vice versa.
The controller gains in (13.42) and Table 13.2 are employed. The following
features, which have already been predicted by the simulations and explained using
theoretical arguments, are observed. A zero steady-state error is obtained, a large
overshoot of about 50% is present, high-frequency oscillations are present when a
step change is applied from yd = z2∗ = 0.008[m] to yd = z2∗ = 0.006[m]. Also
note that the peak and the settling times in Fig. 13.14 are very similar to those in
Figs. 13.11 and 13.12. The reason why high-frequency oscillations are not present
when a step change is applied from yd = z2∗ = 0.006[m] to yd = z2∗ = 0.008[m] is
that the plant model is nonlinear; hence, it behaves differently when z2∗ is different.
In the following section, we present further details on this topic.
In all the experiments presented in the following, the switch SW2 was kept open
in Fig. 13.3. The experimental tests in the previous section were performed using a
controller designed for yd = x2∗ = 0.006[m]. Additional experimental tests were
13.6 Controller Design 791
Root Locus
10
6
Imaginary Axis (seconds−1)
−2
−4
−6
−8
−10
−60 −40 −20 0 20 40
−1
Real Axis (seconds )
Root Locus
600
400
Imaginary Axis (seconds−1)
200
−200
−400
−600
Fig. 13.13 Root locus diagram corresponding to the block diagram in Fig. 13.8e . (a) Zoom-in.
(b) Zoom-out
792 13 Control of a Magnetic Levitation System
Fig. 13.14 Experimental results when step changes are applied from yd = z2∗ = 0.006[m] to
yd = z2∗ = 0.008[m] and vice versa. Top line x2v = yv , bottom line x2v
∗ = y∗
v
performed adjusting SW1, in Fig. 13.3, to select the desired position yd = x2∗ =
0.002[m], i.e., yv∗ = 0.2[V]. However, it was observed in experiments that, under
this condition, the ball cannot levitate when using the controller gains in (13.42) and
Table 13.2.
Trying to understand what happens, we used yd = x2∗ = 0.002[m], the
controller gains in Table 13.2, (13.14), (13.15), (13.16), the expressions in (13.18),
the numerical values in Sect. 13.4, Ad = 4.7 and the system equations when the
electric dynamics is neglected, i.e., the block diagrams in Fig. 13.9, to find that the
closed-loop poles and zeros are located at:
This means that the closed-loop system is still stable when neglecting the
electrical dynamics. Thus, instability may be produced by the electrical dynamics.
To verify this, in Figs. 13.15a, b, and c the root locus diagrams for the internal-most
loop and the middle internal loop in Fig. 13.8c, and for the loop shown in Fig. 13.8e,
are presented respectively. As is well known, each of these root locus diagrams is
drawn based on the open-loop poles and zeros in the respective loop. We also stress
that each one of these root locus diagrams takes into account, as open-loop poles
and/or open-loop zeros, the closed-loop poles and closed-loop zeros that result from
the root locus diagram corresponding to the previous internal loop. This is the reason
why the poles at s1 and s2 appear in both Figs. 13.15a and b, for instance.
13.6 Controller Design 793
s2
s5
s1
s3 s4
√ √
– a 32 a 32
s2
s6
s5
s3 s4
k – q1 – q2 σa
– kiipi
s6
kd s 2 + kp s + ki
Ad As Gp (s) (13.44)
s
has poles located at:
±180◦ (2q + 1)
asymptote angle = , q = 0, 1, 2, . . .
n−m
and:
s9 + s5 + s6 + s4 + s3 − (− kkpiii + s7 + s8 )
σa = ,
2
it is found that the root locus diagram in Fig. 13.15c has two asymptotes at ±90◦
with respect to the positive real axis, that cross the real axis at:
σa = 983.9.
This proves that the root locus branches starting at s5 and s6 in Fig. 13.15c end
at the asymptotes that we have just found on the right half-plane. Note that such
branches do not exist when the electrical dynamics is not taken into account, i.e.,
in Fig. 13.10. Hence, this could be the reason for the instability observed in the
experiment described above.
However, the reader can perform the corresponding computations to verify that
the asymptotes on the right half-plane also exist when yd = x2∗ = 0.006[m]. Hence,
we may wonder why instability is not observed experimentally when using the
controller gains in (13.42) and Table 13.2, together with yd = x2∗ = 0.006[m]. The
answer to this question arises from the gain of Gp (s), which, according to (13.26),
directly depends on −a31 . We can see from (13.18) that −a31 > 0 is proportional to
∂L(x ∗ )
− ∂x22 > 0, which, according to Fig. 13.2 increases as x2∗ decreases. As a matter
of fact, using numerical values, we find that −a31 = 9.2663 for x2∗ = 0.01[m],
−a31 = 12.5757 for x2∗ = 0.006[m] and −a31 = 19.5621 for x2∗ = 0.002[m]. Thus,
a larger loop gain −a31 pushes the branches starting at s5 and s6 in Fig. 13.15c into
the right half-plane if the same PID position controller gains are used.
13.6 Controller Design 795
Moreover, we encourage the reader to verify that the use of these controller gains
ensures the stability of the closed-loop system shown in Fig. 13.8e, with Gp (s) given
in (13.27), when considering the controller gains in (13.42), i.e., when the electrical
dynamics is taken into account. Note that the ratio between the different values
of −a31 is 12.5757/9.2663 = 1.3571, which is approximately equal to the ratio
between the different values of kd , 0.0396/0.02772 = 1.4286, when yd = x2∗ passes
from 0.01[m] to 0.006[m].
Similarly, the ratio between the different values of −a31 is 12.5757/19.5621 =
0.6429, which is approximately equal to the ratio between the different values of kd ,
0.01584/0.02772 = 0.5714 when yd = x2∗ passes from 0.006[m] to 0.002[m].
A good performance has been observed in experiments when using the controller
gains in (13.45), (13.46), the corresponding values for yd and the PI electric current
controller gains in (13.42). It is interesting to say that the ball cannot levitate in
experiments when the controller gains in (13.45) are used and the desired position
is set at yd = x2∗ = 0.002[m]. However, the opposite situation does perform well,
i.e., when the controller gains in (13.46) are used and the desired position is set
at yd = x2∗ = 0.01[m] the closed-loop system has a good performance: the ball
levitates without any problems.
Based on the above discussion, we recommend being careful when trying to
neglect some part of the closed-loop dynamics, as instability may appear in some
cases. This fact has been pointed out by some authors in the control theory literature
[14, 15].
In Table 13.3 we present the PID position controller gains used in the above
experiments in addition to the corresponding circuit component values used to
implement such controller gains. These circuit component values were computed
using (13.40) and (13.41).
In Fig. 13.16, the experimental results are presented when a step change in the
desired position is commanded from yd = x2∗ = 0.002[m] to yd = x2∗ = 0.006[m]
and the controller gains in (13.42) and (13.46) are used. It is observed that the ball
position yv reaches its desired value yv∗ in a steady state. Moreover, it is clear that
this affirmation is true after and before the step change on the desired position is
commanded.
The experimental results in Fig. 13.17 were obtained when a step change in the
desired position is commanded from yd = x2∗ = 0.006[m] to yd = x2∗ = 0.01[m]
796 13 Control of a Magnetic Levitation System
Table 13.3 Numerical values tested experimentally for the PID position controller
PID gains Circuit component values
R1 = 330[KΩ]
yd = x2∗ = 0.01[m] kd = 0.0396
R2 = 800[KΩ]
kp = 1.2371
C1 = 0.1[μF]
ki = 1.5464
C2 = 1[μF]
R1 = 470[KΩ]
yd = x2∗ = 0.006[m] kd = 0.02772
R2 = 800[KΩ]
kp = 0.866
C1 = 0.07[μF]
ki = 1.082
C2 = 1[μF]
R1 = 800[KΩ]
yd = x2∗ = 0.002[m] kd = 0.01584
R2 = 800[KΩ]
kp = 0.4948
C1 = 0.04[μF]
ki = 0.6186
C2 = 1[μF]
and the controller gains in (13.42) and Table 13.2 are used. It is observed again that
the ball position yv reaches its desired value yv∗ in a steady state and this affirmation
is true after and before the step change on the desired position is commanded.
In both Figs. 13.16 and 13.17 a similar phenomenon is observed to that appearing
in Fig. 13.11: a large overshoot of about 100% is present in Fig. 13.16 and about 50%
in Fig. 13.17. This phenomenon is explained again using the arguments in Sect. 8.1.2
(see also the explanation for Fig. 13.11).
If the reader is trying to compare the time responses in Figs. 13.16 and 13.17,
note that different time scales are used in these figures. In Fig. 13.18 a picture of
the magnetic levitation system that has been built and used in the experiments is
presented.
Recall that the closed-loop system performs well when the controller gains
in (13.46), (13.42) are used at yd = x2∗ = 0.002[m]. In Fig. 13.19, the electric
current through the power transistor TIP 141 is shown, i.e., through the 1[Ω],
5[W], resistance in Fig. 13.3, obtained when using these controller gains at this
desired position. The PWM waveform of this electric current is clearly observed.
In Fig. 13.20 is shown the electric current waveform obtained when kii = 105 is set
and all the other controller gains remain the same as in (13.46), (13.42). Note that
this electric current has no clear PWM waveform. Furthermore, this also happens
when kii = 106 is used and in Fig. 13.21 the waveform of this electric current in
this case is shown. The reason for this behavior is explained in the following.
The block diagram in Fig. 13.22a represents the section of Fig. 13.3 correspond-
ing to the internal electric current loop and the PWM power amplifier. The symbol
13.6 Controller Design 797
Fig. 13.16 A step change in the desired position is commanded from yd = x2∗ = 0.002[m] (yv∗ =
0.2[V]) to yd = x2∗ = 0.006[m] (yv∗ = 0.6[V]). Top line x2v = yv , bottom line x2v
∗ = y∗
v
Fig. 13.17 A step change in the desired position is commanded from yd = x2∗ = 0.006[m] (yv∗ =
0.6[V]) to yd = x2∗ = 0.01[m] (yv∗ = 1.0[V]) Top line x2v = yv , bottom line x2v
∗ = y∗
v
A0 stands for the open-loop gain of the operational amplifier used as a comparator
in the PWM power amplifier. From this block diagram we obtain the block diagram
in Fig. 13.22b, which allows us to quantify the effect of the triangular wave Vt (s) on
the electric current through the power transistor It (s). To obtain the block diagram
in Fig. 13.22b it is assumed that Id (s) = 0 in Fig. 13.22a (superposition). It is not
798 13 Control of a Magnetic Levitation System
Fig. 13.18 The magnetic levitation system that has been built
Fig. 13.19 Waveform of the electric current flowing through the power transistor TIP 141 when
kii = 10000
Fig. 13.20 Waveform of the electric current flowing through the power transistor TIP 141 when
kii = 105
Fig. 13.21 Waveform of the electric current flowing through the power transistor TIP 141 when
kii = 106
s 1 s
It (s) = − Vt (s) = − Vt (s). (13.47)
kpi s + kii kpi s + kii
kpi
Thus, It (s) is obtained from Vt (s) through a first-order, high-pass filter with corner
frequency at kkpiii and k1pi as the high-frequency gain. Using the controller gains
in (13.42), it is found that the corner frequency is 2127.7[rad/s]. Hence, as the
800 13 Control of a Magnetic Levitation System
V t(s) I t(s)
A0
The design using the frequency response is also performed based on the assumption
that the electric subsystem dynamics is rendered fast enough using a suitable PI
controller. Hence, the block diagrams in Fig. 13.9 and the expressions in (13.29)
and (13.30) are also considered in the present section. Recall that s 2 − a32 = (s −
13.6 Controller Design 801
Bode Diagram
−10
−15 System: ivt
Frequency (rad/s): 9.55e+03
−20
Magnitude (dB)
225
System: ivt
Frequency (rad/s): 9.55e+03
Phase (deg): 193
180
102 103 104 105
Frequency (rad/s)
Fig. 13.23 Bode diagrams of the transfer function in (13.47) when kpi = 4.7 and kii = 10000
√ √
a32 )(s + a32 ), as a32 > 0. Thus, one approach to controller design is to choose:
√
q1 = a32 , (13.48)
−a31 kd Ad As (s + q2 )
G(s)H (s) = √ .
s(s − a32 )
Hence:
−a31 Ad As
G(s)H (s) = kd q2 (z + 1) √ . (13.49)
s(s − a32 )
802 13 Control of a Magnetic Levitation System
Bode Diagram
−10
System: ivt
−15 Frequency (rad/s): 9.61e+03
−20 Magnitude (dB): −21.2
Magnitude (dB)
−25
−30
−35
−40
−45
−50
270
Phase (deg)
System: ivt
Frequency (rad/s): 9.69e+03
225 Phase (deg): 246
180
103 104 105 106
Frequency (rad/s)
Fig. 13.24 Bode diagrams of the transfer function in (13.47) when kpi = 4.7 and kii = 105
−a31√
Ad As
In the following, it is assumed that kd q2 (z+1) is the “controller” and s(s− a32 )
is the
“plant to be controlled.” The polar plot for the transfer function in (13.49) is almost
identical to the polar plot in Fig. 6.102. The only difference is that, in the present
case, the polar plot reaches the origin parallel to the negative imaginary axis. This
is because the electric dynamics is not taken into account in this section. In the case
in which the polar plot has the form shown in Fig. 6.102, then closed-loop stability
is ensured. Thus, in what follows, the crossover frequency and the phase margin are
proposed such that the shape shown in Fig. 6.102 is ensured.
Using x2∗ = 0.006[m] to find the numerical values for a31 and a32 in addition
−a31√
Ad As
to As = 100, Ad = 4.7, the Bode diagrams for s(s− a32 )
, which are presented
in Fig. 13.26, can be plotted. Setting ω1 = 71.5[rad/s] as the desired crossover
frequency and 40◦ as the desired phase margin, it is found that 70◦ is the phase lead
that has to be contributed by the “controller” kd q2 (z+1) when ω = ω1 . In Fig. 13.27
the Bode diagrams for the factor z + 1 are presented, which is the only component
of the “controller” that can contribute some phase lead. There, it is found that the
desired 70◦ phase lead is produced when:
ω
= 2.76,
q2
13.6 Controller Design 803
Bode Diagram
−10
−15
−20
Magnitude (dB)
−25
−30
−35
−40
System: ivt
−45 Frequency (rad/s): 9.67e+03
Magnitude (dB): −40.3
−50
270
System: ivt
Frequency (rad/s): 9.62e+03
Phase (deg): 267
Phase (deg)
225
180
104 105 106 107 108
Frequency (rad/s)
Fig. 13.25 Bode diagrams of the transfer function in (13.47) when kpi = 4.7 and kii = 106
and that 9.35[dB] is the magnitude of |z + 1|dB at that frequency. Hence, replacing
ω = ω1 = 71.5[rad/s] in the previous expression, the following is found:
ω 71.5
q2 = = = 25.9058. (13.50)
2.76 2.76
On the other hand, to fix the crossover frequency at ω1 = 71.5[rad/s], the
magnitude of the transfer function in (13.49) is required to be equal to 0[dB] when
−a31√
Ad As
ω = ω1 . As the magnitude of s(s− a32 )
is 0[dB] when ω = ω1 (see Fig. 13.26), this
means that:
1 −9.35
kd = 10 20 = 0.01309.
q2
804 13 Control of a Magnetic Levitation System
Bode Diagram
50
Magnitude (dB)
System: gh
Frequency (rad/s): 71.4
Magnitude (dB): −0.0179
0
−50
−180
Phase (deg)
System: gh
−225 Frequency (rad/s): 71.5
Phase (deg): −210
−270
100 101 102 103
Frequency (rad/s)
−a31√
Fig. 13.26 Bode diagrams for Ad As
s(s− a32 )
, using x2∗ = 0.006[m], As = 100 and Ad = 4.7
Using this value, (13.29), (13.50) and (13.48), to find q1 = 41.8543, the following
is obtained:
kp = 0.8873, ki = 14.2.
The Bode diagrams of the transfer function in (13.30) are presented in Fig. 13.28
when q1 = 41.8543, q2 = 25.9058, kd = 0.01309 are used. Note that a ω1 =
71.5[rad/s] crossover frequency and a 40◦ phase margin have been obtained. The
corresponding time response is presented in Fig. 13.29 when z1 (0) = 0, z2 (0) = 1,
z3 (0) = 0 and a zero initial condition is used for the integral part of the PID position
controller. Note that a large overshoot of about 75% is present. This overshoot
is related to the large resonance peak that can be observed in Fig. 13.30 where
the corresponding Bode diagrams of the closed-loop system are presented. The
obvious solution to reducing such an overshoot is significantly increasing the phase
margin, i.e., let us propose a 70◦ phase margin. However, note, from Fig. 13.26,
that keeping ω1 = 71.5[rad/s] as the desired crossover frequency would require the
“controller” to contribute a 100◦ phase lead, which is not possible, as is clear from
Fig. 13.27. Carefully observing Fig. 13.26 it is concluded that a 70◦ phase margin
13.6 Controller Design 805
Bode Diagram
40
35
30
Magnitude (dB)
25
20
System: gd
15 Frequency (rad/s): 2.76
Magnitude (dB): 9.35
10
5
0
90
System: gd
Phase (deg)
0
10−2 10−1 100 101 102
Frequency (rad/s)
and that 29.1[dB] is the magnitude of |z + 1|dB at that frequency. Hence, replacing
ω = ω1 = 130[rad/s] in the previous expression:
806 13 Control of a Magnetic Levitation System
Bode Diagram
40
30
20
Magnitude (dB)
System: gh
10 Frequency (rad/s): 71
Magnitude (dB): −0.00517
0
−10
−20
−30
−40
−90
−135
Phase (deg)
System: gh
Frequency (rad/s): 71.6
−180 Phase (deg): −140
−225
−270
100 101 102 103
Frequency (rad/s)
Fig. 13.28 Bode diagrams for G(s)H (s) in (13.30) when q1 = 41.8543, q2 = 25.9058, kd =
0.01309
ω 130
q2 = = = 4.4828. (13.52)
28.6 28.6
On the other hand, to fix the crossover frequency at ω1 = 130[rad/s], it is
necessary for the magnitude of the transfer function in (13.49) to be equal to 0[dB]
−a31√
Ad As
when ω = ω1 . As the magnitude of s(s− a32 )
is −9.61[dB] when ω = ω1 (see
Fig. 13.31), this means that:
1 (9.61−29.1)
kd = 10 20 = 0.02293.
q2
Using this value, (13.29), (13.52) and (13.48), to find q1 = 41.8543, yields:
kp = 1.063, ki = 4.303.
13.6 Controller Design 807
0.8
0.6
Amplitude
0.4
0.2
−0.2
−0.4
−0.6
−0.8
0 0.5 1 1.5 2 2.5 3
Time (seconds)
Fig. 13.29 Closed-loop time response of system in Fig. 13.9 (simulation). Continuous line: kd =
0.01309, kp = 0.8873, ki = 14.2. Dashed: kd = 0.02293, kp = 1.063, ki = 4.303. Line-dot:
kd = 0.02259,kp = 1.09, ki = 1.068
Bode diagrams of the transfer function in (13.30) are presented in Fig. 13.33
when q1 = 41.8543, q2 = 4.4828, kd = 0.02293 are used. Note that a ω1 =
130[rad/s] crossover frequency and a 70◦ phase margin have been obtained. The
corresponding time response is presented in Fig. 13.29 when z1 (0) = 0, z2 (0) =
1, z3 (0) = 0 and a zero initial condition is used for the integral part of the PID
position controller. It is observed that the overshoot has decreased to about 40%.
This overshoot is related to the smaller resonance peak observed in Fig. 13.30 where
the corresponding Bode diagrams of the closed-loop system are presented.
Although the overshoot has been significantly improved, it was found in experi-
ments (see Sect. 13.6.6) that the ball describes fast oscillations when commanding
step changes in the desired position. Hence, the main objective is now to design
a controller that can attenuate such oscillations. As the observed oscillations are
fast, we try to slow them down by increasing the effect of low frequencies. In the
previous designs q1 has been computed using (13.48). This, however, has resulted
in values for q2 that are larger than 4.4828 and even larger values for q1 . The reader
can verify that q1 and q2 fix the location of the low-frequency zeros of the closed-
loop transfer function. Hence, as we want to increase the effect of low frequencies
on the closed-loop transfer function we need a value for q1 or q2 that is smaller
than 4.4828. With this aim q1 is no longer computed as in (13.48), but, instead, the
following is proposed:
808 13 Control of a Magnetic Levitation System
Bode Diagram
10
0
Magnitude (dB)
−10
−20
−30
−40
45
Phase (deg)
−45
−90
10−1 100 101 102 103 104
Frequency (rad/s)
Fig. 13.30 Bode diagrams of the closed-loop system in Fig. 13.9. Continuous line: kd = 0.01309,
kp = 0.8873, ki = 14.2. Dashed: kd = 0.02293, kp = 1.063, ki = 4.303. Line-dot: kd =
0.02259,kp = 1.09, ki = 1.068
q1 = 1
whereas q2 is a result of the design method. In this case, the factor (s + q1 ) does
√ √
not cancel with any of factors (s − a32 ) or (s + a32 ) and, because of that, the
open-loop transfer function in (13.30) converts into:
−a31 Ad As (s + 1)
G(s)H (s) = kd q2 (z + 1) . (13.54)
s(s 2 − a32 )
Bode Diagram
50
Magnitude (dB)
System: gh
0 Frequency (rad/s): 130
Magnitude (dB): −9.61
−50
−180
System: gh
Phase (deg)
−270
100 101 102 103
Frequency (rad/s)
−a31√
Fig. 13.31 Bode diagrams for Ad As
s(s− a32 )
, using x2∗ = 0.006[m], As = 100 and Ad = 4.7
and that 9.37[dB] is the magnitude of |z + 1|dB at that frequency. Hence, replacing
ω = ω1 = 130[rad/s] in the previous expression:
ω 130
q2 = = = 47.2727. (13.55)
2.76 2.76
On the other hand, to fix the crossover frequency at ω1 = 130[rad/s], it is
necessary for the magnitude of the transfer function in (13.54) to be equal to 0[dB]
when ω = ω1 . As the magnitude of −a31 Ad As (s+1)
s(s 2 −a32 )
is −9.94[dB] when ω = ω1 (see
Fig. 13.34), this means that:
810 13 Control of a Magnetic Levitation System
Bode Diagram
40
System: gd
35 Frequency (rad/s): 28.6
Magnitude (dB): 29.1
30
Magnitude (dB)
25
20
15
10
5 System: gd
Frequency (rad/s): 28.5
0 Phase (deg): 88
90
Phase (deg)
45
0
10−2 10−1 100 101 102
Frequency (rad/s)
1 (9.94−9.37)
kd = 10 20 = 0.02259.
q2
kp = 1.09, ki = 1.068.
Bode diagrams of the transfer function in (13.54) are presented in Fig. 13.36,
when q1 = 1, q2 = 47.2727, kd = 0.02259 are used. Note that a ω1 = 130[rad/s]
crossover frequency and a 70◦ phase margin have been obtained. The corresponding
time response is presented in Fig. 13.29, when z1 (0) = 0, z2 (0) = 1, z3 (0) = 0, and
a zero initial condition is used for the integral part of the PID position controller.
Note that the overshoot is kept at about 40%. Consider Fig. 13.30, where the
corresponding Bode diagram of the closed-loop system is presented. Note that
although the high-frequency part of the resonance peak remains the same as in the
13.6 Controller Design 811
Bode Diagram
60
50
40
Magnitude (dB)
30
20
System: gh
10 Frequency (rad/s): 130
Magnitude (dB): −0.07
0
−10
−20
−90
System: gh
−135 Frequency (rad/s): 130
Phase (deg)
−180
−225
−270
10−1 100 101 102 103
Frequency (rad/s)
Fig. 13.33 Bode diagrams for G(s)H (s) in (13.30) when q1 = 41.8543, q2 = 4.4828, kd =
0.02293 are used
previous design, the low-frequency part of the resonance peak has grown. Hence,
these Bode diagrams explain why the corresponding time response in Fig. 13.29 has
the same rise time but a larger settling time.
In all the experiments presented in the following, the switch SW2 was kept open
in Fig. 13.3. In this section, some experimental results are obtained when testing
the PID position controller gains computed in the previous section, which are
now shown in Table 13.4. The circuit component values used to implement the
corresponding controller gains are also presented in this table. The resistances
R1 = 300[KΩ] and R1 = 350[KΩ] were constructed as the series connection
of three 100[KΩ] resistances and the series connection of one 330[KΩ] and one
22[KΩ] resistances respectively. Eight 0.01[μF] and four 0.1[μF] capacitors were
connected in parallel to obtain C1 = 0.08[μF] and C2 = 0.4[μF] respectively.
Finally, C2 = 1.5[μF] was implemented as the parallel connection of one 1[μF]
and five 0.1[μF] capacitors. The PI electric current controller gains were selected as
812 13 Control of a Magnetic Levitation System
Bode Diagram
100
Magnitude (dB)
50
System: gh
Frequency (rad/s): 130
Magnitude (dB): −9.94
0
−50
−180
System: gh
Frequency (rad/s): 130
Phase (deg): −180
Phase (deg)
−225
−270
10−2 10−1 100 101 102 103
Frequency (rad/s)
−a31 Ad As (s+1)
Fig. 13.34 Bode diagrams for s(s 2 −a32 )
, using x2∗ = 0.006[m], As = 100 and Ad = 4.7
those presented in (13.42), which are rewritten here for ease of reference:
When testing the controller gains in Table 13.4a) experimentally, it was found
that the ball cannot levitate, i.e., the ball cannot stay at the desired position yd =
z2∗ = 0.006[m]. The reader can plot the corresponding polar diagram when taking
into account the electric dynamics and the gains kpi = 4.7, kii = 10000 to verify
that the closed-loop system is stable from the theoretical point of view. Hence, the
problem is that controller gains in Table 13.4a) do not achieve a good performance
in practice. Recall that these controller gains were found to produce a very large
overshoot in the previous section. During the theoretical design stage, this feature
warned us that a bad performance may be obtained in practice and this has motivated
us to look for better designs. Thus, the controller gains in Table 13.4b) and c) were
computed and they are tested experimentally in the following.
In Fig. 13.37 the time response obtained experimentally is presented when step
changes are applied from yd = z2∗ = 0.006[m] to yd = z2∗ = 0.008[m]
and vice versa. The PID position controller gains are those in Table 13.4b). It is
observed that the desired position is reached in a steady state. Also note the high-
13.6 Controller Design 813
Bode Diagram
40
35
30
Magnitude (dB)
25
20
System: gd
15 Frequency (rad/s): 2.76
Magnitude (dB): 9.37
10
5
0
90
System: gd
Phase (deg)
0
10−2 10−1 100 101 102
Frequency (rad/s)
Bode Diagram
60
50
40
Magnitude (dB)
30
20
System: gh
10 Frequency (rad/s): 130
Magnitude (dB): −0.0711
0
−10
−20
−90
System: gh
−135 Frequency (rad/s): 130
Phase (deg)
−180
−225
−270
10−2 10−1 100 101 102 103
Frequency (rad/s)
Fig. 13.36 Bode diagrams for G(s)H (s) in (13.54) when q1 = 1, q2 = 47.2727, kd = 0.02259
are used
frequency oscillations are evident, they are much more attenuated than oscillations
in Fig. 13.37. This corroborates the correctness of the ideas that have guided us in
the previous section to perform this design. Finally, it is clear that the settling time
13.6 Controller Design 815
Fig. 13.37 Experimental results when step changes are commanded from yd = z2∗ = 0.006[m] to
yd = z2∗ = 0.008[m] and vice versa. Top line x2v = yv , bottom line x2v
∗ = y ∗ . Controller gains in
v
Table 13.4b)
0.8
0.6
0.4
Amplitude
0.2
−0.2
−0.4
−0.6
−0.8
0 0.5 1 1.5 2 2.5 3
Time (seconds)
Fig. 13.38 Simulated time response when taking into account the electrical dynamics and the PI
electric current controller. Controller gains in Table 13.4b) and kpi = 4.7, kii = 10000
816 13 Control of a Magnetic Levitation System
Bode Diagram
20
10
0
Magnitude (dB)
−10
−20
−30
−40
−50
−60
90
0
Phase (deg)
−90
−180
−270
10−1 100 101 102 103
Frequency (rad/s)
Fig. 13.39 Closed-loop system Bode diagrams. Continuous: the electrical dynamics is not
considered. Dashed: the electrical dynamics is taken into account. Controller gains in Table 13.4b)
and kpi = 4.7, kii = 10000
is much larger in Fig. 13.41 than in Fig. 13.37, which was also predicted during the
design stage in the previous section.
In Fig. 13.42 a simulation of the closed-loop system is presented when the
electrical dynamics is taken into account. From this, it is concluded that such high-
frequency oscillations are introduced by the electrical dynamics, which has been
rendered fast by the PI electric controller gains that are employed. In Fig. 13.43 the
closed-loop Bode diagrams corresponding to both cases, i.e., when neglecting the
electrical dynamics and when this dynamics is taken into account, are compared.
Note that both Bode diagrams are identical for low frequencies but there is a
difference at high frequencies, i.e., because of the effect of the fast electrical
dynamics. Finally, in Fig. 13.44 the open-loop transfer function polar plot, when
the electrical dynamics is taken into account, is presented. This is done to show that
the closed-loop system is stable despite the presence of the fast electrical dynamics,
which was not taken into account during the design stage presented in the previous
section.
13.6 Controller Design 817
Nyquist Diagram
3
1
Imaginary Axis
−1
−2
−3
−5 −4.5 −4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0
Real Axis
Fig. 13.40 Open-loop polar plot taking into account electrical dynamics. Controller gains in
Table 13.4b) and kpi = 4.7, kii = 10000
Fig. 13.41 Experimental results when step changes are applied from yd = z2∗ = 0.006[m] to
yd = z2∗ = 0.008[m] and vice versa. Top line x2v = yv , bottom line x2v
∗ = y ∗ . Controller gains in
v
Table 13.4c)
818 13 Control of a Magnetic Levitation System
0.8
0.6
0.4
Amplitude
0.2
−0.2
−0.4
−0.6
−0.8
0 0.5 1 1.5 2 2.5 3
Time (seconds)
Fig. 13.42 Simulated time response when taking into account the electrical dynamic and the PI
electric current controller. Controller gains in Table 13.4c) and kpi = 4.7, kii = 10000
In this section, an alternative procedure that is suggested in the literature [9] for
designing the PI electric current controller is described. Consider the block diagram
in Fig. 13.8c. It is suggested in [9] to choose:
kii
= −a11 > 0 (13.57)
kpi
as this reduces the corresponding block diagram to that shown in Fig. 13.45.
In Figs. 13.46a, b, c the root locus diagrams are presented for the internal-
most loop, the middle internal loop in addition to the external loop respectively in
Fig. 13.45. As is well known, each one of these root locus diagrams is drawn based
on the open-loop poles and zeros in the respective loop. We also stress that each of
these root locus diagrams takes into account, as open-loop poles and/or open-loop
zeros, the closed-loop poles and closed-loop zeros that result from the root locus
diagram corresponding to the previous internal loop. This is the reason why the
pole at s1 appears in both Figs. 13.46a and b, for instance.
Note, from Figs. 13.45 and 13.46a, that kpi can be used to move s1 to the left on
the left half-plane, i.e., to render the electric dynamics faster, which is one objective
of the PI electric current controller, as explained in Sect. 13.6.2. Also note that the
zero at − kkpiii in Fig. 13.46c appears because of the pole at − kkpiii contained in the
13.6 Controller Design 819
Bode Diagram
20
10
0
Magnitude (dB)
−10
−20
−30
−40
−50
−60
90
0
Phase (deg)
−90
−180
−270
10−1 100 101 102 103
Frequency (rad/s)
Fig. 13.43 Closed-loop system Bode diagrams. Continuous: the electrical dynamics is not
considered. Dashed: the electrical dynamics is taken into account. Controller gains in Table 13.4c)
and kpi = 4.7, kii = 10000
feedback path of the middle internal loop in Fig. 13.45. Hence, according to:
±180◦ (2q + 1)
asymptote angle = , q = 0, 1, 2, . . .
n−m
and:
kii
s5 + s4 + s3 + s2 + 0 − (−q1 − q2 − kpi )
σa =
n−m
with n−m = 5−3 = 2, the asymptotes crossing the real axis at σa are orthogonal to
the real axis. Moreover, these asymptotes lay on the left half-plane, as σa can always
be rendered negative because a large s1 < 0 (using a large kpi > 0) produces large
negative real parts for s4 and s5 . Furthermore, contrary to what happens in the design
method described in Sect. 13.6.2, kkpiii = −a11 is not very large in this case.
Recall that it has been noted in Sect. 13.6.3 that the design procedure introduced
in Sect. 13.6.2 may result in instability problems because two branches of the root
820 13 Control of a Magnetic Levitation System
Nyquist Diagram
3
1
Imaginary Axis
−1
−2
−3
−5 −4.5 −4 −3.5 −3 −2.5 −2 −1.5 −1 −0.5 0
Real Axis
Fig. 13.44 Open-loop polar diagram taking into account electrical dynamics. Controller gains in
Table 13.4c) and kpi = 4.7, kii = 10000
+ + 1 Z 1(s) a 31 Z 2(s)
kpi
s
Ap L x* s 2 – a 32
+ – 2
sL(x*)
2 a 13s
(k pis+k ii )A p
k d s 2+k ps+k i
Ad s
As
Z 5(s)
locus are pushed into the right half-plane. It is clear that such instability problems do
not exist when using the design procedure in the present section, which represents
an important advantage of this method.
However, the condition in (13.57) represents a restriction on the PI controller
gains, which does not ensure that a good performance, is obtained in practice.
Thus, to study the performance achievable when using (13.57), we tested this tuning
procedure experimentally. Using x2∗ = 0.01[m], it is found that (13.57) becomes:
kii
= −a11 = 72.5384. (13.58)
kpi
13.6 Controller Design 821
s5
k
– k iipi s3 s2
s1 √ √
– a 32 a 32
s4
s5
s3 s2
k
σa –q 1 –q 2
– k iipi
s4
This yields kii = 340.89 when using kpi = 4.7 as in (13.42). This value for kpi
is chosen to fairly compare with the results in Sects. 13.6.2 and 13.6.3. Hence,
R = 4.7[KΩ] and C = 3[μF] must be used in (13.39). Using the plant parameters
corresponding to x2∗ = 0.01[m] and the controller gains in (13.45), in addition
to kii = 340.89, kpi = 4.7, it is found that the closed-loop system has poles
located at:
These numerical values verify the correctness of the root locus diagram shown in
Fig. 13.46c.
When performing experiments setting x2∗ = 0.01[m], using the controller gains
in (13.45) and kii = 340.89, kpi = 4.7, a better performance was not found: the ball
is prone to oscillate and most times it cannot stay levitating at the desired position.
Moreover, the performance is worse when testing the system at x2∗ = 0.006[m]
and x2∗ = 0.002[m]. Of course, in such cases, the controller gains in Table 13.2
and (13.46) respectively, and kii = 340.89, kpi = 4.7 were used.
These practical results have motivated us to select the numerical values in (13.42)
as the correct controller gains.
13.7 Summary
In this chapter, a magnetic levitation system has been controlled using exclusively
analog electronics. The controller employed is a classical PID that has been
implemented using operational amplifiers according to Sect. 9.2 in Chap. 9. As the
plant is nonlinear, it is necessary to obtain a linear approximate model, which is
useful only locally, i.e., the control system performs correctly only if the ball to
levitate is initially located close to the position where it is desired to stay. To obtain
this linear approximate model, the state variables approach in Chap. 7 is very useful.
Once a linear approximate model is obtained, the PID controller is designed. This
requires knowledge of the numerical values of the plant parameters. Hence, it is
explained how these numerical values can be estimated experimentally.
As the plant is unstable and nonlinear, this is a control problem whose com-
missioning is somewhat complex. This means that attention is required to take into
account all the gains introduced by each one of the control circuit components when
modeling the system and when designing the controller. Any errors in this respect
result in deterioration of the control system’s performance.
It is very important to stress that the construction of the prototype that is
presented in this chapter does not require expensive sophisticated sensors.
1. Why is an E-shaped core well suited for the electromagnet? Why not use a simple
straight core?
References 823
References
15. S. Eppinger and W. Seering, Introduction to dynamic models for robot force control. IEEE
Control Systems Magazine, vol. 7, pp. 48–52, 1987.
16. G. C. Goodwin, S. F. Graebe, and M. E. Salgado, Control system design, Prentice-Hall, Upper
Saddle River, 2001.
Chapter 14
Control of a Ball and Beam System
Consider the situation represented in Fig. 14.1. It is a ball that rolls inside a channel
on a beam. The beam angle is modified by a permanent magnet (PM) brushed
direct current (DC) motor and this produces the ball movement by the effect of
gravity. The objective of the mechanism control is to stabilize the ball at some
desired position on the beam. This mechanism is a very common workbench for
classical and advanced control techniques [1, 2]. As shown in the present chapter,
this mechanism is unstable and the classical design methods commonly introduce
an internal control loop. These are the reasons for presenting this control problem
in the present chapter.
The nomenclature employed is the following:
• u is the applied voltage at the motor armature terminals.
• x is the ball position measured from the beam left end.
• θ is the beam angle measured with respect to the horizontal configuration.
• m is the ball mass.
• R and r stand respectively for the ball radius and the ball rotation radius on the
channel edge.
• i is the electric current through the motor armature.
• L is the armature inductance.
• Ra is the armature resistance.
• ke is the motor counter electromotive force constant.
• km is the motor torque constant.
• Jm is the motor rotor inertia.
• bm is the motor viscous friction constant.
• JL is the beam inertia.
• bL is the beam viscous friction constant.
• n1 and n2 stand for the teeth number at the motor shaft and the beam shaft
respectively, and n = nn21 .
ξ
σ
z
g
Consider Fig. 14.1. The beam length is L and suppose that the beam rotates around
an horizontal axis at x = L/2. Note that:
L
z=x− , ξ = z cos θ, σ = −z sin θ,
2
have been defined. From these expressions the following is obtained:
It is also important to stress that it is assumed that the ball rotates without slipping,
which is established by constraining the ball angular velocity ω and the ball
translational velocity ż to satisfy:
rω = ż, or ż − rω = 0 (14.1)
center of mass (assumed to be located at its geometric center) and the translational
movement of its center of mass. Thus, the kinetic energy of the ball is given as:
1 1
Kb = Jb ω2 + m(ξ̇ 2 + σ̇ 2 ).
2 2
where Jb = 25 mR 2 is the inertia of a solid sphere (the ball) with mass m and radius
R rotating on its own axis [3, 4], pp. 271.
The total kinetic energy of the system is obtained just by adding the rotative
kinetic energy of the beam, i.e.,
1 1 1 1
K = Kb + J θ̇ 2 = Jb ω2 + m(ξ̇ 2 + σ̇ 2 ) + J θ̇ 2 ,
2 2 2 2
J = n2 Jm + JL .
Note that the inertia J takes into account the beam inertia and the motor inertia
coupled with a gear box. The total potential energy is due only to the ball, i.e.,
P = σ mg = −zmg sin θ.
1 1 1
L= Jb ω2 + m(ξ̇ 2 + σ̇ 2 ) + J θ̇ 2 + zmg sin θ. (14.2)
2 2 2
According to the above arguments, the system’s generalized coordinates can be
defined as the ball’s translational position z = ± ξ 2 + σ 2 , the beam position θ ,
and the ball’s angular position γ , i.e. γ̇ = ω. Hence, according to the nomenclature
in Appendix E:
On the other hand, according to (E.2), the constraint on the velocities given in (14.1)
can be written as:
d ∂L ∂L
− = −rλ,
dt ∂ω ∂γ
where τQ = [0, −bθ̇ , 0]T , b > 0, has been assumed, i.e., no friction is considered
to exist in the ball dynamics because it rotates without slipping, τ = [0, τθ , 0]T with
τθ the torque applied by the motor on the beam, and λ is an unknown scalar to be
computed later. Replacing (14.2) in (14.3) it is found:
d
[mC cos θ + mB(− sin θ)]
dt
. /
− mC(−θ̇ sin θ) + mB(−θ̇ cos θ) + mg sin θ = λ,
d . /
mC(−z sin θ) + mB(−z cos θ) + J θ̇
dt
. /
− mC(−ż sin θ − zθ̇ cos θ) + mB(−ż cos θ + zθ̇ sin θ) + zmg cos θ = τθ − bθ̇,
Jb ω̇ = −rλ,
where:
Performing the indicated time derivatives and using some trigonometric identities
in addition to λ = − 1r Jb ω̇, from the last equation, the above equations simplify to:
1
mz̈ − mzθ̇ 2 − mg sin θ = − Jb ω̇,
r
J θ̈ + mz2 θ̈ + mzżθ̇ − mgz cos θ = τθ − bθ̇ .
These equations represent the ball and beam system mathematical model. Notice
that this model is nonlinear because of several terms such as −mzθ̇ 2 , −mg sin θ ,
mz2 θ̈ , mzżθ̇ , −mgz cos θ . As this book is concerned only with linear control
techniques, a linear model for the ball and beam system is required. Such a model is
obtained in the following section by considering some simplifications of the above
model.
14.1 Mathematical Model 829
It is interesting to note that, according to the term −mgz cos θ in the second equation
in (14.4), the ball weight exerts a torque on the beam axis, which depends on the
ball position on the beam. On the other hand, an interesting phenomenon appears
because of the term −mzθ̇ 2 in the first equation: if the ball position z > 0 is large,
the beam angle θ must be rendered negative very fast, i.e., θ̇ 2 is large, to avoid the
ball escaping (see Fig. 14.1), then, according to −mzθ̇ 2 a centripetal force is exerted
on the ball that forces it to continue escaping instead of stopping. It is not difficult
to verify that a similar situation occurs when z < 0.
To avoid these phenomena appearing, the following assumptions are consid-
ered:
• Torque on the beam, due to weight of the ball, is negligible, which is especially
true if the motor actuates on the beam through a gear box with a high reduction
ratio. Under these conditions: mgz cos θ ≈ 0 and mz2 θ̈ ≈ 0.
• The beam and the ball always move at low velocities θ̇ , ż, and the beam angle θ
only takes values around zero. Under these conditions sin θ ≈ θ , if θ is given in
radians, and θ̇ 2 ≈ 0, żθ̇ ≈ 0.
Thus, the model in (14.4) becomes:
1
m + 2 Jb z̈ − mgθ = 0,
r
J θ̈ + bθ̇ = τθ .
Differentiating z = x − L
2 twice yields z̈ = ẍ. Thus, the above model becomes1 :
2 R2
1+ ẍ = gθ,
5 r2
J θ̈ + bθ̇ = τθ . (14.5)
where Jb = 25 mR 2 has been used. As this model is linear, the Laplace transform
can be used in the first expression to find:
X(s) ρ g
= 2, ρ= . (14.6)
2 R2
θ (s) s 1+ 5 r2
On the other hand, the electric motor can be modeled as in Sect. 10.1 taking into
account that the load is represented by the beam, i.e.,
1 Note that this model can also be expressed in terms of z: just replace z̈ = ẍ.
830 14 Control of a Ball and Beam System
di
L = u − Ra i − n ke θ̇ ,
dt
J θ̈ = −b θ̇ + n km i, n km i = τθ ,
J = n2 Jm + JL , b = n2 bm + bL ,
where the second expression corresponds to (14.5). Proceeding as in Sects. 10.1, 10.2
and 10.3, the following current loop:
ui = K(i ∗ − i),
u = Ap ui ,
can be used to find that the model of the motor and the beam is given as:
k
θ (s) = I ∗ (s), (14.7)
s(s + a)
b nkm
a= , k= ,
J J
where it is assumed that no external disturbance is present, i.e., Tp = 0. Finally,
the linear approximate ball and beam system model is given by the combination
of (14.7) and (14.6), i.e.,
X(s) ρ k
= 2, θ (s) = I ∗ (s). (14.8)
θ (s) s s(s + a)
PIC16F877A
INTERFACES-
MECHANISM
MEASUREMENT
ENCODER
SYSTEM
Fig. 14.2 Block diagram of the complete control system. Block interfaces–mechanism ball and
beam is shown in Fig. 14.19. Block measurement system is shown in Fig. 14.3
• Beam of the system. Composed of: (i) A beam in wood with a circular section
(rail number one), (ii) A beam in aluminum with a circular section (rail number
two), (iii) A sheet of wood employed to hold both cylindrical beams.
• A ball position measurement system as described next.
A block diagram of the whole system is presented in Fig. 14.2.
One important and interesting component of the experimental prototype is the ball
position measurement system. In fact, this is the most challenging component to
construct. The most common way of performing the ball position measurements is
employing a resistance distributed along one of the beam channel rails. The other
rail is a simple electric conductor whose resistance can be considered to be zero.
Hence, as the ball (made in an electric conductor material) rolls, putting both rails
in electric contact, the second rail has a voltage that is equal to the voltage of the
first rail at the point where the ball touches it. Thus, both rails work together as a
potentiometer with the ball acting as the mobile contact.
The electric diagram of the ball position measurement system that has been built
is shown in Fig. 14.3. Rail number one consists of a beam in wood with a circular
section of about 0.01[m] in diameter and 0.7[m] in length. Magnetic wire is carefully
wound onto this beam. All the wire loops must be tight to each other but without
overlapping. Thus, a cylinder-shaped coil is obtained with a length of 0.7[m] and a
diameter of 0.01[m] whose external surface is even enough to allow the ball to roll
smoothly. The reason for using a beam in wood for this rail is to avoid the danger of
putting the wire loops in a short circuit if the insulating paint fails.
Rail number two is a cylinder beam in aluminum with a length of 0.65[m] and
a diameter of 0.01[m]. Both rails lay one in front of the other, in parallel, with
832 14 Control of a Ball and Beam System
0.33μF
Ref AN3(5)
100 kΩ
22 Ω
10 W
0.33μF
12 V
0.017[m] the minimal distance between them, on a sheet in wood. Hence, a channel
measuring 0.65[m] in length and 0.017[m] in width is formed. This assembly
constitutes the beam of the mechanism.
The ball dimensions are selected such that it is allowed to roll within the channel
by putting both rails in electric contact but the channel width is enough to avoid
the ball escaping. This feature is important, especially in the first experimental
tests when it is usual for the ball to escape from the channel. Finally, the narrow
strip where the ball touches rail number one is identified and the insulating paint
is stripped with sandpaper along the entire length of rail number one. This allows
electric contact, through the rolling ball, between the two rails. The ball that has
been selected has the following dimensions (see Fig. 14.4):
Finally, a gear box is employed to join the PM brushed DC motor and the beam
to magnify the torque applied to the latter.
As stated above, both rails work together as a simple potentiometer delivering
a voltage xv that is proportional to the ball position x. The voltage xv is measured
using one of the analog/digital converters in the PIC16F877A microcontroller by
connecting the terminal labeled AN1 to the microcontroller’s pin 3. It is important
to state that xv has previously passed through a low-pass filter with 14.6148 [Hz]
(R = 33[KOhm], C = 0.33[μF]) as corner frequency. Furthermore, to render the
measurement system robust with respect to temperature changes in rail number one,
14.3 Parameter Identification 833
Ball
Fig. 14.4 Ball rolling in the channel, i.e., between the rails
The beam angle θ is measured using an optical encoder integrated into the PM
brushed DC motor. The encoder is 400 ppr and is fixed to the motor shaft. Recall
that a gear box with ratio 1 : 30, i.e., n = 30, is used between the motor shaft and
the beam shaft. Then, the position measured by the encoder (the motor position)
must be divided by n to obtain the corresponding beam position measurement θ .
The procedure suggested in this part is similar to that introduced in Sect. 11.1.
Consider the following proportional position control:
θv (s) Aθ kp k ωn2
= 2 = 2 .
θvd s s + as + Aθ kp k s + 2ζ ωn s + ωn2
ωn = Aθ kp k, a = 2ζ ωn , (14.11)
where θvd (s) = Aθ θd (s) is the desired beam position in terms of the variable
delivered by the measurement system. Some experimental results are presented in
Fig. 14.6 when kp = 4 and θd = 0.2[rad] is the desired value for θ . This experiment
is performed without the ball between the beam rails or channel. From Fig. 14.6, the
following is measured tr = 0.252[s] and Mp (%) = 79. These data are employed in:
%
&
& ln2
Mp (%)
& 100
ζ =' ,
Mp (%)
ln2 + π2
100
1 1 − ζ2
ωd = π − arctan ,
tr ζ
ωd
ωn = ,
1 − ζ2
θd (s ) θυd (s ) I* (s ) θ (s) θυ (s )
k
Aθ kp s ( s+ a ) Aθ
+
–
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.6 Experimental results using kp = 4 and the block diagram in Fig. 14.5
Applying the inverse Laplace transform to (14.6) and assuming all the initial
conditions to be zero, the following is found:
ẍ = ρ θ (t). (14.13)
1
x(t) = ρ θ0 t 2 . (14.14)
2
A procedure is presented next allowing us to experimentally estimate the parame-
ter ρ.
836 14 Control of a Ball and Beam System
• Fix the beam at a the constant angle θ = θ0 , where θ0 is a small positive value.
A good example is θ0 = 0.2[rad] because sin(0.2) = 0.1987, i.e., sin(θ0 ) ≈ θ0 .
• Place the ball at the beam left end and let it roll until reaching the beam end
at the right (the beam must not move during this stage). Measure the ball
position described in this experiment. This task is rendered easier if a computer
is employed.
• Plot the ball position in this experiment versus time.
• Using θ0 defined at the first step of this experiment and proposing some arbitrary
positive value for ρ, plot the function 12 ρ θ0 t 2 on the same axes employed at the
previous step.
• Propose different values for ρ. The correct value of ρ is that allowing the plot of
the function 12 ρ θ0 t 2 to fit the plot of the experimental data.
The plots referred to in the previous procedure are shown in Fig. 14.7. when using
θ0 = 0.2[rad] and:
ρ = 4.8. (14.15)
It is important to verify that the experimental data x are plotted using meters as the
measurement unit. This is rendered easier if Ax = 1, as explained in Sect. 14.7.
Finally, it is interesting to state that the value for ρ shown in (14.15) has been
corroborated using (14.6), (14.9) and g = 9.81[m/s2 ], which yields ρ = 4.687.
[m]
t [s]
Fig. 14.7 Experimental identification of the parameter ρ. Continuous: x(t) measured in the
experiment. Dashed: x(t) = 12 ρθ0 (t − 13.38)2 − 0.322, θ0 = 0.2[rad], ρ = 4.8
14.4 Controller Design 837
Note that the plant model (14.8) has three poles at s = 0, i.e., it is open-loop
unstable. Hence, an important design objective is to achieve closed-loop stability.
A block diagram of the control system to be designed is shown in Fig. 14.8a. This
block diagram can be represented as in Fig. 14.8b. It is suggested that the reader
might see Sect. 6.7.5 to understand the reason for this block diagram. In this design
problem limt→∞ x(t) = xd must be accomplished, where xd is a constant standing
for the desired ball position on the beam.
Note that the open-loop transfer function of the system shown in Fig. 14.8b has
two poles at s = 0, i.e., the system type is 2. Then, as xd is constant, it is ensured that
limt→∞ x(t) = xd if the closed-loop transfer function X(s)/Xd (s) is stable (see
Sects. 3.4 and 4.4). Hence, the only problem that remains is to find some constants
α, kv , γ , b and c such that the transfer function X(s)/Xd (s) is stable. It is explained
next how to achieve this.
The open-loop transfer function of the system shown in Fig. 14.8b is given as:
Ax ρ γ b s + b c αkAθ 1
G(s)H (s) = , (14.16)
cAθ b s + c s 2 + (a + kv kAθ )s + αkAθ s 2
where c > b > 0. In Fig. 14.9, the Bode diagrams of G(s)H (s) and each one of
the transfer functions that comprise it are shown. Notice that, if the constant αkAθ
is large enough, i.e., if αkAθ
s 2 + (a + kv kAθ )s, then:
αkAθ
≈ 1. (14.17)
s2 + (a + kv kAθ )s + αkAθ
This can also be interpreted by thinking that the transfer function in (14.17) has
0[dB] as magnitude and 0 degrees as phase. It is interesting to observe that this
situation can also be seen in Fig. 14.9: when αkAθ is large enough, i.e., when the
corner frequency of the transfer function in (14.17) is located far to the right, this
second-order factor has no effect on open-loop frequency response; thus, it can be
neglected.
Hence, if αkAθ is large, the problem is simplified to achieve closed-loop stability
for a system whose open-loop transfer function is given as:
Ax ρ γ b s + b c 1
. (14.18)
cAθ b s + c s2
This is an important simplification because the phase lag of the transfer function
in (14.17) is eliminated, which may take values between 0 and −180 degrees (when
such a transfer function is not close to unity). This means that stabilizing (14.18)
requires less phase lead than that required to stabilize (14.16). Recall that requiring
more phase lead renders the controller design task more restrictive because the
compensator γ s+bs+c would be more sensitive to noise in the position sensors.
Note that a large αkAθ can be achieved by enlarging α as k and Aθ are fixed once
the prototype has been built. However, a large αkAθ causes the performance of the
control system to deteriorate. In fact, large values for αkAθ were employed during
14.4 Controller Design 839
the experimental tests and it was observed that this increases the deteriorating effect
due to noise in sensors: the mechanism strongly vibrates and the control system
does not work. Hence, α is limited by a maximal value imposed by the experimental
prototype even when the condition (14.17) is not satisfied.
other hand, if kv = 0 the system in (14.17) will be badly damped because
On the√
ζ = a/(2 αkAθ ) is small. This produces a resonance peak in the Bode diagrams
of (14.16). The problem with a resonance peak is that it increases the effect of high
frequencies producing, again, undesirable vibrations in the mechanism. Good results
have been obtained using
√ some kv > 0 because this increases the damping factor
ζ = (a + kv kAθ )/(2 αkAθ ) of the system in (14.17); hence, the resonance peak
in the Bode diagrams of (14.16) is reduced.
According to the above arguments the following experiment was performed.
• Consider a closed-loop system to control only the beam position, i.e., only
consider the block diagram between the signals V1 (s) and θ (s) in any of the
block diagrams in Fig. 14.8. This means that the ball must not be on the beam
when performing the experiments.
• Set V1 (s) as a step standing for the desired beam position and kv = 0.
• Propose some values for α > 0 such that the beam response is fast.
• When the oscillations are important, keep α constant and increase kv > 0.
• Repeat the previous two items until the beam response is fast and well-damped
but avoiding vibrations due to excessive noise amplification. Consider the
resulting values of α and kv as the correct values.
Once the above procedure had been performed, it was found that the use of the
following controller gains achieves a satisfactory performance:
Notice that the system in Fig. 14.8b, together with Ax = Aθ = 1 (see Sect. 14.7),
and (14.12), (14.15), (14.19) represent the control problem analyzed in Sect. 6.7.5.2,
where the solution is given by the following compensator:
s+b
Gc (s) = γ , b = 0.6404, c = 4.5746, γ = 1.6406.
s+c
Finally, according to Sect. 6.5.2, to take into account the effects of time delay
contributed by the digital implementation of the controller, the transfer function:
k
,
s(s + a)
k e−T s
,
s(s + a)
840 14 Control of a Ball and Beam System
as the time delay T appears at the controller output, i.e., at the plant input. Using
suitable block algebra it is possible to show that the corresponding open-loop
transfer function is the same as G(s)H (s) in (14.16) with e−T s as a new factor. This
means that the phase lag −ωT [rad] must be added to the phase in Fig. 6.87. There,
the crossover frequency is ω = 1.71[rad/s]. Also T = 0.01[s] can be set as this
is the sampling period used in the experiments presented next, i.e., the worst case
time delay. Hence, −ωT × 180◦ /π = −0.97◦ . This means that the phase margin
remains almost the same as in Fig. 6.87, i.e., about 47.5◦ , and the time delay induced
by the digital implementation of the controller does not cause the performance to
deteriorate.
In Fig. 14.10 some experimental results are presented that are obtained when using
the following desired ball position:
⎧
⎪
⎪ 0.0, 0 ≤ t ≤ 10
⎪
⎪
⎪
⎪ 0.1, 10 < t ≤ 20
⎪
⎪
⎪
⎪ 0.2, 20 ≤ t ≤ 30
⎪
⎪
⎪
⎨ 0.1, 30 ≤ t ≤ 40
xd = 0.0, 40 ≤ t ≤ 50 .
⎪
⎪
⎪
⎪ 0.1, 50 ≤ t ≤ 60
⎪
⎪
⎪
⎪ 0.2, 60 ≤ t ≤ 70
⎪
⎪
⎪
⎪ 0.1, 70 ≤ t ≤ 80
⎪
⎩
0.0, 80 ≤ t
where xd is given in meters and t in seconds. It can be observed that, although the
ball position tracks its desired value, a steady-state error that is different from zero
is present. This steady-state error is due to nonlinear friction introduced by the gear
box. Also notice that the overshoot is not the same when responding to different
step commands. This effect is mainly due to beam inertia changes because of the
ball staying in a different position on the beam. Note, however, that this effect has
not been considered in the mechanism model.
To measure the rise time and overshoot to one of the commanded step references,
a zoom-in in Fig. 14.10 is presented in Fig. 14.11. There, it is observed that tr =
0.79[s] and Mp (%) = 33%. The steady-state value of x is 0.077[m] in this figure. It
is interesting to recall that a 30% overshoot and a 0.927[s] rise time were obtained
through simulations in Fig. 6.88. These values are very close to those obtained
through the experiments in Fig. 14.11.
The nonzero steady-state error observed in the above experiments may be
attributed to nonlinear friction but, also, recall that a torque on the beam due to
the ball weight has been neglected in Sect. 14.1.2 to obtain a linear approximation
14.5 Experimental Results 841
[m]
x
xd
t [s]
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.10 Experimental results obtained with the prototype that has been built
[m] xd
x
t [s]
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.11 Experimental results obtained with the prototype that has been built (continued)
842 14 Control of a Ball and Beam System
X d (s) + ki
X dp(s) X(s)
kp + s
M(s)
–
Fig. 14.12 Block diagram of a control scheme that includes a controller with integral action
model. Note that this torque disturbance becomes constant when the ball position
is constant. Hence, a controller with an integral action is well suited to solving this
problem and this is presented next. Designate by M(s) the closed-loop function
defined as:
X(s)
M(s) = ,
Xd (s)
in the block diagram in Fig. 14.8b when all the parameters and gains take values
according to the above design. In Fig. 14.12 a block diagram is presented that
illustrates how an integral action is included in the control system. There, kp and
ki are the gains of a PI controller that is included in the open-loop transfer function.
Note that Xdp (s) represents an intermediate variable that replaces Xd (s) in all the
previous block diagrams, whereas the desired ball position Xd (s) is now shifted to
the left to allow the PI controller to be driven by the ball position error Xd (s)−X(s).
The controller gains kp = 0.5 and ki = 1.5 are selected to obtain a ω1 =
1.98 ≈ 1.71[rad/s] crossover frequency and a Kf = 45◦ phase margin, as depicted
in Fig. 14.13. Recall that 1.71 is the crossover frequency selected in the previous
design. In Fig. 14.14 a simulation response is presented when Xd (s), in Fig. 14.12,
is a unit step change.
Some experimental results are presented in Fig. 14.15 when the control scheme
in Fig. 14.12 is used. Note that a zero steady- state error is reached now each time
that a step change is commanded. Moreover, to further demonstrate the effectiveness
of this approach, a constant disturbance is applied for approximately t ≥ 45[s]. This
disturbance is produced by adding a constant tilt angle to the mechanism base. This
forces θ to be different from zero at a steady state to stabilize the ball at some
constant position x. However, this increases the nonzero steady-state error in x if
the controller does not possess an integral action. This is what happens in Fig. 14.16
where the ball position x stays far away from xd once the disturbance appears, i.e.,
for t ≥ 45[s]. In the case of the control scheme shown in Fig. 14.12 the integral
action of the external loop controller achieves a zero steady-state error even when
such a disturbance is applied, i.e., for t ≥ 45[s], as can be seen in Fig. 14.15. This
experimental test demonstrates the superiority of a control scheme with an integral
action.
On the other hand, in Sect. 5.2.9, Chap. 5, the control scheme depicted in
Fig. 5.53 was designed where:
Bode Diagram
50
0
System: ghM
Magnitude (dB)
−100
−150
−200
0
−90
Phase (deg)
System: ghM
−180 Frequency (rad/sec): 1.97
Phase (deg): −135
−270
−360
10−1 100 101 102 103
Frequency (rad/sec)
ki
Fig. 14.13 Bode diagrams for the transfer function kp + s M(s), kp = 0.5 and ki = 1.5
This design was performed to achieve a rise time tr = 1[s] and an overshoot
Mp = 25%. This control scheme is now tested experimentally using the ball and
beam prototype described in this section. A step change in the desired position xd
is applied at t = 0, which changes from 0.05[m] to 0.15[m]. The corresponding
experimental results are shown in Fig. 14.17, where tr = 1.169[s] and Mp = 14%
has been obtained. These results are considered to be satisfactory given the accuracy
of the prototype that has been built. Note that, contrary to the previous experiments
shown in the present section, the steady-state error is zero without the necessity
of an integral controller. Recall that friction is responsible for such a steady-state
error and friction is also uncertain and changes during normal operation. Hence, a
zero steady-state error is sometimes accomplished, despite the presence of friction.
Moreover, the effect of the ball weight can be reduced if the experiment is performed
when the ball is close to the center of the beam (where the beam axis is located) as in
Fig. 14.17. Finally, it is shown through simulations in Sect. 5.2.9, Chap. 5, that the
controller gains b = 2, c = 11.7121, γ = 4.6336, result in a better time response.
However, it was observed in experiments that use of these controller gains results in
844 14 Control of a Ball and Beam System
Step Response
1.4
1.2
1
Amplitude
0.8
0.6
0.4
0.2
0
0 1 2 3 4 5 6 7 8
Time (sec)
Fig. 14.14 Simulation response of the closed-loop system in Fig. 14.12, kp = 0.5 and ki = 1.5
[m] xd
x
t [s]
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.15 Experimental response when the control scheme in Fig. 14.12 is used, kp = 0.5 and
ki = 1.5. A constant disturbance exists for t ≥ 45[s]
14.6 Control System Electric Diagram 845
[m]
x xd
t [s]
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.16 Experimental response when the control scheme in Fig. 14.8 is used. A constant
disturbance exists for t ≥ 45[s]
noise amplification and the closed-loop control system has a bad performance. This
is because these controller gains are large.
Finally, a picture of the ball and beam prototype that has been built is presented
in Fig. 14.18.
The control system electric diagram is shown in Fig. 14.19. This diagram is
complemented with Fig. 14.3. A PIC16F877A Microchip microcontroller-based
electronic board is employed as interface between the control program, implemented
in a portable computer, and the ball and beam system. The communication is
performed through the driver MAX232. This interface board receives pulses from
the encoder and voltage delivered by the ball position x measurement system, and
sends them to the portable computer. There, the control program handles these data
numerically (which is explained later) to obtain the beam position θ in radians, and
the ball position x in meters.
On the other hand, as the result of the control algorithm evaluation, the portable
computer obtains the electric current that must flow though the DC motor and
sends it back to interface board. There, the microcontroller sends such an electric
current value to the power amplifier, which applies a suitable voltage at the motor
846 14 Control of a Ball and Beam System
[m]
xd x
t [s]
θ
[rad]
t [s]
i*
[A]
t [s]
Fig. 14.17 Experimental response when the control scheme in Fig. 5.53 is used with kv = 0.35,
α = 30, b = 1.4, c = 5.1138, γ = 2.1868
Fig. 14.18 Ball and beam system prototype that has been built
14.6 Control System Electric Diagram 847
x
θ
8
+
10 7
1 μF
Tx
MAX232
11 6
12 5
1 μF
13 4
Rx Tx
+
Rx
to PC
DB9
1 kΩ
3
5W
14
1 μF
1 μF
15 2
+
16 1
1 μF
MCD
+
u
+5V
TIP120
TIP125
2
4
POWER AMPLIFIER
1
+12V
5
0.1 μ F
DAC0800
-12V
6
+12V
0.1 μ F
7
13
8
TL081
10 kΩ
+
-
3
12 11 10 9
0.01 μ F
-12V
u
16
4.7 k Ω
CURRENT
CONTROL
4.7 kΩ
330Ω
0.1 μ F
5 kΩ
21 20
+12V
22 19
TL081
5 kΩ
Vref
23 18
+
-
24 17
25 16
PIC16F877A
26 15
20 MHz
15 pF
1 kΩ
1 kΩ
27 14
28 13
29 12
30 11
+5V
31 10
15 pF
32 9
+5V
TL081
8
4.7 kΩ
33
4.7 kΩ
+
-
34 7
35 6
36 5
Encoder
37 4
38 3
39 2
33 kΩ
+5V
40 1
terminals, ensuring that such a desired current actually flows through the motor
armature. To achieve this task, a DAC0800 digital/analog converter is employed
which, working together with a TL081 operational amplifier, delivers −i ∗ as an
analog voltage signal. Then, an operational amplifier performs as a proportional–
integral (PI) electric current controller with ≈ 5 as proportional gain and 10000 as
integral gain. The voltage applied at the motor armature terminals, u, must be equal
to the signal at the output of this PI controller, ui . However, because of the dead zone
848 14 Control of a Ball and Beam System
MICROCONTROLLER.
In this section we explain the main steps in implementing the control algorithms
using the Builder 6 C++ code listed below. The corresponding flow diagram is
shown in Fig. 14.20. Before defining some libraries and constants, the executable
part of the program begins with the instruction “void ProcessByte(BYTE byte)”.
There, the program remains waiting for the recognition code “0xAA” to be sent by
the microcontroller PIC16F877A as an indicative that data from the mechanism is
to be sent in the subsequent instructions. The beam position is first received and
assigned to the variable “pos”, then the ball position is received and assigned to the
variable “conv”. After that, the desired ball position is generated and assigned to the
variable “xd”. The beam position in radians is assigned in the variable “theta” where
“esctheta” is a factor converting pulses from encoder to radians using the relation:
2π [rad] → 4 × 400[pulses/rev]
14.7 Builder 6 C++ Code Used to Implement the Control Algorithms 849
Note that the gear box ratio n is taken into account as the encoder is fixed to the
motor shaft. This allows us to consider that Aθ = 1. The ball position in meters
is assigned to the variable “x” where “escx= 0.7/1022” is a factor converting
from conv ∈ [0, 1022] (the code from a 10-bit analog/digital converter) to x ∈
[−0.7/2, 0.7/2] in meters. Note that the subtraction “conv-511” and the fact that
0.7[m] is the beam length are important to performing this task. This allows us to
consider that Ax = 1. This also means that in all the experiments presented until
now, the ball position x is measured from the middle point of the beam, i.e., instead
of using the symbol x it would be more correct to use the variable z (which was
not done, however) defined as z = x − L2 at the beginning of Sect. 14.1.1. This has
not affected the correctness of the designs presented so far, because, as noted in the
footnote above (14.5), the dynamical model of the ball and beam is identical when
written in terms of either x or z.
Two controllers are coded: the first one corresponds to the control scheme in
Fig. 14.12 and the second one corresponds to the control scheme in Fig. 14.8. The
electric current to be commanded by these controllers is represented by the variable
“iast”. This variable is saturated so as not to take values out of the admissible
range and its sign is changed to deliver −i ∗ at the output of the digital/analog
converter stage described in Sect. 14.6. Then “iast” is converted into the range
[0, 255] to send it to the microcontroller as an 8-bit word. This is performed via
the instruction “MainForm− >send_byte(cuentas)”, some variables are saved in
the file MONIT.txt, and time is increased by 0.01[s]. Finally, the program returns
and remains waiting for the recognition code “0xAA” again.
//Ball and beam control computer program
//-----------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Main.h"
#include <math.h>
#include <stdio.h>
#include <share.h>
#include <conio.h>
#include <dos.h>
//-----------------------------------
#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
//-------------------------------------
#define Ts 0.01 //sampling period in sec
#define pi_ 3.1416
FILE *ptrMonit;
TMainForm *MainForm;
unsigned char flagcom=0,flagfile=0,cuentas;
unsigned short int conv,pos; //de 16 bits
float t=0,inte=0,area=0,escs=255.0/(2.0*maxI);
float esctheta=pi_/(2*ppr*n),x,xd=0.0,theta,e,iast;
float v=0,thetad,theta_1=0,escx=lriel/cADC,iTs=1/Ts;
float ic=0.6,ee,k1,k2;
float integ=0.0,integ1=0.0,iast1,ese,ep,xd2;
//-------------------------------------------
void ProcessByte(BYTE byte)
{
if(flagcom!=0)
flagcom++;
if((byte==0xAA)&&(flagcom==0))
{
pos=0;
conv=0;
flagcom=1;
}
if(flagcom==2)
{
pos=byte;
pos=pos<<8;
}
if(flagcom==3)
pos=pos+byte;
if(flagcom==4)
{
conv=byte;
conv=conv<<8;
}
if(flagcom==5)
{
if(t>10){
xd=0.1;
}
if(t>20){
xd=0.2;
}
if(t>30){
14.7 Builder 6 C++ Code Used to Implement the Control Algorithms 851
xd=0.1;
}
if(t>40){
xd=0.0;
}
if(t>50){
xd=0.1;
}
if(t>60){
xd=0.2;
}
if(t>70){
xd=0.1;
}
if(t>80){
xd=0.0;
}
conv=conv+byte;
theta=(signed short int)pos;
theta=esctheta*theta;
x=(signed short int)(conv-511);
x=escx*x;
e=xd-x;
/*_______________Controllers___________________ */
/* ---------- Integral control ------*/
/* xd2=kp2*e+ki2*integ;
integ=integ+Ts*e;
ep=xd2-x;
thetad=gamma*(ep+v);//thetad=v1
v=(-c*v+(b-c)*ep)*Ts+v;
iast1=alfa*(thetad-theta)-kv*(theta-theta_1)*iTs;
iast=iast1;
theta_1=theta; */
/* ---------- Integral control ends ------*/
/* ---------- without integral control ------*/
thetad=gamma*(e+v);//thetad=v1
v=(-c*v+(b-c)*e)*Ts+v;
iast1=alfa*(thetad-theta)-kv*(theta-theta_1)*iTs;
iast=iast1;
theta_1=theta;
/* ---------- without integral control ends-----*/
/* _____________Controllers ends __________ */
/* ________Output saturation____________ */
if(iast>IM)
iast=IM;
if(iast<-IM)
iast=-IM;
/* ___________________________________________ */
MainForm->Edit3->Text = FloatToStr (iast);
iast=-iast;
cuentas=escs*(iast+maxI);
/* ___Physical constraint on the beam position___ */
852 14 Control of a Ball and Beam System
if(theta>1.0)//0.5
cuentas=127;
if(theta<-1.0)// -0.5
cuentas=127;
/* ___________________________________________ */
MainForm->Edit1->Text = FloatToStr (xd);
MainForm->Edit2->Text = FloatToStr (x);
MainForm->Edit4->Text = FloatToStr (theta);
MainForm->Edit5->Text = FloatToStr (t);
MainForm->Edit6->Text = IntToStr (conv);
//Sending output byte
MainForm->Acknowledge();
MainForm->send_byte(cuentas);
flagcom=0;
/* open/close a file */
if(flagfile==0)
if((ptrMonit=fopen("MONIT.TXT", "w"))==NULL){}
flagfile=1;
/*Write to file*/
fprintf(ptrMonit,"%3.3f\t%3.3f\t%3.3f\t%3.3f\t%3.3f\n",t,xd,
x,-iast,theta);
t=t+Ts;
}
}
//-------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner), SerialPort(1, ProcessByte), fAcknowledge(true)
{
if (SerialPort.IsReady() != TRUE)
MessageBox(NULL, "Problems with port", "Error", MB_OK);
}
//--------------------------------------------
void TMainForm::send_byte(unsigned char byte_sal)
{
if (fAcknowledge == false)
return;
SerialPort.WriteByte(byte_sal);
fAcknowledge = false;
}
//---------------------------------------------
void TMainForm::Acknowledge()
{
fAcknowledge = true;
}
void __fastcall TMainForm::Button1Click(TObject *Sender)
{
/* close the file */
fclose(ptrMonit);
Close();
}
//--------------------------------------------
14.8 PIC C Code Used to Program the Microcontroller PIC16F877A 853
In this section, the main steps are described to program the microcontroller
PIC16F877A used to exchange data between the computer and the mechanism. This
program is written in PIC C language and is listed below. The corresponding flow
diagram is presented in Fig. 14.21. After defining some libraries and constants, the
interruption “int_rb” is used to count pulses from the encoder. The number of pulses
are represented by the variable “cuenta”. The executable part of the program begins
at the instruction “void main(void)”. Then, “TMR0=0” is set to start the first sample
period, “cuenta=0” is set to fix θ = 0 as the initial position of the beam (the beam
must be horizontal at this position) and “PORTD=127” is set to fix to zero the initial
commanded electric current, i.e., to maintain the motor without movement as the
starting point. The instruction “while(TRUE)” defines an infinite cycle where the
control task is to be implemented. The ball position is measured via an analog/digital
converter at “conv=read_adc()”. The instructions “putc(0xAA); putc(cuentaH);
putc(cuentaL); putc(convH); putc(convL);” send the recognition code “0xAA” first,
and then the beam position and the ball position, in that order. The instruction
“while(TMR0<197)” defines a cycle where the microcontroller remains waiting for
two events: (i) For the computer to send back the computed desired current, which
is taken and sent to the digital/analog converter via the instructions “if(kbhit())
PORTD=getc();”, (ii) That the sample period elapses (0.01[s]), which is true when
PARAMETERS
854 14 Control of a Ball and Beam System
the variable TMR0 is equal to or larger than 197. Once this happens, TMR=0 is set
again and the program returns to the beginning of the infinite cycle “while(TRUE)”.
// PIC16F877A Microcontroller program
#include<16f877A.h>
#device adc=10 //adc, 10 bits
#include<stdlib.h>
#include<math.h>
#fuses HS,NOWDT,PUT,NOBROWNOUT,NOLVP,NOWRT,NOPROTECT,NOCPD
#use delay(clock=20000000)// (frequency Xtal)
//Config. serial port
#use rs232(baud=115200,XMIT=PIN_C6,RCV=PIN_C7,BITS=8,PARITY=N)
//ports and registers addresses
#byte OPTION= 0x81
#byte TMR0 = 0x01
#byte PORTA = 0x05
#byte PORTB = 0x06
#byte PORTC = 0x07
#byte PORTD = 0x08
#byte PORTE = 0x09
//------------main program------------//
void main(void)
{
set_tris_a(0b11111111);
set_tris_b(0b11111111);
set_tris_c(0b10000000); //pin config.
set_tris_d(0b00000000);
set_tris_e(0b11111111);
OPTION=0x07; //pre_scaler timer0, 1:256
PORTC=0;
TMR0=0;
14.9 Control Based on a PIC16F877A Microcontroller 855
cuenta=0;
AB=0;
AB_1=0;
PORTD=127;
setup_adc(ADC_CLOCK_INTERNAL); //Config. ADC
setup_adc_ports(ANALOG_RA3_REF);//Config. reference ADC
set_adc_channel(1);
delay_ms(3000);
enable_interrupts(global);
enable_interrupts(int_rb);
while(TRUE)
{
PC0=1; //sending starts
conv=read_adc();
inter=(conv)&(0xFF00);
convH=inter>>8;
convL=(conv)&(0x00FF);
inter=(cuenta)&(0xFF00);
cuentaH=inter>>8;
cuentaL=(cuenta)&(0x00FF);
INTERFACES-
MECHANISM
BEAM BALL
POSITION POSITION
Fig. 14.22 Block interfaces and ball and beam mechanism are shown in Fig. 14.24. The beam
position measurement system is composed of a potentiometer fixed to the beam shaft. The ball
position measurement system is shown in Fig. 14.23
prototype mechanical part has also been slightly modified, which will be described
in the following. A block diagram of the whole system that has been built is
presented in Fig. 14.22.
The new ball position x measurement system2 is shown in Fig. 14.23. It has the
same components as the sensor in Fig. 14.3, but the method used to measure the ball
position is different. In this case, rail number one is employed as an inductance at
whose terminals a 16[KHz] sinusoidal voltage is applied. Hence, this AC voltage
uniformly distributes along this coil and an AC voltage is obtained in rail number
two whose peak value is proportional to the ball position x on the beam. Then,
this signal is rectified and low-pass filtered by a RC circuit to minimize voltage
ripple. The voltage xv represents the ball position measurement, which is delivered
to the microcontroller through one of its analog/digital converters. This sensor gain
is computed as:
3.7625[V]
Ax = = 5.3750[V/m], (14.20)
0.7[m]
where the numerator is xv when the ball is at the right end of the beam and the
denominator is the beam length.
On the other hand, the beam position θ measurement system is a potentiometer
fixed to the beam shaft. The gain of this measurement system is computed as the
division of a voltage increment at the potentiometer terminals, 0.275[V], and the
corresponding angle increment θ , i.e., 0.3[rad]:
2 In
all the experiments that are presented in the remainder of this chapter, the ball position x is
measured from the left end of the beam.
0.65 [m] wood
1N4002
3.3kΩ
1nF 10kΩ
+ 15V
TL081 1kΩ
14.9 Control Based on a PIC16F877A Microcontroller
+
-
Zeners
10kΩ TIP41
25kΩ 4.7V
10kΩ 1nF TIP42
10kΩ
–15V
0.275[V]
Aθ = = 0.9167[V/rad]. (14.21)
0.3[rad]
were selected experimentally such that using a constant value for v1 (t) (see
Fig. 14.8), i.e., without feeding back the ball position error and without
using the lead compensator at the left of V1 (s), a fast and well-damped θ
response was obtained. Notice that α = 12 shown in (14.23) is different from
α = 30 in (14.19). This because of the changes made in the mechanism.
Using (14.20), (14.21), (14.22), (14.23) and the open-loop transfer function
in (14.16) the root locus method is employed to find that the following gains
ensure closed-loop stability:
The detailed procedure followed to obtain these gains is presented in Sect. 5.2.8.
14.9 Control Based on a PIC16F877A Microcontroller 859
xυ
9 8
1 μF
Tx
MAX232
11 6
12 5
1 μF
θυ
13 4
Rx Tx
+
Rx
to PC
DB9
5W
14
1Ω
1 μF
1 μF
15 2
+
16 1
1 μF
MCD
+
u
+5V
TIP141
TIP145
2
4
POWER AMPLIFIER
1
+15V
5
0.1 μF
DAC0800
-15V
6
+15V
0.1 μF
7
13
8
TL081
10 k Ω
+
-
3
12 11 10 9
0.01 μF
-15V
ui
16
4.7 k Ω
CURRENT
CONTROL
4.7 k Ω
330 Ω
1 kΩ
21 20
+15V
100 k Ω
22 19
TL081
Vref
23 18
+
-
24 17
25 16
PIC16F877A
26 15
20 MHz
15 pF
1 kΩ
1 kΩ
27 14
28 13
29 12
30 11
+5V
[-3.5,3.5] A
i
31 10
15 pF
– i*
32 9
+5V
TL081
4.7 k Ω
8
4.7 k Ω
33
+
-
34 7
35 6
36 5
37 4
38 3
39 2
33 kΩ
+5V
40 1
Fig. 14.24 Electric diagram of the ball and beam control system based on the PIC16F877A
microcontroller
xυ
[V]
θυ
[V]
t [s]
Fig. 14.25 Experimental results using microcontroller PIC16F877A
is the desired ball position. The small difference that is observed is due to the
dead zone produced by friction at the motor shaft. In Fig. 14.26, some simulation
results are presented using the same controller, the block diagram in Fig. 14.8 and
the numerical values in (14.20), (14.21), (14.22), (14.23), (14.24).3 Notice that the
responses in Figs. 14.25 and 14.26 are very similar despite the noise content in the
experimental prototype. Finally, in Fig. 14.27 some other experimental results are
presented where it is observed that the ball position xv is stabilized very close to its
desired value xvd = 1[V] despite an external agent hitting the ball several times.
These results show that the control objective has been accomplished: the ball is
stabilized very close to its desired position. Finally, a picture of the prototype used
in the experiments is shown in Fig. 14.28.
3 See Sect. 5.2.8 for instructions on how these simulations can be performed.
14.9 Control Based on a PIC16F877A Microcontroller 861
xυ
[V]
θυ
[V]
t [s]
Fig. 14.26 Simulation results
#include<16f877A.h>
//#device adc=10 //adc, 10 bits
#include<stdlib.h>
#include<math.h>
#fuses HS,NOWDT,PUT,NOBROWNOUT,NOLVP,NOWRT,NOPROTECT,NOCPD
xυ
[V]
θυ
[V]
t [s]
Fig. 14.27 Experimental results using the microcontroller PIC16F877A. Some ball position
deviations are introduced by an external agent
int8 cuentaH,cuentaL,puerto,AB,AB_1,aux;
int8 cont,iastd,cont2,cont3,cont4,t_0,t_1;
float x,xd,theta,error,iast,tiempo,c,b;
Fig. 14.28 Ball and beam system prototype used in the experiments
cuenta--;
else
cuenta++;
AB_1=AB;
}
//------------Main program------------//
void main(void) {
setup_adc(ADC_CLOCK_INTERNAL ); //ADC (internal clock)
set_tris_a(0b11111111);
set_tris_b(0b11111111);
set_tris_c(0b10000000); //serial communication
set_tris_d(0b00000000);
set_tris_e(0b11111111);
OPTION=0x07; //pre_scaler timer0, 1:256
PORTC=0;
TMR0=0;
cuenta=0;
AB=0;
AB_1=0;
enable_interrupts(global);
enable_interrupts(int_rb);
cont=0;
cont2=0;
cont3=0;
cont4=0;
PORTD=127;
xd=1.0;
tiempo=0.0;
864 14 Control of a Ball and Beam System
PARAMETERS
INCREASE TIME.
gamma=1.2;
c=20.0;
b=2.5;
alfa=12.0;
kv=0.2;
thetam1=0.0;
v=0.0;
ADCON1=0x04;
ADCON0=0x81;
while(cont2<3)
{
while(cont3<255)
{
TMR0=0;
while(TMR0<255)
{
}
cont3++;
}
cont2++;
}
TMR0=0;
while(TRUE)
14.9 Control Based on a PIC16F877A Microcontroller 865
{
ADCON0=0x81; //Changing to CH0
for(i=0;i<37;i++); /stabilizing internal capacitor
t_0=read_adc(); //reading ADC
x=0.0196*t_0;
error=xd-x;
/* Controller */
v1=gamma*(error+v);
v=(-c*v+(b-c)*error)*0.002+v;
iast=alfa*(v1-theta)-kv*(theta-thetam1)/0.002;
/* ___________________________________________ */
if(iast<-3.3)
iast=-3.3;
if(iast>3.3)
iast=3.3;
iast=-iast;
iastd=(unsigned int)(36.4286*iast+127);
PORTD=iastd;
thetam1=theta;
cuentaH=t_1;
cuentaL=t_0;
putc(0xAA); //serial port acknowledgment
putc(cuentaH); //sending to serial port
putc(cuentaL);
/*
iast=-iast;
iastd=(unsigned int)(36.4286*iast+127);
cuentaH=0x00;
cuentaL=(iastd)&(0xFF);
putc(0xAA); //serial port acknowledgment
putc(cuentaH); //sending to serial port
putc(cuentaL);
*/
PC1=1; //waiting for sampling time
while(TMR0<40) //1 count=(4/FXtal)*256 s, 20=1 ms
{
}
PC1=0; //sampling time is arrived
TMR0=0;
tiempo=tiempo+0.002;
} //closing infinite while
} //closing main
866 14 Control of a Ball and Beam System
14.10 Summary
In this chapter, a ball and beam system has been built in addition to all the necessary
interfaces for closed-loop control. The proposed control scheme has two loops. The
internal loop is useful to control the beam angle, whereas the external loop is used
to control the ball position. An interesting feature of the prototype that has been
built is the construction of the sensor used to measure the ball position. The main
idea is to build a channel composed of two rails which, together, work in a similar
manner to a potentiometer. Hence, the voltage delivered by this measurement system
is proportional to the position of the ball on the beam.
The controller design has been performed using both fundamental approaches
in classical control: time response (root locus) and frequency response (Nyquist
stability criterion and phase margin). The controllers that have been designed have
been tested through several experiments to observe the achieved performance.
Also, some interesting experiments have been performed to identify the system
parameters.
References
1. Quanser Inc. 119 Spy Court Markham, Ontario L3R 5H6, Canada. Available at: http://www.
quanser.com
2. P. V. Kokotovic, The joy of feedback: nonlinear and adaptive (1991 Bode Prize Lecture), IEEE
Control Systems Magazine, pp. 7–17, June 1992.
3. R. C. Hibbeler, Engineering Mechanics Dynamics, 10th. Edition, Prentice Hall, Upper Saddle
River, NJ, 2004.
References 867
The Furuta pendulum is depicted in Fig. 15.1. Controlling the Furuta pendulum
may be described by referring to the old trick known as the broomstick-balancing
problem. In a Furuta pendulum, the person’s arm is replaced by a beam technically
known as the arm, which receives the torque generated by a permanent magnet (PM)
brushed direct current (DC) motor at one of its ends. Hence, the arm can only move
on a horizontal plane such that its other end describes a circumference. At this end
another beam is placed, technically known as the pendulum, which joins to the arm
by means of some bearing allowing the pendulum free movement. This means that
no motor is placed at this joint. However, the bearing in this place constrains the
pendulum to only move by rotating on a plane that is orthogonal to the arm. This
means that the pendulum’s free end can only describe a circumference whose center
is placed at the point where the arm and the pendulum join.
One feature that renders the Furuta pendulum interesting to control is that it
is inherently unstable. This can be seen by recalling the broomstick-balancing
problem: the broomstick always tends to leave its inverted position, falling to the
floor. Hence, designing a controller for this problem is not a trivial task and it
requires the knowledge of suitable control theory tools.
The variables and the parameters involved in the Furuta pendulum depicted in
Fig. 15.1 are the following:
• θ0 is the arm angular position, in radians, measured with respect to some arbitrary
reference position.
• θ1 is the pendulum angular position, in radians, measured with respect to its
inverted position.
• τ is the torque generated by the electric motor that is applied to the arm.
• I0 is the arm inertia when it rotates around one of its ends plus the motor inertia.
• L0 is the arm length.
• m1 , l1 and J1 stand for the pendulum mass, the location of the center of mass,
and the inertia respectively. J1 is computed assuming that the pendulum rotates
Arm
Motor
around its center of mass. Note that the pendulum consists of a beam whose mass
is not negligible.
• g = 9.81[m/s2 ] is the gravity acceleration.
As described above, the Furuta pendulum is composed of two bodies that interact.
The mathematical model for this class of mechanisms is commonly obtained using
the Euler–Lagrange equations [1]. In the case of the Furuta pendulum, the Euler–
Lagrange equations are written as:
d ∂L ∂L
− = τ, (15.1)
dt ∂ θ̇0 ∂θ0
d ∂L ∂L
− = 0.
dt ∂ θ̇1 ∂θ1
The zero on the right-hand side of last equation indicates that no external torque
is applied at the place where the arm and the pendulum join. The Lagrangian L is
defined as:
L = K − P, (15.2)
K = K0 + K1 ,
15.1 Mathematical Model 871
where K0 is the arm’s kinetic energy, K1 is the pendulum’s kinetic energy, and P
is the pendulum’s potential energy. No potential energy is considered for the arm
because it moves on an horizontal plane, i.e., its potential energy can be assumed to
be zero.
The computation of the kinetic energy for a body whose mass is distributed
on a volume can be simplified if it is decomposed into two parts: one part due to
translational movement of the body’s center of mass (assumed to be a particle) and
the other part due to body’s rotative movement around its center of mass. However,
if the body movement can be described in a simple manner such a decomposition
is not necessary. For instance, the arm movement is easily described as a rotative
movement of a beam around one of its ends and the rotative movement of the motor
around the same axis. Hence, it is not difficult to find that:
1
K0 = I0 θ̇ 2 . (15.3)
2 0
On the other hand, the pendulum movement is more complex because it depends
on the combined movements of the arm and the pendulum. In this case, it is more
convenient to decompose the pendulum movement into two parts as explained
above: the translational movement of a particle with mass m1 located at the
pendulum center of mass and the rotative movement of a beam around an axis
passing through the pendulum’s center of mass. Hence:
1 1
K1 = J1 θ̇12 + m1 v1T v1 , (15.4)
2 2
where v1 is a vector that stands for the velocity of the pendulum center of
mass, i.e.,:
⎡ dXx ⎤ ⎡ ⎤
dt Xx
⎢ ⎥ ⎢ ⎥
v1 = ⎢
⎣
dXy
dt
⎥,
⎦ X=⎢ ⎥
⎣ Xy ⎦ , (15.5)
dXz
dt
Xz
⎡ ⎤ ⎡ ⎤
Xx L0 cos(θ0 ) − l1 sin(θ1 ) sin(θ0 )
X = ⎣ Xy ⎦ = ⎣ L0 sin(θ0 ) + l1 sin(θ1 ) cos(θ0 ) ⎦ . (15.6)
Xz l1 cos(θ1 )
Using (15.4), (15.5), (15.6) and after rearranging terms, the following is found:
872 15 Control of a Furuta Pendulum
Pendulum
Arm
Pendulum
Center
of mas
Arm
Fig. 15.2 Geometric relationships in the Furuta pendulum . (a) Superior view. (b) View of the
plane orthogonal to arm
15.2 A Controller to Swing Up the Pendulum 873
1 1
K1 = J1 θ̇12 + m1 (L0 θ̇0 )2 + (l1 θ̇0 )2 sin2 (θ1 ) + (l1 θ̇1 )2 + 2θ̇0 θ̇1 L0 l1 cos(θ1 ) .
2 2
(15.7)
Finally, to compute the pendulum potential energy, the point where θ1 = 0 is used
as the reference point, i.e., where P = 0. Hence, recalling that the potential energy
is the scalar product of the applied force vector, i.e., the pendulum’s weight m1 g,
and the distance vector going from the pendulum’s center of mass to the point where
P = 0, the following is obtained:
P = −hm1 g, h = l1 − l1 cos(θ1 ),
where the sign “−” is due to the fact that the vectors referred to above have an angle
that is greater than 90◦ . Then:
Swinging up of the pendulum is the task where the pendulum is taken from the
bottom stable position, i.e., θ1 = π , to the inverted unstable position, i.e., θ1 = 0
or θ1 = 2π . This is performed experimentally in Sect. 15.7 by using the following
controller:
874 15 Control of a Furuta Pendulum
kω
− det(M(q)) F (q, q̇) − kθ θ0 − kδ θ̇0
τ = kω
, (15.10)
kE E(q, q̇) + det(M(q)) (J1 + m1 l12 )
1 T
E(q, q̇) = q̇ M(q)q̇ + m1 gl1 (cos θ1 − 1),
2
1
F (q, q̇) = −(J1 + m1 l12 )m1 l12 θ̇1 θ̇0 sin(2θ1 ) − m21 l13 L0 θ̇02 cos θ1 sin(2θ1 )
2
−m21 l12 L0 g cos θ1 sin θ1 + (J1 + m1 l12 )m1 l1 L0 θ̇12 sin θ1 ,
kω
> 2m1 gl1 (I0 + m1 l12 + m1 L20 ).
kE
The controller in (15.10) was proposed in [2], chapter 6. The interested reader is
referred to that book for more details. Swinging up the pendulum in the Furuta
pendulum is not an easy task as the only motor in the mechanism actuates directly
on the arm but there is no motor actuating directly on the pendulum. The trick to
solving this problem is energy regulation, as we explain in the following. Suppose
that the Furuta pendulum’s total energy is equal to zero and θ̇0 = 0. Under these
conditions we have that:
1
E(q, q̇) = (J1 + m1 l12 )θ̇12 + m1 gl1 (cos θ1 − 1) = 0.
2
This means that:
2m1 gl1
θ̇1 = ± (1 − cos θ1 ). (15.11)
J1 + m1 l12
In Fig. 15.3 a plot of θ̇1 satisfying this expression is presented. This plot represents
the trajectory where the pendulum evolves when E(q, q̇) = 0 and θ̇0 = 0.
Moreover, its orientation represents the sense of movement of the pendulum
variables. According to Fig. 15.3, under these conditions the pendulum will reach
one of the configurations (θ1 , θ̇1 ) = (0, 0) or (θ1 , θ̇1 ) = (2π, 0). This suggests
regulating the Furuta pendulum’s total energy and the arm velocity at zero. Once this
is accomplished, it is only a matter of time for the pendulum to reach the inverted
unstable position. The controller in (15.10) is designed to achieve E(q, q̇) = 0,
θ̇0 = 0 and θ0 = 0 [2], chapter 6. The latter is required to avoid the arm rotating
many (or an infinite number of) times.
Consider the following function:
15.2 A Controller to Swing Up the Pendulum 875
θ̇1
[rad=s]
θ1
2π [rad]
kE 2 kω kθ
V (q, q̇) = E (q, q̇) + θ̇02 + θ02 . (15.12)
2 2 2
Note that:
These properties are exploited for controller design in [2], chapter 6. The main idea
is to choose (15.10) as a controller ensuring that V̇ (q, q̇) < 0 and V̇ (q, q̇) = 0
only when E(q, q̇) = 0, θ̇0 = 0 and θ0 = 0. This forces the system to move in a
direction that approaches the conditions E(q, q̇) = 0, θ̇0 = 0, and θ0 = 0. Once this
is achieved the system stays there, i.e., the trajectory in (15.11) is reached. See [2],
chapter 6, for more details. However, it is important to stress that this only ensures
that the pendulum’s inverted unstable configuration is reached, but this does not
ensure that the pendulum remains there. To force the pendulum to stay at the inverted
unstable configuration it is necessary to employ a stabilizing controller such as that
designed in Sect. 15.6. This is performed on the basis of an approximate linear
model of the Furuta pendulum, which is obtained in the next section.
876 15 Control of a Furuta Pendulum
This book is oriented to the application of linear control techniques, which cannot be
directly used when the model of the plant to be controlled is nonlinear such as that
shown in (15.9). However, there is a way of solving this problem. The fundamental
idea is to find an approximate linear model that represents the model with enough
accuracy (15.9) and, then, use such an approximate linear model for controller
design. As explained in Sect. 7.3.2, the controller designed in this way is useful
for balancing the pendulum at its inverted position θ1 = 0 only if the pendulum is
initially close to such a configuration and remains there, i.e., as long as θ1 ≈ 0.
The first step to this end is to write (15.9) in terms of its state variables. According
to Sect. 7.1, given a set of differential equations such as (15.9), a state variables
representation can be found by defining the state vector x components as the
differential equations’ unknown variables and their first r −1 time derivatives, where
r is the order of the corresponding differential equation. Note that (15.9) consists of
two second-order differential equations. The unknown variables in these differential
equations are θ0 and θ1 . Thus, the state vector can be chosen to be given as:
⎡⎤ ⎡ ⎤
x1 θ0
⎢ x2 ⎥ ⎢ θ̇0 ⎥
x=⎢ ⎥ ⎢ ⎥
⎣ x3 ⎦ = ⎣ θ1 ⎦ . (15.13)
x4 θ̇1
Using the ideas in Sect. 7.3.2, an approximate linear model is now obtained that
is valid around an operation point. The operation points are the pairs (x ∗ , u∗ )
15.3 Linear Approximate Model 877
satisfying:
⎡ ⎤
0
⎢ 0⎥
f (x ∗ , u∗ ) = ⎢
⎣0⎦,
⎥
i.e.,
where n can be any positive or zero integer. Note that there is no condition for
x1∗ = θ0∗ , which means that this variable can be chosen arbitrarily. As it is desired
to balance the pendulum at its inverted position, i.e., n = 0, the following operation
point is chosen:
⎡ ⎤ ⎡ ⎤
x1∗ 0
⎢ ∗⎥ ⎢ ⎥
x∗ = ⎢
x2⎥ ⎢0⎥ u∗ = 0.
⎣ x∗ ⎦ = ⎣ 0 ⎦ , (15.16)
3
x4∗ 0
According to (7.22), (7.23), (7.24), the nonlinear model in (15.14), (15.15), can be
approximated by the linear model:
ż = Az + Bv, (15.17)
878 15 Control of a Furuta Pendulum
⎡ ⎤
∂f1 (x, u) ∂f1 (x, u) ∂f1 (x, u) ∂f1 (x, u)
⎢ ∂x1 ∂x2 ∂x3 ∂x4 ⎥
⎢ ⎥
⎢ ∂f2 (x, u) ∂f2 (x, u) ∂f2 (x, u) ∂f2 (x, u) ⎥
⎢ ⎥
⎢ ∂x4 ⎥
A = ⎢ ∂f ∂x 1 ∂x2 ∂x3
∂f3 (x, u) ⎥ ,
⎢ 3 (x, u) ∂f3 (x, u) ∂f3 (x, u) ⎥
⎢ ⎥
⎢ ∂x1 ∂x2 ∂x3 ∂x4 ⎥
⎣ ∂f4 (x, u) ∂f4 (x, u) ∂f4 (x, u) ∂f4 (x, u) ⎦
∂x1 ∂x2 ∂x3 ∂x4 x=x ∗ ,u=u∗
⎡ ∂f (x, u) ⎤
1
⎢ ∂u ⎥
⎢ ∂f2 (x, u) ⎥
⎢ ⎥
⎢ ⎥
⎢
B=⎢ ∂u ⎥ ,
⎥
⎢ ∂f3 (x, u) ⎥
⎢ ∂u ⎥
⎣ ⎦
∂f4 (x, u)
∂u x=x ∗ ,u=u∗
The expressions (15.17), (15.18), represent the approximate linear model we were
looking for. It is important to stress that this model is also valid if x3∗ = θ1∗ = 2π .
This is because sin(x3∗ ) does not change when evaluated at x3∗ = 0 or x3∗ = 2π .
The reader is advised to verify this fact. As stated above, using (15.17) and (15.18),
a linear state feedback controller can be designed that, however, is only ensured to
perform well if the system state and the input are constrained to evolve around the
operation point (15.16). This is also stated by indicating that z ≈ 0 and v = u =
τ ≈ 0 (because u∗ = 0). This means that taking the pendulum from θ1 = π to
θ1 = 0, or θ1 = 2π , is a task that cannot be ensured with a controller designed
on the basis of the model (15.17), (15.18). Such a problem is solved by using the
controller in (15.10).
15.4 A Differential Flatness-Based Model 879
The differential flatness property of the model (15.17), (15.18) is studied in this
section. To simplify the algebraic manipulation of model (15.17), (15.18), the
following constants are defined:
Thus, the system (15.17), (15.18), is controllable. According to Sect. 8.2, Chap. 8,
this implies that the system (15.17), (15.18) is differentially flat. The inverse matrix
of Co is given as:
adj (Co )
Co−1 = , adj (Co ) = Cof T (Co )
det(Co )
where Cof T (Co ) is the transposed cofactors matrix of Co . After some straightfor-
ward computations we find:
⎡ ⎤
⎢ ⎥ 1
Co−1 =⎢
⎣
⎥ ,
⎦ det(Co )
C14 0 C34 0
. /
gm31 l13 L20 m21 l12 L20 − (J1 + m1 l12 )(I0 + m1 L20 )
C14 = ,
[I0 (J1 + m1 l12 ) + J1 m1 L20 ]4
880 15 Control of a Furuta Pendulum
(J1 +m1 l12 )2 (I0 +m1 L20 )
gm31 l13 L20 − m1 l1 L0 + m1 l1 L0 (J1 + m1 l1 )
2
C34 = ,
[I0 (J1 + m1 l12 ) + J1 m1 L20 ]4
where symbol “” indicates the entries of the matrix that we do not care for.
According to Proposition 8.1, the flat output y is given as:
⎡ ⎤
z1
⎢z ⎥
y=k C14
det(Co ) 0 C34
det(Co ) 0 ⎢ 2⎥
⎣ z3 ⎦ ,
z4
J1 + m1 l12
y = z1 + hz3 , h= .
m 1 l 1 L0
Using the model (15.17), (15.18), and differentiating the flat output y four times,
the following is found:
ẏ = z2 + hz4 , (15.19)
ÿ = (a + bh)z3 ,
y (3)
= (a + bh)z4 ,
y (4) = bÿ + d(a + bh)τ,
g(J1 I0 + I0 m1 l12 + J1 m1 L20 )
d(a + bh) = d < 0.
L0 [I0 (J1 + m1 l12 ) + J1 m1 L20 ]
Using the Laplace transform and assuming zero initial conditions the following
transfer function is found:
Y (s) d(a + bh)
= 2 2 , (15.20)
τ (s) s (s − b)
where Y (s) and τ (s) stand for the flat output and applied torque Laplace transforms
respectively. Note that this transfer function has a negative gain, because d(a +
15.5 Parameter Identification 881
√
0, and four real open-loop poles located at s = 0 (two of them), s = − b <
bh) < √
0, s = b > 0. Recall that b is a positive real number.
The joint between the pendulum and the arm is composed of an encoder and a
solid cylinder l = 0.019[m] in length, with a radius R = 0.012/2[m] and a mass
m = 0.015[Kg]. Inertia of this cylinder when rotating on its longitudinal axis is
given as [3, 4], pp. 271:
1
IC = mR 2 .
2
The pendulum is a stick with a mass m1 and length 2l1 . Inertia of this stick when
rotating on an axis that is orthogonal to the stick, passing through its longitudinal
center, is given as [3, 4], pp. 271:
1
I1 = m1 (2l1 )2 .
12
The pendulum inertia is computed by adding these inertias, i.e.,:
J1 = IC + I1 = 0.0001845[Kg m2 ].
The motor is a cylinder with a diameter D = 0.05[m]. It is assumed that the rotor is
also a cylinder with a diameter equal to one half the motor diameter, i.e., the rotor
radius is given as rr = 12 D2 . The motor mass is mm = 0.6[Kg]. The rotor mass is
assumed to be one half the motor mass, and 0.005[Kg] of a screw joining the arm
and the motor shaft must also be considered. Thus, the rotor inertia is computed as:
1 mm
Ir = + 0.005 rr2 .
2 2
The arm is a stick with a length L0 and mass m0 = 0.027[Kg] rotating on an axis
that is orthogonal to the arm, passing through one of its ends. Hence, the inertia of
this stick is [3]:
882 15 Control of a Furuta Pendulum
1
Is = m0 L20 .
3
Thus, the arm inertia is computed as:
I0 = Ir + Is = 0.00023849[Kg m2 ].
The numerical parameter values of the Furuta pendulum that has been built are
summarized in Table 15.1.
τ = −Kz, K = [k1 , k2 , k3 , k4 ],
= −k1 z1 − k2 z2 − k3 z3 − k4 z4 . (15.21)
This requires selection of the gain vector K such that all the eigenvalues of matrix
A − BK are suitably assigned. Of course, a basic requirement is that the real part of
all of the eigenvalues of matrix A − BK are negative. However, the eigenvalues of
matrix A − BK must also be assigned such that a desired closed-loop performance
is accomplished. Moreover, sometimes it is required to choose a new gain vector
15.6 Design of a Stabilizing Controller 883
K to further improve the performance. Solving this problem is not an easy task
in practice, where fast and damped eigenvalues are not the only things that matter
because of noise and some other problems related to hardware implementation.
In this section, a methodology is introduced to select the vector gain K that
exploits the differential flatness property of the system (15.17), (15.18). The main
idea is that a linear state space differentially flat system can be written in terms
of a transfer function without any zeros (see Sect. 15.4). Then, we can apply
classical control design tools such as the root locus to select the controller gains.
An advantage of this approach is that it gives the designer important information
on how to select the controller gains to improve performance in a desired direction.
This methodology is presented in detail in the following.
According to Sect. 15.4, the state space system (15.17), (15.18), is equivalent to
the transfer function in (15.20). To control this open-loop unstable plant consider the
block diagram in Fig. 15.4. Note that this is a multi-loop positive feedback system.
The reason for positive feedback is the negative gain d(a + bh) < 0. As a matter of
fact, the closed-loop transfer function is given as:
Y (s)
=
Yd (s)
βd(a + bh)
,
s 4 − d(a + bh)kv s 3 − (b + βd(a + bh))s 2 − kd βd(a + bh)s − kp βd(a + bh)
(15.22)
where Yd (s) = 0. It is not difficult to realize that a negative d(a + bh) renders
it possible for all the coefficients of the characteristic polynomial to be positive, a
necessary (but not sufficient) condition to ensure that all its roots have a negative
real part.
The transfer function of the two internal loops in Fig. 15.4 is given as:
k p + k ds
s1
–f Re(s)
s2
Hence, the block diagram in Fig. 15.4 can be rewritten as in Fig. 15.5. Using the
numerical parameters given in Table 15.1, the following is found:
±180◦ (2q + 1)
, q = 0, 1, 2, . . . ,
n−m
where n = 4 and m = 1, it is found that the root locus diagram of the block diagram
in Fig. 15.5 has three asymptotes at ±60◦ and ±180◦ with respect to the positive
real axis. Thus, f = kp /kd = 1 is proposed to shape the root locus diagram as
indicated in Fig. 15.6. Note that the open-loop zero at s = −f is not a closed-loop
zero as corroborated by (15.22). Choose kd = 2.88 and compute kp = kd f = 2.88
to assign the poles of (15.22) as shown in Table 15.2a).
According to the block diagram in Fig. 15.4, using the expressions in (15.19) it
is found that the controller is given as:
Table 15.2 Controller gains and the assigned open-loop and closed-loop poles
Controller gains Poles of (15.23) Poles of (15.22)
a) kv = 2.3755 × 10−4 , s1,2 = −14.4734 ± 14.0048j
−12.1989 ± 11.8679j,
β = 0.0041,
−2.7284,
kd = 2.88,
−1.8206
kp = 2.88
b) kv = 1.2 × 2.3755 × 10−4 , s1,2 = −17.3681 ± 17.4300j
−13.535 ± 14.37j,
β = 1.4 × 0.0041,
−6.3736,
kd = 4.59,
−1.2926
kp = 4.59
c) kv = 1.4 × 2.3755 × 10−4 , s1,2 = −20.2628 ± 19.8676j
−15.5358 ± 16.1280j,
β = 1.8 × 0.0041,
−8.2292,
kd = 5.62,
−1.2247
kp = 5.62
d) kv = 2 × 2.3755 × 10−4 , s1,2 = −28.9468 ± 21.6100j
−22.4899 ± 14.2991j,
β = 2.8 × 0.0041,
−11.7395,
kd = 7,
−1.1744
kp = 7
Using these relations and the numerical values in Table 15.1, the state feedback
controller gains presented in Table 15.3a) are obtained. It has been also verified that
the eigenvalues of matrix A − BK are equal to the poles of (15.22) presented in
Table 15.2a), as expected.
Some simulation results are presented in Fig. 15.7a (continuous line) when using
the model (15.22), the controller gains in Table 15.2a), i.e., in Table 15.3a), and
the numerical values in Table 15.1. All the initial conditions have been set to zero
except for y(0) = 1[rad]. A time constant of about 1[s] is observed, which means
886 15 Control of a Furuta Pendulum
Amplitude
0.6 0.6
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0 0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds) Time (seconds)
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time (seconds)
Fig. 15.7 Flat output y response obtained in simulation when using the controller (15.21) with
gains in Table 15.3 . (a) Continuous, Table 15.3a. Dashed, Table 15.3b. (b) Dashed, Table 15.3b.
Continuous, Table 15.3c. (c) Continuous, Table 15.3c. Dashed, Table 15.3d
that the transient response is dominated by the slowest closed loop pole located at
s = −1.8206.
Some other simulation results are shown in Fig. 15.8 when using the controller
in (15.10) to swing up the pendulum and the controller in (15.21) to stabilize the
pendulum at the inverted configuration. The Furuta pendulum parameters that have
been considered are those presented in Table 15.1. The controller gains for (15.21)
are shown in Fig. 15.3a) whereas the controller gains for (15.10) are KE = 1900,
kω = 1, kδ = 3, kθ = 3. All initial conditions were set to zero except for θ1 (0) =
2.9[rad]. The switching condition between the controllers is the following:
if: 3(θ1 − θ1d )2 + 0.1θ̇12 < 0.2, then the controller in (15.21) is on,
else: controller in (15.10) is on.
15.6 Design of a Stabilizing Controller 887
[rad]
[rad]
1 0.2 0
6
0
3
20 0.1
[Nm]
˙1 [rad s]
10 0.05
0 0
-10 -0.05
1 [rad] t [s]
-20 -0.1
0 3 6 9 0 10 20 30
4
[J]
E (q q̇) V (q q̇)
0.05
2
0
-0.05 0
t [s] t [s]
0 10 20 30 0 10 20 30
Fig. 15.8 Simulation results when swinging up and stabilizing the Furuta pendulum with the
controllers in (15.10) and (15.21)
[theta0] [theta0p]
theta0 [tauS]
tauS
Arm_pos [theta0p] ARM_VEL
theta0p
[theta0p] theta0p
[theta1] theta1 Arm_vel3
1 1
[E] [theta0]
Arm_vel E s s
Pend_pos2 [theta1] theta1
theta_0p theta_0 ARM_POS
[theta1] theta1
Pend_pos3 Q
[theta1p] theta1p
Pend_pos
[theta1p] theta1p
[V] Pend_vel2 1 1
V tau [tau] [theta1]
[theta1p] theta1p s s
Pend_vel3
Pend_vel [tauS] tauS Torque2 theta_1p theta_1 PENDULUM_POS
SWING-UPCONTROL [tau] tau
Torque
[tauE] tauE [theta1p]
[theta0] theta0
PENDULUM_VEL
Arm_pos1
[theta0p] theta0p
[theta0] theta0 [theta1] theta1 [tau] tauF [E] E
Arm_vel1 tauE [tauE]
theta__0 theta0 theta__1 theta1 Torque1 tau_F System_Energy
[theta1] theta1
Pend_vel1
in Appendix G. Once the simulation in Fig. 15.9 is run, the MATLAB code in
Sect. G.1.5 is executed in an m-file to obtain the plots in Fig. 15.8.
On the other hand, in Sect. 8.3, Chap. 8, it has been explained that a limit cycle
is expected to appear in practice when using the above controller together with the
controller gains in Table 15.2a). This requires the block diagram in Fig. 15.4 to be
modified to that in Fig. 8.7 where a dead zone “static” nonlinearity is considered.
Moreover, it has been shown that the closed-loop system can also be represented as
in Fig. 8.8 where:
is defined. Furthermore, it is shown in Sect. 15.7 that a limit cycle actually appears
in experiments. Recall that a dead zone nonlinearity is induced in servomechanisms
because of static friction at the motor shaft. As is presented in Sect. 15.7, in these
experiments it is observed that this limit cycle induces wide oscillations of the
Furuta pendulum arm. This motivates new designs intended to reduce the amplitude
of the oscillations. Moreover, the observed oscillations are also slow. This suggests
that the controller must increase the stiffness of the closed-loop system. As stiffness
is related to faster responses, this implies that the oscillation frequency must be
increased.
According to Sect. 8.3, to obtain limit cycles with smaller amplitudes the polar
plot of the equivalent open-loop transfer function G(s) must intersect the negative
real axis at a point σ located farther to the left. On the other hand, to increase the
frequency of the oscillations, the phase of G(j ω) must reach −180◦ at a greater
frequency ω = ωσ .
The point σ can be placed farther to the left of the negative real axis by increasing
the magnitude of G(s). According to the previous expression, this requires the
controller magnitude to be increased, i.e., to increase the controller gains kv and β.
On the other hand, according to Fig. 8.9, G(j ω) reaches a −180◦ phase at greater
frequencies if the phase lead contributed by the controller is forced to appear at
greater frequencies. As the cubic and the quadratic terms in G(s) contribute larger
phase leads at greater frequencies, we can force this phase lead to appear at greater
frequencies by rendering the coefficients of the first-order term and the constant term
larger than the coefficients of the cubic and the quadratic terms, i.e., by increasing
kd and kp .
Based on these ideas, additional sets of controller gains to be tested experimen-
tally are obtained in the following. Note, however, that these designs must ensure
closed-loop stability. Thus, we proceed using the root locus method employing
Fig. 15.6.
Our design strategy is to move the closed-loop poles farther to the left of the
imaginary axis. This suggests moving the open-loop zero at s = −f to the left.
However, this may create two root locus branches starting at the origin but belonging
to the right half-plane (see Fig. 15.6). This is because the zero at s = −f may attract
the open-loop complex conjugate poles at s1 , s2 , if it moves to the left. Hence,
890 15 Control of a Furuta Pendulum
1 Note, in Fig. 15.4, that kv and β are the feedback gains of signals ÿ and y (3) , which, according
to (15.19), represent feedback of the pendulum position and velocity, z3 = θ1 − θ1∗ and z4 = θ̇1 .
15.7 Experimental Tests 891
In Fig. 15.10 the experimental results obtained when the controller (15.10) (also see
[2], chapter 6) is used to swing up the pendulum and the controller (15.21) is used to
stabilize the mechanism at z = x − x ∗ = 0 are presented. The numerical parameters
KE = 480, kω = 1, kδ = 3, kθ = 17, were employed for controller (15.10) whereas
the gains in Table 15.3a) were used for controller (15.21). Note that the desired
pendulum position x3∗ = θ1∗ = 2π is reached and the pendulum remains there for
t ≥ 8.8[s]. However, the arm position does not reach the desired position x1∗ =
θ0∗ = 0 but oscillates around a nonzero arm position. To better observe this behavior
and to better compare with cases when different controller gains are employed, in
Fig. 15.11 a zoom-in on the variables θ0 and θ1 − 2π is presented. Moreover, the
time axis has been modified to consider t = 0 at the time when the stabilizing
controller (15.21) is switched on, i.e., when t = 8.8[s] in Fig. 15.10. Hence, it is
concluded that the pendulum really remains at θ1 = 2π whereas the arm describes
large peak-to-peak oscillations of about 0.6[rad] around a constant position of about
−0.8[rad].
1
[rad]
−1
−2
0 5 10 15 20 25 30 35
time [s]
7
6
5
4
[rad]
3
2
1
0
−1
0 5 10 15 20 25 30 35
time [s]
Fig. 15.10 Experimental results when using the controller gains in Table 15.3a). Top line: θ0 [rad].
Bottom line: θ1 [rad]
892 15 Control of a Furuta Pendulum
−0.5
[rad]
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
0.5
[rad]
−0.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.11 Experimental results when using the controller gains in Table 15.3a). Top line: θ0 [rad].
Bottom line: θ1 − 2π [rad]
y = z1 + hz3 , ÿ = (a + bh)z3 ,
and assume that the flat output oscillation is sinusoidal, i.e., y = Y0 sin(ωt) where
Y0 is a positive constant representing the oscillation amplitude. It is not difficult to
find that, under these conditions:
0.5
0
[rad]
−0.5
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.12 Experimental results when using the controller gains in Table 15.3a). Continuous:
y[rad]. Dashed: z1 [rad]. DashâĂŤdot: hz3 [rad]
hω2 ω2
z1 = Y 0 1 + sin(ωt), z3 = −Y0 sin(ωt). (15.26)
a + bh a + bh
This means that z3 is very small if the oscillation frequency is small and, hence,
y ≈ z1 . Note that, in Fig. 15.12, the oscillation frequency is, approximately, ω =
ω2
8.5 = 0.7392[rad/s], which yields a+bh = 0.0086. This explains why oscillations
2π
are not observed in the pendulum position and why z1 remains close to y in the
above experiments.
Finally, in Fig. 15.13 the phase plot of the pendulum variables during the
swinging-up stage of the experiment is presented. Note that the experiment begins
at (θ1 , θ̇1 ) = (π, 0) and finishes at (θ1 , θ̇1 ) = (2π, 0). The theoretical trajectory
described in Fig. 15.3 is also presented. As explained in Sect. 15.2, the controller
in (15.10) is intended to force the pendulum variables to converge to the trajectory
in Fig. 15.3. As observed in Fig. 15.13, this is almost accomplished and, because of
that, the pendulum swings up successfully. Note, however, that convergence to the
trajectory in Fig. 15.3 is not accomplished asymptotically because of the imperfec-
tions in control system implementation. Such system implementation imperfections
involve the fact that the power electronics stage in our experimental prototype is
not capable of supplying the electric current required by the controller (15.10) to
the DC motor used as actuator. Moreover, it is important to say that this has forced
us to multiply by a factor of 5.8 the torque computed with the controller in (15.10)
894 15 Control of a Furuta Pendulum
θ̇1
[rad=s]
θ1
2π [rad]
Fig. 15.13 Phase plot of the pendulum variables during the swinging-up stage of the experiment
(continuous). The trajectory presented in Fig. 15.3 is also shown here (dashed)
3 Torque computed by the stabilizing controller (15.21) is not multiplied by any factor different
from unity.
15.7 Experimental Tests 895
1
[rad]
−1
−2
0 5 10 15 20 25 30 35
time [s]
7
6
5
4
[rad]
3
2
1
0
−1
0 5 10 15 20 25 30 35
time [s]
Fig. 15.14 Experimental results when using the controller gains in Table 15.3b). Top line: θ0 [rad].
Bottom line: θ1 [rad]
2
the above values yield a+bhω
= 0.0250 which explains, again, why oscillations do
not appear in the pendulum position.
The results obtained when using the controller gains in Table 15.3c) show that the
limit cycle disappears. As can be seen in Figs. 15.17, 15.18, 15.19, the oscillation
amplitude in both the flat output y and the arm position θ0 are even smaller, whereas
the oscillation frequency has increased to about ω = 2π/2.3 = 2.7318[rad/s].
Furthermore, both these variables reach constant values, i.e., oscillation disappears,
for t ≥ 7[s] in Figs. 15.18 and 15.19. Note that the pendulum position reaches its
desired constant value. The constant steady-state error in the arm position is about
0.2[rad], i.e., even smaller than the mean error of −0.35[rad] for controller gains in
Table 15.3b).
Note the following. The small threshold δ in a dead zone nonlinearity (see
Sect. 8.3) is uncertain and changes during normal operation because static friction
also has these properties. As no movement is produced when the generated torque
is smaller than δ (or the applied voltage is small enough), we may wonder whether
limit cycles might be avoided by forcing them to appear only at a very small
amplitudes. Hence, this may explain why limit cycle has disappeared.
It is important to say, however, that limit cycle avoidance is not achieved
every time an experiment is performed with the controller gains in Table 15.3c).
896 15 Control of a Furuta Pendulum
−0.5
[rad]
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
0.5
[rad]
−0.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.15 Experimental results when using the controller gains in Table 15.3b). Top line: θ0 [rad].
Bottom line: θ1 − 2π [rad]
Sometimes very small and very slow oscillations are observed on both z1 and
y whereas z3 remains at zero with no oscillations. Thus, limit cycle avoidance
appears as a random event, perhaps because, as stated earlier, the small threshold
δ is uncertain and changes during normal operation.
In Figs. 15.20, 15.21, 15.22, the experimental results obtained when using the
controller gains in Table 15.3d) are presented. t = 0 is set in Figs. 15.21 and 15.22
at the point of time in Fig. 15.20 where t = 3.95[s]. Note that, again, a limit cycle
is not present, i.e., the pendulum and arm positions in addition to the flat output,
reach constant values in a steady state after the stabilizing controller (15.21) is
switched on. It is also observed that the pendulum reaches the desired position
θ1∗ = 2π and the arm remains closer to its desired position, θ0∗ = 0, than in the
case where the controller gains in Table 15.3c) were used. Note that the oscillation
frequency is difficult to measure in this case, but comparing the settling times in
Figs. 15.21 and 15.18 we conclude that the frequency is greater for the controller
gains in Table 15.3d).
Recall that, according to theoretical arguments, the controller gains in
Table 15.3d) are expected to result in even smaller amplitude oscillations than
when the controller gains in Table 15.3c) are used. On the other hand, it has been
15.7 Experimental Tests 897
0.5
0
[rad]
−0.5
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.16 Experimental results when using the controller gains in Table 15.3b). Continuous:
y[rad]. Dashed: z1 [rad]. Dashdot: hz3 [rad]
1
[rad]
−1
−2
0 5 10 15 20 25 30 35
time [s]
7
6
5
4
[rad]
3
2
1
0
−1
0 5 10 15 20 25 30 35
time [s]
Fig. 15.17 Experimental results when using the controller gains in Table 15.3c). Top line: θ0 [rad].
Bottom line: θ1 [rad]
898 15 Control of a Furuta Pendulum
−0.5
[rad]
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
0.5
[rad]
−0.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.18 Experimental results when using the controller gains in Table 15.3c). Top line: θ0 [rad].
Bottom line: θ1 − 2π [rad]
0.5
0
[rad]
−0.5
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.19 Experimental results when using the controller gains in Table 15.3c). Continuous:
y[rad]. Dashed: z1 [rad]. Dash–dot: hz3 [rad]
15.7 Experimental Tests 899
1
[rad]
−1
−2
0 5 10 15 20 25 30 35
time [s]
7
6
5
4
[rad]
3
2
1
0
−1
0 5 10 15 20 25 30 35
time [s]
Fig. 15.20 Experimental results when using the controller gains in Table 15.3d). Top line: θ0 [rad].
Bottom line: θ1 [rad]
previously explained that forcing, by design, limit cycles to appear only for small
amplitudes may result in limit cycle avoidance. This, again, explains why a limit
cycle is not present for when the controller gains in Table 15.3d) are used.
The Furuta pendulum prototype used to perform all the above experiments is
equipped with an internal electric current loop, driven by a linear proportional–
integral (PI) controller, whose task is to force the electric current i flowing through
the DC motor used as an actuator to reach a desired value id . This desired value
is computed as id = τd /km , where km is the torque constant of the motor and
τd is torque computed by either (15.10) or (15.21). As the motor generates an
electromagnetic torque given as τ = km i, if i is equal to id , then τ = τd , which
means that the motor generates exactly the torque required by both the swinging-up
and the stabilizing controllers. Achieving i = id is the task of the linear PI electric
current controller cited above, which requires careful design of the gains kpi and
kii for this PI controller. In all the above experiments we have used kpi = 0.8 and
kii = 130.
In the following, an example is presented to show how the controller gains kpi
and kii may affect the closed-loop system performance. In Figs. 15.23, 15.24, 15.25
some experimental results are presented when using the controller gains in
900 15 Control of a Furuta Pendulum
0.5
0
[rad]
−0.5
−1
0 2 4 6 8 10 12 14 16 18 20
time [s]
0.5
[rad]
−0.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.21 Experimental results when using the controller gains in Table 15.3d). Top line: θ0 [rad].
Bottom line: θ1 − 2π [rad]
0.5
0
[rad]
−0.5
−1
−1.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.22 Experimental results when using the controller gains in Table 15.3d). Continuous:
y[rad]. Dashed: z1 [rad]. Dash-dot: hz3 [rad]
15.7 Experimental Tests 901
Table 15.3d) and kpi = 0.03 and kii = 130. t = 0 is set in Figs. 15.24 and 15.25
at the point of time in Fig. 15.23 where t = 9[s]. Note that all three variables,
the pendulum and the arm positions in addition to the flat output, are oscillatory
the whole time that the stabilizing controller (15.21) is switched on. Despite this,
the pendulum remains around the inverted position θ1∗ = 0 and the arm remains
close to its desired position θ0∗ = 0. Note that the oscillation frequency is about
2
ω = 2π/0.15 = 41.8879[rad/s], which yields a+bh ω
= 27.7230
1. This
and (15.26) explain why the amplitude of oscillations in the pendulum position
z3 , or hz3 , is much larger that of the oscillation in the flat output y; hence, the
oscillation in the arm position z1 has the same amplitude as that in hz3 . Moreover,
it is clear from Fig. 15.25 that the oscillation in hz3 is 180◦ out of phase with
respect to the oscillation in z1 . This is also explained by (15.26). Finally, note, from
Fig. 15.25, that the settling time of y is very close to that in Fig. 15.7c, which has
been obtained through simulations.
Despite these spectacular experimental corroborations of theoretical predictions,
we wonder why a limit cycle exists. Recall that according to theoretical arguments,
the controller gains in Table 15.3d) are expected to result in even smaller amplitude
oscillations than when the controller gains in Table 15.3c) are used. Thus, the reader
may wonder why a clear limit cycle appears again for the gains in Table 15.3d)
despite limit cycles being avoided for the gains in Table 15.3c).
In Fig. 15.26, the measured electric current through the motor i and the desired
current id computed as id = τd /km are presented. Note that i has a phase lag
of 90◦ with respect to id for t ≥ 9[s], i.e., for the whole time when the linear
stabilizing controller (15.21) is switched on. According to Fig. 8.9, an additional
phase lag of 90◦ appearing at any place in the loop of Fig. 8.8 is enough to produce
closed-loop instability. According to Fig. 15.26 such a phase lag is contributed by
the DC motor electric dynamics, which has been neglected during the design stage.
Moreover, it can be observed in Fig. 15.26 that the amplitude of i increases until
a maximum amplitude is reached. This shows instability despite the fact that the
electric current amplitude does not grow to infinity because, as we have explained
before, it saturates, as the power electronics stage of our prototype can only supply
a limited maximal electric current.
In Sect. 8.3.4 a limit cycle study is presented when a saturation nonlinearity
is present and the electric dynamics of the DC motor used as actuator is taken
into account. There, the corresponding closed-loop block diagram is that shown in
Fig. 8.15. The plant model and the parameters considered in that study correspond
to the Furuta pendulum with parameters in Table 15.1 and the controller gains
considered in this part of the present chapter, i.e.,:
Moreover, in Sect. 8.3.4, the following motor parameters are also considered:
which correspond to the DC motor actually used in the Furuta pendulum prototype
that has been employed to perform the experiments reported in the present chapter.
In Sect. 8.3.4 it is found that a stable limit cycle exists when kpi = 0.03.
Moreover, the closed-loop system is unstable but the limit cycle converts such
instability into a sustained oscillation, i.e., a stable limit cycle. This limit cycle is
predicted to appear at a frequency ω ≈ 48[rad/s], i.e., approximately the same
frequency measured in Figs. 15.23, 15.24, 15.25. Thus, these experimental results
are formally explained by the study on limit cycles performed in Sect. 8.3.4.
To solve this problem kpi has been increased from 0.03 to kpi = 0.8 and kii =
130 is kept. The reason for this is that kpi contributes with an open-loop zero located
at s = −kii /kpi . Hence, if kpi is larger, this open-loop zero increases the phase lead
for any given frequency, thus reducing the phase lag contributed by the DC motor
electric dynamics and restoring closed-loop stability.
In Sect. 8.3.4, it is also found that any stable limit cycle due to saturation does
not exist when kpi = 0.8. Moreover, the closed-loop system is stable in this case.
Thus, the selection of kpi = 0.8 is formally justified by the study on limit cycles
performed in Sect. 8.3.4.
1
[rad]
−1
−2
0 5 10 15 20 25 30 35
time [s]
7
6
5
4
[rad]
3
2
1
0
−1
0 5 10 15 20 25 30 35
time [s]
Fig. 15.23 Experimental results when using the controller gains in Table 15.3d). Top line: θ0 [rad].
Bottom line: θ1 [rad]
15.7 Experimental Tests 903
0.5
0
[rad]
−0.5
−1
0 2 4 6 8 10 12 14 16 18 20
time [s]
0.5
[rad]
−0.5
0 2 4 6 8 10 12 14 16 18 20
time [s]
Fig. 15.24 Experimental results when using the controller gains in Table 15.3d). Top line: θ0 [rad].
Bottom line: θ1 [rad]
1.5
1
[rad]
0.5
−0.5
0 1 2 3 4 5 6 7 8 9 10
time [s]
Fig. 15.25 Experimental results when using the controller gains in Table 15.3d). Smallest
amplitude oscillatory line: y[rad]. Lower oscillatory line: z1 [rad]. Upper oscillatory line: hz3 [rad]
904 15 Control of a Furuta Pendulum
1
[A]
−1
−2
−3
8.6 8.8 9 9.2 9.4 9.6
time [s]
Fig. 15.26 Experimental results when using the controller gains in Table 15.3d) and kpi = 0.03
and kii = 130. Continuous: id [A]. Dashed: i[A]
Finally, let us say that in a first series of experiments kpi = 0.03 and kii = 130
have been used. Although we have found good results for the controller gains in
Table 15.3a),b),c), we have found the problem described in Figs. 15.23, 15.24, 15.25
for the controller gains in Table 15.3d). Once the problem was understood, the PI
electric current controller gains have been adjusted to kpi = 0.8 and kii = 130 and
all the experiments were repeated using these gains. These final experimental tests
are those that we have presented above.
A Furuta pendulum has been built whose numerical parameters are shown in
Table 15.1. A picture of this Furuta pendulum is presented in Fig. 15.27 and the
electric diagram of the complete control system is depicted in Fig. 15.28. The
control algorithm is implemented in a Builder 6 C++ program, which is executed
by a portable computer. The portable computer receives the mechanism output data
from a PIC16F877A microcontroller [7] and sends the mechanism input data back
to the microcontroller. Then, the microcontroller sends the corresponding voltage
signal to the motor. The Builder 6 C++ program executed by the portable computer
and the C program executed by the microcontroller are listed in Sects. 15.10
and 15.11 respectively.
15.8 Control System Construction 905
The L298 integrated circuit contains two full-bridge drivers that are parallel
connected to be used as a power amplifier. The power signal is applied on a
PM brushed DC motor model Tohoko Ricoh 7K00011, which is employed as the
mechanism actuator. This motor is provided with a 400 pulses/revolution encoder,
which is used to measure the arm position. The pendulum position is measured by
a 1000 pulses/revolution encoder model S1-1000-250-I-B-D from USDigital (the
bottom encoder in Fig. 15.28). Communication between the portable computer and
the microcontroller is rendered possible by a MAX232. Finally, three AND logic
gates manage the enable bits for the L298 full-bridge. The complete control system
is put to work through SWITCH_1.
The mechanism is provided with an electric current loop with a PI controller
driven by the difference id − i, where i is the electric current through the motor
armature and id is the desired current. The desired current is computed as id =
τ/km , where τ is obtained from either (15.10) or (15.21) and km = 0.0368[Nm/A].
This ensures that i ≈ id for all time; hence, torque generated by the motor is
approximately equal to the desired torque given by either (15.10) or (15.21). The
electric current through the motor armature i is converted to a voltage signal by
a 1[Ω], 5[W], power resistance, which is series connected to the motor armature
terminals. This voltage is measured by the differential voltage amplifier located at
the left upper corner in Fig. 15.28. After that, this signal is suitably amplified and an
adder amplifier is used to center the zero current value at a +2.5[V] level. Then, the
measured current is low-pass filtered and sent to a 10-bit analog/digital converter in
the microcontroller whose input analog range is [0, +5][V]. This allows the electric
current to be measured in the range [−2.5, +2.5][A]. Recall that the 1[Ω] power
906
resistance converts the electric current into a voltage signal whose numerical value
is equal to the electric current in amperes.
Some of the results presented in this chapter were reported for the first time
in [6].
As explained in [5], the most severe limitation of the size of the available bandwidth
is the sampling period Ts . It is also suggested in [5] that the sampling frequency ωs
might be selected such that:
ωs
= 16, (15.29)
Ωa
r2 − 2
x= , y = − 1 − x2, (15.30)
2
The phase margin is then computed as:
908 15 Control of a Furuta Pendulum
y
Kf = arctan . (15.31)
x
The numerical values that have been tested and the results obtained
using (15.27)–(15.31) are presented in Table 15.4. The numerical√ values in
Table 15.1 have also been taken into account to compute b. Phase margins
obtained with 5[ms] and 10[ms] sampling periods are considered to be acceptable.
Moreover, recall that these phase margins may be rendered larger as the sensitivity
can be designed to be smaller, at some specific frequencies, than Smin in Table 15.4.
Of course, the price for this is that the sensitivity would be larger at some other
frequencies, as explained in Sect. 8.4. Finally, because of hardware limitations, a
sampling period smaller than 10[ms] has not been accomplished. Thus:
Ts = 10[ms]
is the sampling period used to control the Furuta pendulum that has been built.
In this section, the Builder 6 C++ program executed by the portable computer is
presented. In the following, some of the most important parts of this computer
program are explained. The corresponding flow diagram is presented in Fig. 15.29.
First, some important constants, such as the mechanism parameters and the
controller gains, are defined. The control cycle is contained in the instruction
“void ProcessByte(BYTE byte)”. At the beginning of the control cycle, the arm
position is first read, then the pendulum position is obtained, and, finally, the electric
current is read. These variables are converted into radians and amperes respectively.
Note that a 2000 constant value is added to the pendulum encoder count. This is
done to assign θ1 (0) = π when the pendulum is at its bottom stable position,
i.e., the pendulum’s initial position. The inverted pendulum position “theta1d” is
assigned to be either 0[rad] or 2π [rad], depending on which of these values is
more suitable. The condition to switch on the stabilizing controller (15.21) is set as
3(θ1 −theta1d)2 + θ̇12 < 0.05. If this is not the case then the controller (15.10) is kept
working. Once this decision is taken, the torque to be applied is computed by the
corresponding controller. In the case of the swinging-up controller, torque that must
15.10 The Builder 6 C++ Program 909
#include <dos.h>
//------------------------------------------------------
#pragma package(smart_init)
#pragma link "CSPIN"
#pragma resource "*.dfm"
//------------------------------------------------------
#define Ts 0.01
#define pprb 400.0
#define pprp 1000.0
#define pi_ 3.141593
#define kpi 0.8 // 0.03
#define kii 130.0
#define bi -2.5
#define VM 10.0
#define IM 2.5
//-------------------Swing up controller----------------
#define ke 480
#define kw 1.0
#define kth 17.0
#define kd 3.0
//----------------Some constants------------------------
#define g 9.81
#define km 0.0368
// ------------- Furuta pendulum parameters ---------------
#define m1 0.02218
#define l1 0.129
#define L0 0.1550
#define J1 0.0001845
#define I0 0.00023849
#define K 5.8
#define k1 0.0415
#define k2 0.0415
#define k3 0.5189
#define k4 0.0728
// --------------------------------------------
FILE *ptrMonit;
TMainForm *MainForm;
unsigned char flagcom=0,flagfile=0,signo_sal,pwm; // 8 bits
unsigned short int pos1,pos2,corr; // 16 bits
float uf,pwmf,t=0,escp=pi_/(2.0*pprp),escb=pi_/(2.0*pprb);
float cambio=-1.0,signo,theta1=pi_,tau,E,F,det_d;
float norma2,theta0p=0,theta1p=0,theta0_1=0,theta1_1=0,
theta0=0;
float st1,ct1,s2t1,l1c=l1*l1,m1c=m1*m1,L0c=L0*L0,theta0pc;
float CF1=-(J1+m1*l1c)*m1*l1c,CF2=-0.5*m1c*l1c*l1*L0;
float CF4=-m1c*l1c*L0*g,theta1pc,V,theta1d,CF3=(J1+m1*l1c)
*m1*l1*L0;
float id,ic,ei,propi,intei,mi=2.0*IM/1023.0,iTs=1/Ts,
escs=127/VM;
float au1,au2,au3;
//----------------------------------------------------------------
void ProcessByte(BYTE byte)
{
if(flagcom!=0)
15.10 The Builder 6 C++ Program 911
flagcom++;
if((byte==0xAA)&&(flagcom==0))
{
pos1=0;
pos2=0;
corr=0;
flagcom=1;
}
if(flagcom==2)
{
pos1=byte;
pos1=pos1<<8;
}
if(flagcom==3)
{
pos1=pos1+byte;
}
if(flagcom==4)
{
pos2=byte;
pos2=pos2<<8;
}
if(flagcom==5)
{
pos2=pos2+byte+2000;
}
if(flagcom==6)
{
corr=byte;
corr=corr<<8;
}
if(flagcom==7)
{
theta0_1=theta0;
theta1_1=theta1;
corr=corr+byte;
ic=mi*corr+bi;
theta0=(signed short int)pos1;
theta0=escb*theta0; //arm position
theta1=(signed short int)pos2;
teta1=escp*teta1; //pendulum position
theta0p=(theta0-theta0_1)*iTs; //arm velocity
theta1p=(theta1-theta1_1)*iTs; //pendulum velocity
if(theta1<pi_)
{
theta1d=0.0;
}
else
{
theta1d=6.2832;
}
norma2=3.0*(theta1-theta1d)*(theta1-theta1d)+theta1p*theta1p;
if((norma2<0.05)||(cambio==1.0))
{
912 15 Control of a Furuta Pendulum
PARAMETERS
15.11 The PIC16F877A Microcontroller C Program 915
BC=((puerto)&(0xC0))>>6;
916 15 Control of a Furuta Pendulum
aux=BC^BC_1;
if(aux!=0)
if(aux!=3)
if(((BC_1<<1)^BC)&(0x02))
{
cuenta2--;
}
else
{
cuenta2++;
}
BC_1=BC;
}
while(TRUE)
{
conv=read_adc();
inter=(conv)&(0xFF00);
convH=inter>>8;
15.11 The PIC16F877A Microcontroller C Program 917
convL=(conv)&(0x00FF);
PD4=1; //data sending starts
inter=(cuenta1)&(0xFF00);
cuentaH1=inter>>8;
cuentaL1=(cuenta1)&(0x00FF);
inter=(cuenta2)&(0xFF00);
cuentaH2=inter>>8;
cuentaL2=(cuenta2)&(0x00FF);
15.12 Summary
In this chapter, a Furuta pendulum has been built, in addition to all the interfaces
required for closed-loop control. The control scheme that has been used is known as
linear state feedback control. It consists in measuring the positions and the velocities
of both bodies comprising the mechanism to multiply them by constants and then
adding these terms to compute the torque that must be generated by the DC motor
used as an actuator. As the mechanism is unstable and nonlinear, the solution of
this control problem and the experimental evaluation of the designed control system
are of great interest. In this problem, the Euler–Lagrange equations for physical
system modeling are very useful. This approach is particularly valuable when
modeling mechanical systems composed of several bodies that describe independent
movements (degrees-of-freedom).
In this chapter, it has been explained how to obtain the numerical values
of the mechanism parameters. This is important to stress, as each of the two
bodies comprising the mechanism is composed of smaller mechanical pieces, each
contributing to the total body mass, center of mass, and inertia. It has been shown
that the classical mechanics formulas related to these variables are useful for
computing the mechanism parameters.
A linear approximate model has been obtained from the complete nonlinear
model of the mechanism. This step is instrumental in designing a controller for
this mechanism, which, however, is valid only if the initial configuration of the
mechanism is close to the desired configuration.
References
1. H. Goldstein, C. Poole, and J. Safko, Classical Mechanics, Chapter 1, 3rd Edition, Addison
Wesley, New York, 2000.
2. I. Fantoni and R. Lozano, Non-linear control for underactuated mechanical systems, Springer,
London, 2002.
3. R. C. Hibbeler, Engineering Mechanics Dynamics, 10th Edition, Prentice Hall, Upper Saddle
River, NJ, 2004.
4. M. Alonso and E. J. Finn, Physics, Addison-Wesley, Reading, MA, 1992.
5. G. Stein, Respect the unstable, IEEE Control Systems Magazine, August, pp. 12–25, 2003.
6. V. M. Hernández-Guzmán, M. Antonio-Cruz, and R. Silva-Ortigoza, Linear state feedback
regulation of a Furuta pendulum: design based on differential flatness and root locus, IEEE
Access, Vol. 4, pp. 8721–8736, December, 2016
7. PIC16F877A Enhanced Flash Microcontroller, Data sheet, Microchip Technology Inc., 2003.
8. Custom Computer Services Incorporated, CCS C Compiler Reference Manual, 2003.
Chapter 16
Control of an Inertia Wheel Pendulum
In this chapter, a control strategy is designed for a mechanism known as the inertia
wheel pendulum (IWP). A picture of the IWP is shown in Fig. 16.1 when operating
at the downward position, whereas the variables and the parameters involved are
defined in Fig. 16.2. It is a pendulum with a PM brushed DC motor fixed at its free
end, which actuates on a wheel. The pendulum hangs up from a point where no
external torque is applied. It is said that this point is not actuated but the wheel is
actuated because it receives torque generated by the motor. As the pendulum and
the wheel define two-degrees-of-freedom [1] but there is only one actuator (at the
wheel), the mechanism is said to be underactuated [2].
The IWP was introduced by Spong et al. [2], and aside from its academic
applications it is also widely used for research purposes as a workbench for
nonlinear controllers [2–11].
The nomenclature employed is the following:
• q1 is the pendulum angular position.
• q2 is the wheel angular position.
• m1 is the pendulum mass.
• m2 is the wheel mass.
• τ is torque applied at the wheel.
• lc1 is the location of the pendulum’s center of mass.
• l1 is the pendulum’s length.
• I1 is the pendulum’ inertia when rotating around its center of mass.
• I2 is the wheel inertia (plus the motor rotor inertia).
• g is the gravity acceleration.
• R is the motor armature resistance.
• L is the motor armature inductance.
lc1
l1
m1
I1
q1
q2
τ
m2 I2
• kb and km are the motor counter electromotive force constant and the motor
torque constant.
• u and i stand respectively, for voltage applied at the motor armature terminals
and the electric current through the motor armature.
According to the above description of the IWP, it is clear that it is not easy to take
the pendulum directly from q1 = 0, q̇1 = 0, to q1 = +π , or q1 = −π , and
q̇1 = 0. Moreover, the latter configuration is unstable and it is known as the inverted
unstable configuration. Thus, it is of interest to design a control strategy such that:
16.2 Mathematical Model 923
(i) The pendulum is taken from a vicinity of q1 = 0, q̇1 = 0, to the inverted unstable
configuration, (ii) The pendulum stays at the inverted unstable configuration. The
first part of this task is known as the pendulum swing up and the second part is
known as the pendulum balancing.
In this chapter it is shown that solution of the swing up problem requires the use
of nonlinear control techniques because the IWP has a nonlinear model. Although
nonlinear, the model of this mechanism is straightforward enough to design a
control strategy using simple ideas. One important objective in including this control
problem is to introduce the reader, using a basic example, to nonlinear control
systems techniques.
d ∂L ∂L
− = 0, (16.1)
dt ∂ q̇1 ∂q1
d ∂L ∂L
− = τ.
dt ∂ q̇2 ∂q2
The zero on the right-hand side in the first expression indicates that no external
torque is applied at the point where the pendulum hangs up. The Lagrangian is
given as:
L = K − P, (16.2)
K = K1 + K2 , P = P1 + P2 ,
where K1 and K2 represent the kinetic energies of the pendulum and the wheel
respectively, whereas P1 and P2 represent the potential energies of the pendulum
and the wheel respectively. As the pendulum is a body with a mass distributed along
a stick, its kinetic energy is computed by adding the kinetic energy of a particle of
mass m1 , which translates on a circumference with radius lc1 and the kinetic energy
of a stick that rotates around its center of mass, i.e.,:
1 1
K1 = 2 2
m1 lc1 q̇1 + I1 q̇12 .
2 2
The kinetic energy of the wheel is obtained in a similar manner. However, it must
be taken into account that the wheel’s angular velocity, as measured by an observer
fixed to the laboratory, is q̇1 + q̇2 . Then, the following is found:
924 16 Control of an Inertia Wheel Pendulum
1 1
K2 = m2 l12 q̇12 + I2 (q̇1 + q̇2 )2 .
2 2
To compute the potential energy, the configuration where q1 = 0 is used as
reference, i.e., where P1 = 0 and P2 = 0. Recall that the pendulum potential energy
is given as the product of force applied to the pendulum, i.e., the pendulum weight,
and the component parallel to the pendulum weight of the distance between the
pendulum’s center of mass at the actual position q1 and position of the pendulum’s
center of mass where the pendulum’s potential energy is zero, i.e., when q1 = 0.
Then:
Proceeding in a similar manner, it is found that the wheel’s potential energy is given
as:
1 1 1 1
L= 2 2
m1 lc1 q̇1 + I1 q̇12 + m2 l12 q̇12 + I2 (q̇1 + q̇2 )2 − gm(1 − cos(q1 )),
2 2 2 2
where m = m1 lc1 + m2 l1 . Replacing L in the Euler–Lagrange equations (16.1) and
after suitably arranging the resulting terms, the following is found:
q̈ mg sin (q1 ) 0
D 1 + = , (16.3)
q̈2 0 τ
2 + m l2 + I + I
d11 d12 m1 lc1 2 1 1 2 I2
D= = .
d21 d22 I2 I2
The model in (16.3) is the most complete one for the IWP and it will be used in the
next section to design a control strategy to swing up the pendulum to the inverted
unstable configuration.
Voltage applied at the armature terminals of the PM brushed DC motor actuating
on the wheel is the actual control signal, i.e., the variable that can be directly
manipulated, whereas torque at the wheel is a variable that is a consequence of
the application of such a voltage. However, in practice it is possible to assume that
torque at the wheel is the control signal if it is supposed that the armature inductance
is small. The armature circuit model of a PM brushed DC motor is the following:
16.3 Swing Up Nonlinear Control 925
di
La + Ri + kb q̇2 = u. (16.5)
dt
If La and kb are assumed to be zero, then:
km
τ = km i = u. (16.6)
R
This means that the applied voltage has a direct effect on the generated torque;
hence, it is reasonable to assume that torque is the control signal. Assuming kb to be
zero is justified as follows. It is observed from (16.5) that kb introduces additional
viscous friction to the mechanism. As this commonly improves stability in a control
system, then assuming kb = 0 renders the control problem more interesting at hand
in the sense that the design is performed by assuming that any stabilizing effect is
not present naturally in the mechanism.
A controller is designed in this section to take the pendulum to its inverted unstable
configuration, i.e., to any of the points (q1 , q̇1 ) = (+π, 0) or (q1 , q̇1 ) = (−π, 0).
It will be explained later why the wheel position and velocity are not taken into
account during the time interval when this task is performed.
Solving the first row in (16.3) for q̈2 , replacing this value in the second row
of (16.3), and using (16.6) in addition to d12 = d22 , the following is found:
Notice that J > 0 because of (16.4). Hence, the model in (16.7) corresponds to a
simple pendulum where J , m, l, and g represent the equivalent inertia, mass, length,
and gravity acceleration respectively. The total energy of this pendulum is given by
adding its kinetic energy and potential energy, i.e.,:
1 2
V (q1 , q̇1 ) = J q̇ + mgl(1 − cos(q1 )). (16.8)
2 1
The level surfaces of V are depicted in Fig. 16.3. This means that each curve in this
figure represents the set of points (q1 , q̇1 ) where V (q1 , q̇1 ) takes a constant value.
The reader should realize that the more external curves correspond to larger values
of V > 0 and the internal-most curve corresponds to a single point, (q1 , q̇) = (0, 0),
where V = 0 takes its smallest value.
Time derivative of V (q1 , q̇1 ), given in (16.8), is found to be:
926 16 Control of an Inertia Wheel Pendulum
dV (q1 , q̇1 )
= q̇1 J q̈1 + mgl q̇1 sin(q1 ).
dt
If J q̈1 is replaced from (16.7), the following is found:
dV (q1 , q̇1 )
= q̇1 τ1 . (16.9)
dt
What has been computed is known as the time derivative of V along the
d
trajectories of (16.7) [12]. This means that (16.9) represents the values that dt V
takes as the pendulum in (16.7) moves under the effect of the external torque
τ1 . For instance, if τ1 = 0 then dt d
V = 0, according to (16.9), which means
that the pendulum’s energy V remains constant as the pendulum moves. This is
very important for our purposes. From the knowledge of the pendulum’s initial
position and velocity (q1 (0), q̇1 (0)), it is possible to know the initial value of the
pendulum’s energy V (q1 (0), q̇1 (0)). As dt d
V = 0 because τ1 = 0 then, as time
grows, the pendulum moves only on points representing the level surface where
V (q1 (t), q̇1 (t)) = V (q1 (0), q̇1 (0)), which are shown in Fig. 16.3. Arrows on the
level surfaces represent the sense of the pendulum’s movement. These senses of
movement are easy to determine. The state vector of a simple pendulum is defined
V > V0
V = V0 V = V0
. 0 < V < V0
q1
[rad=s]
V=0
q1 [rad]
as y = [q1 , q̇]T . The variable ẏ = [q̇1 , q̈]T is a vector indicating where the state y
moves to. Notice that the horizontal component of ẏ, i.e., q̇1 , points to the right as
long as the pendulum velocity q̇1 is positive. This suffices to determine the sense of
the arrows on the level surfaces of V .
According to the ideas discussed above, to swing up the pendulum it suffices to
increase the pendulum energy to:
1
V (q1 , q̇1 )|q1 =+π ó q1 =−π = J (0)2 + mgl(1 − cos(±π )) = 2mgl = V0 ,
q̇1 =0 2
and, in the case that such an energy is reached at a point where (q1 , q̇1 ) = (+π, 0)
or (q1 , q̇1 ) = (−π, 0), then apply a torque τ1 that ensures dtd
V = 0 from that
time on. Notice that, according to Fig. 16.3, if V is kept constant once V = V0 ,
then the pendulum continues to move until one of the points (q1 , q̇1 ) = (+π, 0)
or (q1 , q̇1 ) = (−π, 0) is reached. It is shown next that the above is ensured if the
following torque is used:
dV (q1 , q̇1 )
= −kd q̇1 sat (q̇1 ) sign(V − V0 ).
dt
It is easy to realize from (16.11) that the product q̇1 sat (q̇1 ) is always positive and
it is zero only when q̇1 = 0. Hence, as long as q̇1 = 0 we have:
d
• If V < V0 then dt V > 0 and energy V increases.
d
• If V > V0 then dt V < 0 and energy V decreases.
• If V = V0 , then dt
d
V = 0 and energy V remains at V0 .
Then, it is ensured that the pendulum energy V reaches the required value to
arrive at one of the points (q1 , q̇1 ) = (+π, 0) or (q1 , q̇1 ) = (−π, 0). Furthermore,
the energy remains at that value until one of these points is reached. Now, analyze
what happens if q̇1 = 0. Notice that the pendulum is at rest under this condition.
However, the only way for q̇1 = 0 to be true for ever is q1 = 0, because it is only
there that the pendulum may remain at rest. Hence, it is necessary to slightly hit the
pendulum at the beginning to force it to abandon the configuration (q1 , q̇1 ) = (0, 0).
The previous analysis ensures that the pendulum reaches the inverted unstable
configuration if, from the downward stable configuration, the pendulum is slightly
hit to start it moving. It is not difficult to realize that none of the above results change
928 16 Control of an Inertia Wheel Pendulum
R
τ1 = −kd (V − V0 ) sat (q̇1 ), u=− τ1 , (16.12)
km
⎧
⎨ d, q̇1 > d umax km
sat (q̇1 ) = −d, q̇1 < −d , d= , (16.13)
⎩ kd RV0
q̇1 , |q̇1 | ≤ d
where d, umax and kd are positive arbitrary constants. Replacing (16.12) in (16.9):
dV (q1 , q̇1 )
= −kd (V − V0 ) q̇1 sat (q̇1 ).
dt
It is easy to realize, from (16.13), that the product q̇1 sat (q̇1 ) is always positive and
it is zero only when q̇1 = 0. Hence, as long as q̇1 = 0, we have the following:
d
• If V < V0 then dt V > 0 and energy V increases.
d
• If V > V0 then dt V < 0 and energy V decreases.
• If V = V0 then d
dt V = 0 and energy V remains at V0 .
Thus, it is ensured again that the pendulum energy V reaches the required value to
arrive at one of the points (q1 , q̇1 ) = (+π, 0) of (q1 , q̇1 ) = (−π, 0).
The strategy for balancing the pendulum is a linear state feedback controller
designed on the basis of a linear approximation of (16.3). This linear approximation
16.4 Balancing Controller 929
is obtained in the following. Note that the model in (16.3) does not depend on the
wheel position q2 . Hence, the state vector can be defined as:
⎡ ⎤ ⎡ ⎤
x1 q1
x = ⎣ x2 ⎦ = ⎣ q̇1 ⎦ , (16.14)
x3 q̇2
From (16.3):
q̈1 −1 mg sin (q1 ) 0
=D − + , (16.15)
q̈2 0 τ
d 11 d 12 1 d22 −d12
D −1 = = . (16.16)
d 21 d 22 d11 d22 − d12 d21 −d21 d11
According to Sect. 7.3.2, the operation points (x ∗ , τ ∗ ) of (16.17) are found from the
condition f (x ∗ , τ ∗ ) = 0, i.e.,:
⎡ ⎤ ⎡ ⎤
x2∗ 0
⎣ −d 11 mg sin (x ∗ ) + d 12 τ ∗ ⎦ = ⎣ 0 ⎦ . (16.18)
1
−d 21 mg sin (x1∗ ) + d 22 τ ∗ 0
It is clear that:
x2∗ = 0. (16.19)
On the other hand, from the second and third rows in (16.18), the following is found:
d 11 mg sin (x1∗ )
τ∗ = , (16.20)
d 12
d 21 mg sin (x1∗ )
τ∗ = .
d 22
mg . /
d 11 d 22 − d 21 d 12 sin (x1∗ ) = 0. (16.21)
d 12 d 22
Replacing this condition in any of the expressions in (16.20), the following is found:
τ ∗ = 0. (16.23)
x3∗ = c, (16.24)
where c is any real constant. According to Sect. 7.3.2, the linear approximation
of (16.17) at the operation point (16.19), (16.22), (16.23), (16.24), with n = ±1, is
given as:
ż = Az + Bw, (16.25)
⎡ ⎤
∂f1 ∂f1 ∂f1 ⎡ ⎤
⎢ ∂x1 ∂x2 ∂x3 ⎥ 0 10
∂f (x, τ ) ⎢ ∂f ∂f ⎥ ⎢ ⎥
⎢ 2 ∂f2 ⎥
⎥ = ⎢ ⎥
2
A= =⎢ ⎣ d 11 mg 0 0 ⎦ ,
∂x τx ∗
∗
⎢ ∂x1 ∂x2 ∂x3 ⎥
⎣ ∂f3 ∂f3 ∂f3 ⎦
∗ d 21 mg 0 0
x ∗
∂x1 ∂x2 ∂x3 τ
⎡ ⎤
∂f1 ⎡ ⎤
0
⎢ ∂τ ⎥
∂f (x, τ ) ⎢ ⎥ ⎢ ⎥
⎢ ∂f ⎥ ⎢ ⎥
B= = ⎢ 2 ⎥ = ⎢ d 12 ⎥ ,
∂τ τx ∗
∗
⎢ ∂τ ⎥ ⎣ ⎦
⎣ ∂f3 ⎦
∗ d 22
x ∗
∂τ τ
where:
z = x − x∗, (16.26)
w = τ − τ ∗, (16.27)
remain small, i.e., z ≈ 0, w ≈ 0. On the other hand, recall that τ ∗ = 0 and, hence,
w = τ . Then, (16.6) can be used to find the following modified version of (16.25):
ż = Az + Bu, (16.28)
16.5 Prototype Construction 931
⎡ ⎤
0
km
B = ⎣ d 12 ⎦ .
R
d 22
mgkm 3
2
det(C) = 3
d 12 (d 11 d 22 − d 12 d 21 ) = 0. (16.29)
R
Hence, it is concluded that the pair (A, B) is controllable. This means that it is
always possible to find a gain vector K such that all eigenvalues of the closed-loop
matrix (A − BK) are assigned at arbitrary locations. This is achieved using the
controller:
u = −Kz. (16.30)
The gain vector K is computed once the numerical values of the parameters involved
in matrices A and B are known. The controller (16.30) renders it possible to
balance the IWP at the inverted unstable configuration defined by the operation
point (16.19), (16.22), (16.23), (16.24), with n = ±1. It is important to stress that
this requires the mechanism state vector x to be close enough to such an unstable
configuration at the time when the controller (16.30) starts to work.
Finally, it is important to say that the constant c introduced in (16.24) takes the
value of the wheel velocity at the time when the controller (16.30) starts to work.
As this velocity may take any value, it is instrumental that c can be defined as any
real constant.
A drawing of the IWP that has been built is shown in Fig. 16.4. There, the main
components are shown. Some of these components are included to successfully
assemble the mechanical pieces. An incremental encoder and a tachometer are
also included, to measure the pendulum position q1 and the wheel velocity q̇2
respectively. The dimensions of the pieces employed are presented in Table 16.1.
To compute the pendulum’s center of mass including all its components, the balance
principle is employed, i.e., the sum of all the torques around the support point is
zero. Hence, when applying an equivalent weight at a distance lc1 on the opposite
end of the metal sheet, the assembly in Fig. 16.5 must be balanced. Using (16.31)
and the data in Table 16.1, the following is found:
16.5 Prototype Construction 933
l1
l1
l c1 2
The moment of inertia of a rectangular thick sheet with mass m, width b, and
length d, with rotation axis x orthogonal to the plane, with edges b and d passing
through its geometric center, is given as [14, 15], pp. 271:
1
Ix = m(b2 + d 2 ). (16.33)
12
Using (16.33) and the data in Table 16.1, the moment of inertia I ∗ is obtained as:
1
I∗ = 2
msol (asol + l12 ) = 0.0000191122 [Kg m2 ]. (16.34)
12
However, the moment of inertia I1 is defined around an axis passing through the
pendulum center of mass located at a distance lc1 − l1 /2 from the center of the
rectangle with edges b and d. According to the parallel axis theorem or Steiner
theorem [14, 15], pp. 272:
l1 2
I1 = I ∗ + msol lc1 − = 0.000048463 [Kg m2 ].
2
On the other hand, the moment of inertia of a disc with a mass m and radius r with
rotation axis x orthogonal to the disc and passing through its geometric center is
given as [14, 15], pp. 271:
1 2
Ix = mr . (16.35)
2
Using the data in Table 16.1 and the expression in (16.35) it is found that the wheel’s
moment of inertia Irue is given as:
1
Irue = 2
mrue rrue = 0.000006787 [Kg m2 ]. (16.36)
2
934 16 Control of an Inertia Wheel Pendulum
The moment of inertia of a cylinder with a mass m, radius a, and height l, with a
rotation axis x passing through its longitudinal axis is given as [14, 15], pp. 271:
1 2
Ix = ma . (16.37)
2
Using the expression in (16.37) and the data in Table 16.1, the moment of inertia of
the actuator rotor Irot is found to be:
1
Irot = 2
mrot rrot = 0.000000837225 [Kg m2 ]. (16.38)
2
The equivalent wheel mass m2 is defined as:
Using (16.36) and (16.38), it is found that the equivalent wheel moment of inertia
I2 is given as:
Finally, using the data in Table 16.1, the parameters in (16.34), (16.31), (16.32),
(16.39), (16.40), and g = 9.81[m/s2 ], the following numerical values for the
parameters of model (16.3) are found:
Verror
controller
with z1 and z2 defined in (16.26). All of the initial conditions were chosen to be zero
except for q̇1 (0) = 0.00001[rad/s]. The controller in (16.10) was set with kd = 20.
The vector of gains K for controller (16.30) was selected such that the eigenvalues
of the closed-loop matrix A−BK are assigned at −9.27±20.6j and −0.719. These
simulations were performed using the MATLAB/Simulink diagram in Fig. 16.6
where there are four main blocks that contain the code listed in Appendix G.2.
Before running the simulation in Fig. 16.6, the code in Appendix G.2.5 must be
executed to assign numerical values to all the parameters.
It is observed in Fig. 16.7 that the pendulum swings up and is finally balanced at
its inverted unstable configuration. Moreover, the wheel velocity remains bounded
along the complete simulation. Also note that the applied voltage remains within a
suitable range, i.e., between −13[V] and +13[V] and, finally, the pendulum energy
converges to its desired value V0 . Thus, these simulation results corroborate the
theoretical results stated above.
Using the numerical values in Sect. 16.5, kd = 1 and according to (16.7), (16.10), it
is found that the swing-up controller is given as:
936 16 Control of an Inertia Wheel Pendulum
4 20
3 15
2 10
1 5
x2 [rad/s]
x1 [rad]
0 0
−1 −5
−2 −10
−3 −15
−4 −20
0 5 10 15 0 5 10 15
t[s] t[s]
0 15
−200 10
−400 5
x3 [rad/s]
u[V]
−600 0
−800 −5
−1000 −10
−1200 −15
0 5 10 15 0 5 10 15
t[s] t[s]
0.4 0.05
0
0.3
V − V 0[J]
V0 V [J]
−0.1
0.2
0.1 −0.2
0 −0.3
0 5 10 15 0 5 10 15
t[s] t[s]
Fig. 16.7 Simulation results when swinging up and stabilizing the IWP with controllers in (16.10)
and (16.30) . (a) Pendulum position. (b) Pendulum velocity. (c) Wheel velocity. (d) Applied
voltage. (e) Pendulum energy. (f) Pendulum energy error
16.6 Controller Implementation 937
1
V = C1 q̇12 + mg(1 − cos(q1 )), C1 = J, V0 = 2mg,
2
Rkd umax km
u = C2 sat (q̇1 ) sign(V − V0 ), C2 = , ε0 = , (16.42)
km kd R
where umax = 13[V], whereas the constants C1 and C2 are computed only once
when initializing variables, to reduce the number of multiplications required for
implementation.
On the other hand, according to Sects. 7.14.1 and 7.14.2, in Chap. 7, it is found
that the linear controller (16.30), together with the gain vector K = [k1 , k2 , k3 ] =
[−340, −11, −0.0085] assign the eigenvalues of matrix (A − BK) at: λ̄1 =
−5.8535 + 17.7192j , λ̄2 = −5.8535 − 17.7192j , λ̄3 = −0.5268. Hence, the
controller (16.30) is expressed as:
for some constant that is small enough δ > 0 and q1d = +π or q1d = −π .
This condition indicates that the pendulum is close to one of the points (q1 , q̇1 ) =
(+π, 0) or (q1 , q̇1 ) = (−π, 0). In the experiments presented later δ = 0.3 has been
used.
The control strategy to swing up and to balance the IWP is to employ (16.42)
until (16.44) is satisfied and, from that time on, turn off (16.42) and turn on (16.43).
This task is performed using the Microchip PIC18F4431 microcontroller. It
is explained next how this is done. This part is not intended to present a
detailed explanation on how this microcontroller works, but merely a basic
description of how this microcontroller is employed to implement the control
strategy (16.42), (16.43), (16.44).
The complete code used to program the microcontroller is presented at the end
of this chapter. The microcontroller PIC18F4431 [16] works at 40 MHz as maximal
clock frequency. In this chapter, a 11-MHz crystal is used. Five programmable
input–output ports, three 16-bit timers, one 8-bit timer (employed to fix the sample
period Ts = 0.01[s]), and nine 10-bit analog/digital channels (the tachometer
voltage enters through channel 0), are available. There are also eight 14-bit PWM
channels among which CCP1 is programmed to work with 8 bit to deliver voltage
to be applied to the actuator (PM brushed DC motor).
The position q1 is measured using an incremental encoder model CP-360-S from
Computer Optical Products Inc. [17]. This device, once connected to the microcon-
troller, has a resolution of 1440 ppr. Pulses of this incremental encoder are read
through the microcontroller pins 5 and 6 (see Fig. 16.8). The incremental encoder
938 16 Control of an Inertia Wheel Pendulum
counts are stored in two 8-bit bytes called POSCNTH, the most significative, and
POSCNTL, the less significative. The actual count is computed as:
2π 2π
q1 = q1, = 0.004363.
1440 1440
It is worth stating that the complete control system must be turned on when the
pendulum is at rest at q1 = 0, according to the convention in Fig. 16.2. The
pendulum velocity q̇1 is computed by numerical differentiation of the pendulum
position q1 , i.e.,:
q1 (k) − q1 (k − 1)
q̇1 = ,
T
where k stands for the discrete time, q̇1 represents the estimate of the pendulum
velocity in radians/second whereas Ts = 0.01[s] is the sampling period. Hence,
q1 (k) represents the value of q1 measured at the present sample time and q1 (k − 1)
represents the value of q1 measured in the previous sample time.
The wheel velocity q̇2 is measured using a tachometer model 34PC. It is a
miniature PM brushed DC motor used in cell phones as a buzzer. Voltage delivered
by the tachometer is low-pass filtered using the RC circuit shown in Fig. 16.8.
It was found that this tachometer delivers 0.58[V] when the wheel velocity is
maximal, i.e., 1634 [rad/s]. It was assumed that this voltage is proportional at any
other intermediate velocity. To improve the resolution of this velocity measurement,
the tension divider connected to pin 4 (see Fig. 16.8) was employed to fix at
3.8372[V] the minimal value of the analog range of the analog/digital converter
channel 0 (the maximal value is fixed at 5[V]). On the other hand, the tachometer
is series connected to another tension divider, such that, when the tachometer is at
rest, i.e., when q̇2 = 0, voltage at channel 0 is (5-3.8372)/2+3.8372=4.4186[V].
Notice that variations of about 0.58[V], i.e., 1634[rad/s], are allowed upward and
downward from the middle point of the converter analog range. Hence, when
q̇2 = 1634[rad/s] the analog/digital converter delivers the count 1023 = 210 −1 (the
AD converter is 10-bit) and when q̇2 = 0[rad/s] the analog/digital converter delivers
the count 1023/2 = 511. Counts smaller than 511 represent negative velocities
q̇2 . According to this information, the wheel velocity is computed as follows. The
instruction “vel=read-adc()-511” assigns to the variable “vel” the code correspond-
ing to the wheel velocity, whereas the instructions “q2_p=(signed long)vel” and
“q2_p=3.2039*q2_p” assign to variable “q2_p” a value that is numerically equal to
16.7 Experimental Results 939
the wheel velocity q̇2 in radians/second, the sign included. Notice that the constant
3.2039=1634/510[(rad/s)/count] represents the measurement system gain.
With this information, any of the expressions in (16.42) or (16.43) are computed.
The resulting variable u is sent to the microcontroller PWM as described in the
following.
An equivalent way of implementing the saturation function in (16.42) with a
smaller number of computations is the following. It is known that u only takes values
in the range [−13, +13][V]; hence, its value is constrained to this range of values
by using instructions such as:
As the PWM resolution is 28 − 1 = 255 counts, then the following value must be
sent to the microcontroller PWM to correctly deliver u to the power amplifier:
255
cuenta = abs(u),
13
where abs(u) represents the absolute value of u. The sign of u is stored in two
control bits. The PWM signal is applied to an H bridge (L293B from SGS-Thomson
Microelectronics), which suitably amplifies the power of the PWM signal. This H
bridge is fed with a 15.3[V] power supply. However, according to the data sheet
of this device [18], the voltage drops constrain to ±13[V] the voltage signal to be
delivered. This device has two bits, which are employed to indicate the sign of the
power voltage to deliver. Thus, the sign of u is sent to the H bridge through the bits
0 and 1 of the microcontroller port D. This means that the average power voltage
sent to the motor is in the range [−13, +13][V]. Hence, it is ensured that the voltage
applied at the motor terminals u has an average value that is numerically equal to u,
computed by any of the expressions in (16.42) or (16.43). The electric diagram used
to implement the control strategy in (16.42), (16.43), (16.44), is shown in Fig. 16.8.
The experimental results obtained with the proposed control scheme are shown in
Figs. 16.9, 16.10, 16.11, 16.12, and 16.13. It is important to recall that it is necessary
to apply a slight hit on the pendulum at the beginning to abandon the configuration
(q1 , q̇1 ) = (0, 0). Although this can be replaced by sending a small voltage pulse to
the actuator at the beginning, this was not programmed.
In Fig. 16.9, it is observed how the pendulum oscillates with ever-growing
amplitude until the position q1 = −π is reached with zero velocity at t ≈ 14[s]
and the pendulum stays there from that time on. In Fig. 16.10, it is observed that the
940 16 Control of an Inertia Wheel Pendulum
9 8
10 7
6 2A
L293B
11
DC-Motor
12 5
M
13 4
14 3
+15.3Vcd
15 2
16 1 1A
EN
330 Ω 21 20
22 19 RD1
330 Ω
23 18 RD0
24 17
25 16 RC2
PIC18F4431
26 15
27 14
28 13
1
29 12
30 11
+5V
31 10
32 9
+5Vcd
Encoder
33 8 100 Ω 330 Ω
34 7 +5Vcd
35 6
+5Vcd
36 5 A
B
Fig. 16.8 Control system electric diagram
37 4
38 3 Vref(-)
39 2
40 1 AN0
+5V
Ω
Ω
G
0.2 μ F
.
q1
[rad=s]
q1[rad]
Fig. 16.14 The inertia wheel pendulum balancing at the inverted unstable configuration
The reader is referred to [19] for detailed explanations on each one of the
instructions appearing in the following program. The corresponding flow diagram
is presented in Fig. 16.15.
#include<18f4431.h>
#device adc=10 //adc, 10 bits
#include<stdlib.h>
#include<math.h>
#fuses HS,NOWDT,NOPROTECT,PUT,NOLVP,NOBROWNOUT,NOWRTC,
MCLR,SSP_RC
#define pi_ 3.14159
//nonlinear controller gain
#define kd 1.0
//linear controller gains
#define k1 340
#define k2 11
#define k3 0.0085
//parameters
#define mbg 0.12597
#define R 4.172
#define L 0.0009
#define Kb 0.00775
#define Km 0.00775
#define d11 0.0014636
#define d12 0.0000076
/*Register addresses*/
#use delay(clock=11000000)
//time basis (11 MHz)
#byte porta = 0xf80
//ports addresses
#byte portb = 0xf81
#byte PIE3=0xFA3
/*bits addresses */
float u,q1,q1_p,q1_1,q2_p,q1_d,q2_pd,gr,V,S,nf,i_ts,
Je2,V0,RKdeKm;
long pos,vel,inter;
int pwm;
signed int n,mod;
/*main program*/
void main(void)
{
set_tris_a(0b11111111);
//Config. I/O ports
set_tris_b(0b00000000);
set_tris_c(0b10000000);
set_tris_d(0b00000000);
portb=0X00;
portc=0X00;
portd=0X00;
//CONFIG. PWM
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_PWM);
setup_timer_2(T2_DIV_BY_16,255,1);
// Config. encoder reading
QEICON=QEICON | (0b00010101);
QEICON=QEICON & (0b01110101);
T5CON=T5CON | (0b00011001);
T5CON=T5CON & (0b10011101);
CAP1CON=CAP1CON | (0b01001111);
setup_timer_1(T1_INTERNAL | T1_DIV_BY_8);
TMR5L=0;
TMR5H=0;
POSCNTL=0;
POSCNTH=0;
//Config. ADC
16.8 PIC18F4431 Microcontroller Programming 947
setup_port_a(sAN0);
setup_adc(ADC_CLOCK_INTERNAL);
set_adc_channel(0);
delay_us(50);
VCFG1=1; //-Vref=AN2
INTCON=0;//turn off interrupt
//Config. timer 0
TMR0L=0;
T0CON=0xC7;
//initializing variables
i_ts=1/ts;
Je2=(d11*d22-d12*d21)/(2*d12);
V0=2*mbg;
RKdeKm=R*Kd/Km;
q1=0.0;
q1_1=0.0;
q2_pd=0.0;
while (TRUE)
{
PD3=1;
q1_1=q1; // q1(k-1)
pos=POSCNTH;
pos=pos<<8;
pos=pos+POSCNTL;
q1=(signed long)pos;
q1=0.004363*q1; //arm position in rad
q1_p=(q1-q1_1)*i_ts; //arm velocity
vel=read_adc()-511; //wheel velocity
q2_p=(signed long)vel;
q2_p=3.2039*q2_p; //wheel velocity in rad/seg
//desired q1
n=q1/pi_;
nf=(float)n;
mod=n%2;
if(nf==0)
if(q1>=0) // desired value
q1_d=pi_;
else
q1_d=-pi_;
if((nf!=0)&&!PD2)
{
if(q1>=0) // desired value
{
if(mod==0)
q1_d=pi_*(nf+1.0);
else
q1_d=pi_*nf;
}
else
{
if(mod==0)
q1_d=pi_*(nf-1.0);
else
q1_d=pi_*nf;
948 16 Control of an Inertia Wheel Pendulum
}
}
//defining the operation region for each controller
if((q1-q1_d)*(q1-q1_d) + q1_p*q1_p < delta)
{
PD2=1; //linear controller
u= k1*(q1-q1_d) + k2*q1_p + k3*(q2_p-q2_pd);
}
else
{
PD2=0; //nonlinear controller
V=Je2*q1_p*q1_p+mbg*(1-cos(q1));
V=V-V0;
S=0; //sign function
if(V>0)
S=1.0;
if(V<0)
S=-1.0;
u=RKdeKm*q1_p*S; //nonlinear controller ends
q2_pd=q2_p; //wheel desired velocity
}
//saturation 13V(15.3 V - 2.3 V drop at H bridge= 13 V)
if(u>13)
u=13;
if(u<-13)
u=-13;
//scaling output, pwm 8 bits, 13 V
u=19.6*u;
//sense of rotation
if(u>=0)
{
PD0=1;
PD1=0;
}
else
{
PD0=0;
PD1=1;
}
//sending pwm
pwm=(unsigned int)abs(u);
set_pwm1_duty(pwm); //pwm
PD3=0; //control computation ends
while(TMR0L<108); //each count = (4/FXtal)*256 sec
TMR0L=0;
T0CON=0xC7;
} //closing infinite while
} //closing main
References 949
16.9 Summary
In this chapter, another underactuated nonlinear system has been presented: the
inertia wheel pendulum. The mathematical model has been obtained and two
controllers have been used to solve two different control problems: swing-up
and balancing. The balancing control problem has been solved using a linear
state feedback controller, whereas the swing-up control problem has been solved
using a nonlinear controller. This has been done to introduce the reader to the
study of nonlinear control systems. All parameters of the mechanism have been
identified and the complete control system has been tested in experiments. A
detailed description of the mechanism construction has also been presented.
References
1. R. Kelly, V. Santibañez, and A. Loria, Control of robot manipulators in joint space, Springer,
London, 2005.
2. M. W. Spong, P. Corke, and R. Lozano, Nonlinear control of the reaction wheel pendulum,
Automatica, vol. 37, no. 11, pp. 1845–1851, 2001.
3. R. Olfati-Saber, Global stabilization of a flat underactuated system: the inertia wheel pendulum,
Proc. of the 40th IEEE Conf. on Decision and Control, Orlando, Florida, pp. 3764–3765, 2001.
4. R. Ortega, M. W. Spong, F. Gómez-Estern, and G. Blankenstein, Stabilization of a class
of underactuated mechanical systems via interconnection and damping assignment, IEEE
Transactions on Automatic Control, vol. 47, no. 8, pp. 1218–1233, 2002.
5. S. Afkhami, M. J. Yazdanpanah, and P. J. Maralani, Stabilization of inertia wheel pendulum
using output feedback back-stepping, Proc. of IEEE Conf. on Control Applications, vol. 2,
pp. 977–982, 2003.
6. D. M. Alonso, F. I. Robbio, E. E. Paolini, and J. L. Moiola, Modelling an inertia wheel
pendulum benchmark, Mathematical and Computer Modelling of Dynamical Systems, vol. 11,
no. 3, pp. 255–272, 2005.
7. R. Kelly and R. Campa, IDA-PB control of the inertia wheel pendulum: the Lagrangian
approach (in Spanish), Revista Iberoamericana de Automática e Informática Industrial, vol. 2,
no. 1, pp. 36–42, 2005.
8. V. Santibañez, R. Kelly, and J. Sandoval, Control of the inertia wheel pendulum by bounded
torques, Proc. of the 44th IEEE Conf. on Decision and Control, and European Control Conf.
CDC-ECC ‘05, Seville, Spain, pp. 8266–8270, 2005.
950 16 Control of an Inertia Wheel Pendulum
A periodic function of time f (t), with period 2p, can be represented by [1–3]:
∞
a0 nπ nπ
f (t) = + an cos t + bn sin t , (A.1)
2 p p
n=1
where a0 , an , bn , are known as the Fourier coefficients and can be computed as:
2p
1
a0 = f (t)dt,
p 0
2p
1 nπ
an = f (t) cos( t)dt, (A.2)
p 0 p
2p
1 nπ
bn = f (t) sin( t)dt.
p 0 p
The expressions in (A.2) are known as the Euler formulas and the series in (A.1)
is known as the Fourier series of f (t). Note that, according to (A.1), a periodic
function can be represented as the addition of many sine and cosine functions of
different discrete frequencies, i.e., determined by the integer n, that go from 0 to
+∞. These functions are also called the frequency components of f (t). Fourier
coefficients represent the contribution to function f (t) of the different frequency
components. An important observation is that (A.1) assumes that f (t) is periodic
for all real t. However, not every periodic function can be represented by a Fourier
series. The conditions that determine that a periodic function can be represented by
a Fourier series are known as the Dirichlet conditions:
Theorem A.1 ([1]) If f (t) is a bounded periodic function with a finite number of
maxima and minima in addition to a finite number of discontinuity points in any
period, then the Fourier series in (A.1) converges to f (t) at all points where f (t)
is continuous and it converges to the average of the left and right limits of f (t) at
each point where f (t) is discontinuous [3].
Definition A.1 ([3]) A function f (t) is said to be an even function if:
f (−t) = f (t), ∀t ∈ R,
f (−t) = −f (t), ∀t ∈ R.
As the cosine function is even and the sine function is odd, under certain
symmetry conditions in f (t) the Fourier series may be composed only of sine or
only of cosine functions, as stated in the following.
Theorem A.2 ([1]) If f (t) is an even function, the corresponding Fourier coeffi-
cients are given as:
p
2
a0 = f (t)dt,
p 0
p
2 nπ
an = f (t) cos t dt, n = 1, 2, 3, . . .
p 0 p
bn = 0, n = 1, 2, 3, . . .
Theorem A.3 ([1]) If f (t) is an odd function, the corresponding Fourier coeffi-
cients are given as:
an = 0, n = 0, 1, 2, 3, . . .
2 p nπ
bn = f (t) sin t , n = 1, 2, 3, . . .
p 0 p
On the other hand, any periodic function f (t) can be expressed as the addition
of one even function and one odd function [3]. Hence, according to Theorems A.2
and A.3, the first function contributes to a Fourier series composed only of cosine
A.1 Fourier Series 953
functions and the second function contributes to a Fourier series composed only of
sine functions. This explains, to some extent, why the general Fourier series contains
both cosine and sine functions.
Fourier series (A.1) can be written in several equivalent ways, for instance [1]:
1.
∞
nπ
f (t) = A0 + An cos t − γn ,
p
n=1
a0 bn
A0 = , An = an2 + bn2 , γn = arctan , (A.3)
2 an
If f (t) “tends” toward a periodic function, then the period 2p takes finite values
and ω, originally a continuous variable, “tends” toward the discrete variable nπ p ,
taking values from −∞ to +∞. Hence, dω stands for the difference between two
consecutive values of ω that correspond to two consecutive values of n represented
by n + 1 and n:
(n + 1)π nπ π
dω = − = .
p p p
On the other hand, Cn is the discrete version of F (ω). This can be explained as
follows. If f (t) is a nonperiodic function, it can be seen as a function with period
2p that “tends” toward ∞ and, although f (t) is assumed to be defined on the open
interval t ∈ (−∞, +∞), then the limits of the integral, which is computed on
a complete period of f (t), change from 0 and 2p to −∞ and +∞. Once (A.6)
and (A.7) are rendered discrete in this manner, (A.5) and Cn are exactly retrieved
when replacing (A.7) in (A.6).
A.3 Laplace Transform 955
From (A.5) and (A.6), the following observations are in order [1–4]. A periodic
function f (t) can be represented as an infinite series of sine and cosine functions
with different discrete frequencies nπp and amplitudes Cn , which are functions of
discrete frequency. On the other hand, a nonperiodic function f (t) is composed of a
large number of sinusoidal functions with a frequency that takes continuous values
ω and with amplitudes F (ω) that are functions of the continuous frequency ω. Cn
stands for the contribution, to a periodic function f (t), of the sinusoidal functions
of a specific discrete frequency nπp , whereas F (ω) stands for the contribution, to
a nonperiodic function f (t), of the sinusoidal functions of a specific continuous
frequency ω. The conditions for convergence of (A.6) to f (t) and the existence
of (A.7) are the following [1–3]:
1. f (t) satisfiesthe Dirichlet conditions.
∞
2. The integral −∞ |f (t)|dt exists.
Note that Dirichlet conditions
∞ are inherited from Fourier series, whereas the
existence of the integral −∞ |f (t)|dt is a clear condition for the convergence of
the integral in (A.7).
A nonperiodic function f (t) that is zero for t < 0, can be represented as [1–4]:
a+j ∞
1
f (t) = F (s)est ds, (A.8)
2πj a−j ∞
∞
F (s) = f (t)e−st dt, s = a + j ω, (A.9)
0
where a and ω are real numbers. F (s) is known as the Laplace transform of f (t),
whereas (A.8) and (A.9) are known as the Laplace transform pair. Note that (A.6)
and (A.7) are similar to (A.8) and (A.9). A careful observation leads us to conclude
that the former pair of expressions are obtained from the latter by assuming a = 0
and f (t) = 0 for all t < 0 [5], i.e., the bottom limit of the integral in (A.7) changes
from −∞ to 0. Conversely, (A.8) and (A.9) can be obtained from (A.6) and (A.7)
[1, 3, 4] by searching for a method allowing F (ω) to be computed for some special
functions f (t) that are zero for negative time and such that the integral:
∞
f (t)e−iωt dt,
0
does not converge. This means that f (t) does not become zero as t → ∞; hence,
the condition 2 above for the existence of F (ω) does not stand. The fundamental
idea [1, 3, 4] is to compute (A.6) and (A.7) for a function:
956 A Fourier and Laplace Transforms
finally obtaining the Fourier transform pair corresponding to f (t). The parameter a
is known as the convergence factor because, when introduced within a divergent
integral, it leads the integrand to decrease at a rate high enough to ensure
convergence of the integral.
Once this result has been found, it is natural to try to choose the convergence
factor a in a more general manner, such that convergence of the involved integrals
is the only thing that matters without the necessity of computing the limit of the
integrals when a → 0. Thus, the Laplace transform pair (A.8), (A.9), can be
obtained by replacing g(t) = f (t)e−at instead of f (t) in (A.6), (A.7), such that
s is a complex variable with ω as imaginary part, which is identical to the Fourier
variable, and a as a constant real part which can be positive, negative or zero.
According to the above discussion, the conditions for the existence of (A.8), (A.9),
can be summarized as follows [1, 2]:
1. In every finite time interval f (t) is bounded and has, at most, a finite number of
maxima and minima and a finite number of discontinuities.
2. There exists a real constant a such that the following integral is convergent:
∞ ∞
−at
|f (t)e |dt = |f (t)|e−at dt. (A.12)
0 0
Functions satisfying 3 are called functions of exponential order. Note that the
value of α required by this condition is not unique and defines a set of values. The
smallest value in this set, denoted by α0 , is known as the abscissa of convergence
of f (t) [1]. According to condition 3, f (t) can be a function that does not converge
to zero when t → ∞ or it can even remain growing, but its grow rate is not larger
than that of an exponential function, such that there exists some α ensuring that
|f (t)e−αt | stops growing as t → ∞. Hence, it is possible to select some constant
A.3 Laplace Transform 957
α1 > α such that e−α1 t decreases faster than the increment of f (t); thus, it is ensured
that:
∞
|f (t)e−α1 t |dt, (A.14)
0
– j∞ a – j∞
which is ensured to exist for any constant complex number σ0 such that
Re(σ0 ) >Re(s0 ).
The complex plane s is shown in Fig. A.1. Note that, according to (A.6), f (t)
can be computed as a line integral along a vertical straight line that overlaps the
imaginary axis (Re(s) = 0), whereas, according to (A.8), f (t) can be computed
as a line integral along a vertical straight line that is parallel to the imaginary axis
(Re(s) = a).
B
Bode Diagrams
In this appendix, some details are provided on how to draw Bode diagrams of some
basic terms. Instrumental for these results is the use of the logarithm properties listed
in (6.10), Chap. 6.
B.1.1 A Differentiator
Y (s)
= G(s) = s.
U (s)
Let s = j ω find:
G(j ω) = j ω = ω 90◦ .
Hence:
Consider two arbitrary frequencies with a difference of one decade between them,
i.e., ω2 = 10ω1 , and evaluate:
This means that the magnitude increases 20[dB] each time the frequency increases
one decade, i.e., the magnitude Bode diagram is a straight line with a slope of
+20[dB/dec]. Moreover, |G(j ω)|dB = 0 if ω = 1. This and the constant phase
G(j ω) = 90◦ explain the Bode diagrams in Fig. 6.16b.
B.1.2 An Integrator
Y (s) 1
= G(s) = .
U (s) s
Let s = j ω to write:
1 1
G(j ω) = = − 90◦ .
jω ω
Hence:
Consider two arbitrary frequencies with a difference of a decade between them, i.e.,
ω2 = 10ω1 , and evaluate:
This means that the magnitude decreases −20[dB] each time the frequency
increases one decade, i.e., the magnitude Bode diagram is a straight line with a
slope of −20[dB/dec]. Moreover, |G(j ω)|dB = 0 if ω = 1. This and the constant
phase G(j ω) = −90◦ explain the Bode diagrams in Fig. 6.16a.
Following this order of ideas, it is straightforward to verify that, in the case of
the transfer function:
Y (s) 1
= G(s) = n , (B.2)
U (s) s
for any integer n ≥ 1 the magnitude Bode plot is a straight line with a slope of
−20n[dB/dec] crossing the 0[dB] line at ω = 1. The phase is constant at −n90◦ .
Y (s) a
= G(s) = , a > 0.
U (s) s+a
Let s = j ω to obtain:
a
G(j ω) = . (B.3)
jω + a
If ω a, then:
If ω
a, then:
a
|G(j ω)| ≈ ,
ω
a
|G(j ω)|dB = 20 log ,
ω
= 20 log(a) − 20 log(ω), (B.5)
◦
G(j ω) ≈ −90 .
962 B Bode Diagrams
1
|G(j ω)| = √ ⇒ |G(j ω)|dB = −3,
2
G(j ω) = −45◦ .
Y (s) s+a
= G(s) = .
U (s) a
Let s = j ω to obtain:
jω + a
G(j ω) = .
a
Notice that this function is the inverse of (B.3) and recall that log x1 = − log (x),
z = − 1
z , where z is a complex number. Hence, it is straightforward to verify
that the Bode diagrams in this case are the same as those obtained in Sect. B.1.3 but
with an opposite sign. This explains the Bode diagrams in Fig. 6.17a.
Y (s) ωn2
= G(s) = 2 , ωn > 0, ζ ≥ 0. (B.6)
U (s) s + 2ζ ωn s + ωn2
ωn2
|G(j ω)| = , (B.7)
(ωn2 − ω2 )2 + 4(ζ ωn ω)2
B.3 A Second-Order Zero 963
−2ζ ωn ω
G(j ω) = arctan .
ωn2 − ω2
If ω ωn , then:
If ω
ωn , then:
ωn2
|G(j ω)| ≈ , (B.8)
ω2
ω
n
|G(j ω)|dB = 40 log ,
ω
= 40 log(ωn ) − 40 log(ω),
G(j ω) = −180◦ .
1
|G(j ω)| = ⇒ |G(j ω)|dB → ∞, as ζ → 0.
2ζ
G(j ω) = −90◦ .
Y (s) s 2 + 2ζ ωn s + ωn2
= G(s) = . (B.9)
U (s) ωn2
Note that this transfer function is the inverse of (B.6) and recall that log x1 =
− log (x), z = − 1z , where z is a complex number. Thus, it is straight forward
to show that Bode diagrams of (B.9) are identical to Bode diagrams of (B.6) and
we only have to consider that the sign changes in both the magnitude and the phase
plots. This explains the Bode diagrams in Fig. 6.17c.
C
Decibels, dB
The bel, ([B]), is a unit of measure for the ratio between two quantities with unities
of power. The number of bels is computed as:
P1
log [B].
P0
1[dB] = 0.1[B].
P1
Hence, if x = log P0 is in Bels and we want to convert to decibels, we have to
write:
[dB] P1
y = 10 x = 10 log [dB],
[B] P0
where y is given in decibels. On the other hand, the power is often given as the
square of signals such as voltage, electric current, etc. (also called field quantities).
Thus, it is important to express the ratio of power in decibels but in terms of field
quantities. In such a case:
P1
y = 10 log [dB],
P0
F12
= 10 log [dB],
F02
F1
= 20 log [dB]. (C.1)
F0
The definition in (C.1) represents the expression for the number of decibels used
throughout this book, i.e., for decibel units of the magnitude in frequency response
of control systems.
In acoustics, decibels are used to represent an unit of pressure level:
p
20 log [dB]. (C.2)
p0
is expressed in dBm.
D
Magnetically Coupled Coils
D.1 Invertance
When electric current through a coil induces a voltage in other coils, it is said that
all these coils are magnetically coupled. In electric diagrams, an arc is depicted
between coils to indicate that they are magnetically coupled, see Fig. D.1. Under
these conditions, the voltage in any of these coils depends on the electric current
through all the coils, i.e., according to Faraday’s Law:
dΨk
vk = .
dt
where vk stands for voltage at terminals of the k−th coil and Ψ is the magnetic flux
linkage in the k−th coil:
Ψk = Nk ψk (i1 , . . . , in ),
with Nk the number of turns of the coil k and ψk is the flux linkage per turn of
the coil k, which is a function of the electric currents through the n magnetically
coupled coils with 1 ≤ k ≤ n. Applying the chain rule:
∂ψk
Lkk = Nk , (D.2)
∂ik
whereas:
∂ψk
Lkj = Nk , (D.3)
∂ij
dI
V =M ,
dt
dI di1 di2 dik din T
V = [v1 , v2 , . . . , vk , . . . , vn ] ,
T
= , ,..., ,..., ,
dt dt dt dt dt
⎡ ⎤
L11 L12 · · · L1k · · · L1n
⎢L L ··· L ··· L ⎥
⎢ 21 22 2k 2n ⎥
⎢ . .. . . .. . . .. ⎥
⎢ . . . ⎥
⎢ . . . . ⎥
M=⎢ ⎥.
⎢ Lk1 Lk2 · · · Lkk · · · Lkn ⎥
⎢ ⎥
⎢ .. .. . . .. . . .. ⎥
⎣ . . . . . . ⎦
Ln1 Ln2 · · · Lnk · · · Lnn
dik det(Mk )
= ,
dt det(M)
where cof(Mj k ) stands for the cofactor of the entry (j, k) of matrix M and the
constant:
cof(Mj k )
Γkj = , (D.4)
det(M)
relating the electric current in the k−th coil to voltage in the j −th coil, is known as
the mutual invertance between those coils. This expression indicates that invertances
are functions of self-inductances and mutual inductances of the whole system for
magnetically coupled coils, i.e.,:
1 1
Γkj = , and Γkk = .
Lkj Lkk
Moreover, Γkj = Γj k .
Consider two magnetically coupled coils as depicted in Fig. D.1a. Define the electric
current sense in coil L1 and put a polarity mark “∗” at the terminal of the coil where
the electric current enters the coil. A magnetic flux is produced in the core whose
sense is defined according to the right-hand rule.1 According to Lenz Law, a voltage
is induced at the coil L2 with a polarity such that, if the terminals of L2 are put in
short circuit, an electric current flows through L2 producing a magnetic flux that
opposes the flux produced by L1 . Use again the right-hand rule to determine the
sense of electric current through L2 producing this effect. Put a polarity mark “∗” at
the terminal of L2 where the electric current leaves the coil L2 . This ensures that the
instantaneous voltages at L1 and L2 , only due to effect of mutual induction, have the
same polarity at the terminals with the polarity marks “∗”. The mutual inductance
is negative, L12 = L21 < 0, for coils such as those shown in Fig. D.1a.
In the case of Fig. D.1b, the senses of electric currents through L1 and L2 are
defined such that the magnetic fluxes produced by them in the core are in the
1 Right-handrule: if the right-hand fingers indicate the sense of electric current in a coil, then the
thumb indicates the sense of the generated magnetic flux.
970 D Magnetically Coupled Coils
*
*
L1 L2
*
L1 * L2
*
*
L1 L2 L1 L2
* *
* *
* *
Lk Ll Lk Ll
* *
* *
Lk Ll Lk Ll
Fig. D.1 Magnetically coupled coils . (a) L12 = L21 < 0. (b) L12 = L21 > 0. (c) Lkl = Llk > 0.
(d) Lkl = Llk < 0
same direction. In this case L12 = L21 > 0. Signs of the mutual invertances are
determined by (D.4).
E
Euler–Lagrange Equations Subject to
Constraints
d ∂L ∂L
− = τ + τQ , (E.1)
dt ∂ q̇ ∂q
To take into account the constraint in (E.2) when solving (E.1), the following
procedure is suggested in [15]. It is assumed that the constraint includes additional
generalized forces, τc = [τc1 , . . . , τcn ]T ∈ Rn , which are intended to render the
d ∂L ∂L
− = τ + τQ + τc . (E.3)
dt ∂ q̇ ∂q
The generalized forces τc due to the constraint are assumed not to produce any
mechanical work, i.e., a basic requirement when the Euler–Lagrange equations
are obtained [15]. This means that, under the effect of τc , the mechanical system
displacement must be performed in an orthogonal direction to τc , i.e., q̇ T τc = 0.
Then it is possible to write:
q̇ T τc = τcT q̇ = 0.
This expression and (E.2) suggest that τc must be parallel to AT (q), i.e., it is possible
to write:
τc = λAT (q),
where λ is a scalar that has to be computed. The latter expression can be used to
write (E.3) as:
d ∂L ∂L
− = τ + τQ + λAT (q). (E.4)
dt ∂ q̇ ∂q
where y(k) is the integral computed at the present sampling time with y(0) = 0 and
y(k − 1) is the integral computed at the previous time in the past. The expression
in (F.1) is obtained from the geometric interpretation of the integral of w, i.e.,
the area below the curve defined by w. Hence, the term w(k)Δt stands for the
area increment at each sampling time: w(k) and Δt represent the height and base
respectively of a rectangle that approximates such an area increment. To obtain a
good approximation, Δt must be small compared with the control system’s response
time.
dw
y= . (F.2)
dt
This operation can be approximated numerically as:
w(k) − w(k − 1)
y≈ , (F.3)
Δt
where w(k) stands for w at the present sampling time, w(k − 1) is w at the previous
sampling time and Δt is the sampling period. To obtain a good approximation, Δt
must be small compared with the control system response time.
I ∗ (s) s+d
=γ , (F.4)
E(s) s+c
Assuming zero initial conditions, the inverse Laplace transform is used in both
expressions given in (F.5) to find:
i ∗ = γ [e + v], (F.6)
v̇ = −cv + (d − c)e, (F.7)
where v is the inverse Laplace transform of V (s). Then, if the desired position θd
is known and θ is measured, the signal e can be computed. Using this signal as
the known variable, the differential equation in (F.7) is solved numerically, with
v(0) = 0, to compute v and then use (F.6) to compute i ∗ .
Now, it is explained how to solve it numerically (F.7). According to (F.2)
and (F.3), it is possible to perform a forward shift in time to approximate:
v(k + 1) − v(k)
v̇ = −cv(k) + (d − c)e(k) ≈ ,
Δt
F.4 Controller in Fig. 14.8a 975
i.e.,
Then, v(k + 1) can be computed iteratively from the initial value v(0) = 0 and
the measurement of e(k) = θd (k) − θ (k). The equation (F.8) is expressed in a
convenient manner because it allows us to use v(k) = v(0) at k = 0. Note that
v(k + 1) is computed at the present sampling time but it is to be used only at the
next sampling time in the future.
i ∗ = α[v1 − θ ] − kv θ̇ ,
s+b
V1 (s) = γ E(s),
s+c
E(s) = Xd (s) − X(s). (F.9)
Proceeding as in Sect. F.3, it is found that the time function v1 can be computed in
discrete time as:
where e(k) and v1 (k) are the present discrete time values of the functions L{e} =
E(s) and L{v1 } = V1 (s) defined in (F.9), i.e., e(k) = xd (k) − x(k), and Δt is the
sampling period. Hence, v(k + 1) can be computed iteratively from the initial value
v(0) = 0. Note that v(k + 1) is computed in the present sampling time but it is
employed only at the next sampling time in the future.
Finally, the signal θ̇ is computed from the position measurement θ as follows:
θ (k) − θ (k − 1)
θ̇ ≈ .
Δt
976 F Numerical Implementation of Controllers
where E(s) = θ2d (s) − θ2 (s). Performing the indicated division yields:
β2 s 2 + β1 s + β0
U1 (s) = E(s). (F.12)
s3 + α2 s 2 + α1 s + α0
Thus, according to (F.10), (F.11) and (F.12), the diagram of one possible realization
for (12.40) is depicted in Fig. F.1. On the other hand, in the computer program listed
in Sect. 12.6, the controller in (12.40) is implemented using the following dynamic
equation:
This dynamic equation has been found using MATLAB, which converts the transfer
function in (12.40) into the above dynamical equation. Hence, the most we can do is
find a relationship between this system realization and that in Fig. F.1. A simulation
diagram for (F.13) is depicted in Fig. F.2. Performing some block algebra in Fig. F.2,
the simulation diagram shown in Fig. F.3 is found. Notice that this diagram is
equivalent to that in Fig. F.1 if the following is satisfied:
The reader may proceed to use the specific numerical values given above to
verify these expressions. The dynamical equation in (F.13) is solved iteratively by
measuring the error e at each sample time and approximating the time derivatives
as dz Δzi
dt ≈ Δt , for i = 1, 2, 3, where Δzi = z1 (k + 1) − zi (k), k and k + 1 stand for
i
the present and the next sample time, and Δt is the sample period, to write:
Δz1
= η1 z1 (k) + η2 z2 (k) + η3 z3 (k) + b1 e(k),
Δt
Δz2
= η4 z1 (k),
Δt
Δz3
= η5 z2 (k).
Δt
Thus:
β2 +
u1
β1
β0
e x3 x2 x1 u
+ +
– α2
– α1
– α0
d1
z1 (k + 1) ⇒ z1 (k),
z2 (k + 1) ⇒ z2 (k),
z3 (k + 1) ⇒ z3 (k).
All initial conditions are set to zero, i.e., when k = 0 use z1 (k) = 0, z2 (k) = 0,
z3 (k) = 0.
Finally, the controller in (12.37), i.e.,:
(s + 5)(s 2 + 8s + 62.832 )
Gc (s) = 0.6892 ,
(s + 36.6439)3
is implemented in the computer program listed in Sect. 12.6 using the following
dynamical equation:
ż = Az + Be, u = Cz + De,
⎡ ⎤ ⎡ ⎤
η1 η 2 η 3 b1
A = ⎣ η4 0 0 ⎦ , B = ⎣ 0 ⎦ ,
0 η5 0 0
. /
C = σ1 σ2 σ3 , D = d1 ,
η1 = −109.9, η2 = −62.94, η3 = −24.03, η4 = 64, η5 = 32,
b1 = 8, σ1 = −8.351, σ2 = −0.05483, σ3 = −1.24, d1 = 0.6892.
σ1 +
σ2
σ3
z1 z2
e z3 u
b1 + η4 η5 +
η1
η2
η3
d1
b1 σ1 +
b1 η4 σ2
b1 η4 η5 σ3
x3
e x2 u
+ +
x1
η1
η4 η2
η4 η5 η3
d1
function Q = modelo(theta0p,theta1,theta1p,tau)
%%-----------Parameters-----------%%
g = 9.81;
l1 = 129e-3;
L0 = 155e-3;
m1 = 22.18e-3;
J1 = 184.5e-6;
I0 = 238.49e-6;
%%----- M(q)qpp + C(q, qp)qp + G(q) = T----%%
%%----- q=[theta0;theta1]-----------%%
M11= I0 + m1*(L0^2) + (l1^2)*m1*(sin(theta1)^2);
M12= m1*L0*l1*cos(theta1);
M21= m1*L0*l1*cos(theta1);
M22= J1 + m1*(l1^2);
M= [M11 M12;
M21 M22];
C11= 2*(l1^2)*m1*sin(theta1)*cos(theta1)*theta1p;
C12= -m1*L0*l1*sin(theta1)*theta1p;
C21= -m1*(l1^2)*sin(theta1)*cos(theta1)*theta0p;
C22= 0;
C= [C11 C12;
C21 C22];
G11= 0;
G21= -m1*g*l1*sin(theta1);
G= [G11;
G21];
T= [tau;
0];
Qp= [theta0p;
theta1p];
Qpp= M \ ( T - C*Qp - G );
theta0pp=Qpp(1,1);
theta1pp=Qpp(2,1);
Q=[theta0pp;theta1pp];
tauE = -K*x’;
figure(1)
plot(t,theta0,’b’,’Linewidth’,1.5);
grid on
axis([0 35 -0.25 0.25]);
set(gca,’XTick’,[0 10 20 30],’YTick’,[-0.2 0 0.2],’FontName’,’Times New Roman’,’FontSize’,24)
text(16,0.195,’$\theta_0$’,’Interpreter’,’latex’,’Fontsize’,24);
text(30.75,-0.22,’$t$ [$\mathrm{s}$]’,’Interpreter’,’latex’,’Fontsize’,24);
text(1.6,0.155, ’[$\mathrm{rad}$]’,’Interpreter’,’latex’,’Fontsize’,24,’rotation’,90);
figure(2)
plot(t,theta1,’b’,’Linewidth’,1.5);
grid on
axis([0 35 -0 9]);
set(gca,’XTick’,[0 10 20 30],’YTick’,[0 3 6 9],’FontName’,’Times New Roman’,’FontSize’,24)
text(16,8,’$\theta_1$’,’Interpreter’,’latex’,’Fontsize’,24);
text(30.75,0.55,’$t$ [$\mathrm{s}$]’,’Interpreter’,’latex’,’Fontsize’,24);
text(1.6,7.3, ’[$\mathrm{rad}$]’,’Interpreter’,’latex’,’Fontsize’,24,’rotation’,90);
figure(3)
plot(theta1,theta1p,’b’,’Linewidth’,1.5);
grid on
axis([-2 9 -20 20]);
set(gca,’XTick’,[0 3 6 9],’YTick’,[-20 -10 0 10 20],’FontName’,’Times New Roman’,’FontSize’,24)
text(6.35,-17.5,’$\theta_1$ [$\mathrm{rad}$]’,’Interpreter’,’latex’,’Fontsize’,24);
text(-1.37,4.5, ’$\dot\theta_1$ [$\mathrm{rad/s}$]’,’Interpreter’,’latex’,’Fontsize’,24,’rotation’,90);
figure(4)
plot(t,tauF,’b’,’Linewidth’,1.5);
grid on
axis([0 35 -0.1 0.1]);
set(gca,’XTick’,[0 10 20 30],’YTick’,[-0.1 -0.05 0 0.05 0.1],’FontName’,’Times New Roman’,’FontSize’,24)
text(16,0.08,’$\tau$’,’Interpreter’,’latex’,’Fontsize’,24);
text(30.7,-0.088,’$t$ [$\mathrm{s}$]’,’Interpreter’,’latex’,’Fontsize’,24);
text(1.6,0.06, ’[$\mathrm{Nm}$]’,’Interpreter’,’latex’,’Fontsize’,24,’rotation’,90);
figure(5)
plot(t,E,’b’,’Linewidth’,1.5);
grid on
axis([0 35 -0.075 0.075]);
set(gca,’XTick’,[0 10 20 30],’YTick’,[-0.05 0 0.05],’FontName’,’Times New Roman’,’FontSize’,24)
text(13,0.057,’$E\left(q,\dot q\right)$’,’Interpreter’,’latex’,’Fontsize’,24);
text(30.75,-0.0665,’$t$ [$\mathrm{s}$]’,’Interpreter’,’latex’,’Fontsize’,24);
text(1.6,0.06, ’[$\mathrm{J}$]’,’Interpreter’,’latex’,’Fontsize’,24,’rotation’,90);
figure(6)
plot(t,V,’b’,’Linewidth’,1.5);
grid on
axis([0 35 -1 4]);
984 G MATLAB/Simulink Code Used for Some Simulations
function[Sys,x0]=InertialWheelPendulum(t,x,u,flag)
N=3;
switch flag,
case 0,
[Sys,x0] = Initialization(N);
case 1,
Sys = State_Equations(t,x,u,N);
case 3,
Sys = Output(t,x,u);
case 9,
Sys = [];
otherwise
Sys = [];
end
function [Sys,x0]=Initialization(N)
NumContStates = N;
NumDiscStates = 0;
NumOutputs = N;
NumInputs = 1;
DirFeedthrough = 0;
NumSampleTimes = 1;
Sys = [NumContStates NumDiscStates
NumOutputs NumInputs DirFeedthrough NumSampleTimes];
x0 =[0 0.00001 0];
Di=inv(D);
di11=Di(1,1);
di12=Di(1,2);
di21=Di(2,1);
di22=Di(2,2);
xp(1)=x(2);
xp(2)=-di11*mbg*sin(x(1))+(km/R)*di12*u;
xp(3)=-di21*mbg*sin(x(1))+(km/R)*di22*u;
Sys=[xp’];
%------------nonlinear control---------------
nlc=(R/km)*Kd*satx2*(V-V0);
%-----------energy error---------------------
Verror=V-V0;
986 G MATLAB/Simulink Code Used for Some Simulations
function lc = fcn(x,K)
%#codegen}
n=1;
c=-570;
xd=[n*pi; 0; c];
z=x-xd;
%--------linear control-----------
lc =-K’*z;
This code must be run before running the simulation in Fig. 16.6 to fix the numerical
values of the parameters.
clc,clear all;
% Motor parameters
R=4.172;
km=0.00775;
Umax=13;
% IWP Model
g=9.81;
mgl=0.12597;
mbg=mgl
d11=0.0014636;
d12=0.0000076;
d21=d12;
References 987
d22=d21;
J= (d11*d22-d12*d21)/d12;
D=[d11 d12;d21 d22];
Di=inv(D);
di11=Di(1,1)
di12=Di(1,2)
di21=Di(2,1)
di22=Di(2,2)
% Linear approximate model of IWP
A=[0 1 0;di11*mbg 0 0;di21*mbg 0 0]
B=[0;di12*km/R;di22*km/R]
% Controllability determination
disp(’Is system controllable?’);
Pc=ctrb(A,B);
if rank(Pc) == size(Pc)
disp(’Yes.’);
else
disp(’No.’);
end
% Nonlinear controller
Kd=20;
V0=2*mbg
d=(Umax*km)/(R*Kd*V0)
%Linear state feedback controller at the operation point
n=1
c=-570
xd=[n*pi 0 c]
% Desired closed-loop eigenvalues
lambda1= -9.27 + 20.6i;
lambda2= -9.27 - 20.6i;
lambda3= -0.719;
Vp=[lambda1 lambda2 lambda3]
K = place(A,B,Vp)
% Verifying closed-loop eigenvalues
Vp_=eig(A-B*K)
References
K hard, 522
Kinetic energy, 826, 871, 923, 925 saturation, 531
static, 522
Nonminimum phase, 367
L Nyquist analysis, 21
Lagrangian, 923 Nyquist path, 364
Laplace transform, 87, 955 modified , 366
final value theorem, 88
initial value theorem, 88
pair, 955 O
second translation theorem, 368 Observability
Lenz Law, 969 definition, 470
Level surfaces, 925 test, 470
Limit cycle, 522 Open-loop pole
Linear approximate model, 457 effect, 243, 368
Linear transformation, 480 Open-loop zero
effect, 243, 368
Operation point, 456, 575
M Output, 91
MagLev, 761
Magnetic energy, 764
Magnetic force, 764 P
Mass conservation law, 94 Parallel axis theorem or Steiner theorem,
Matrix 933
characteristic polynomial of, 464 Pendulum balancing, 923
eigenvalues, 463 Pendulum swing up, 923
nonsingular, 462 Physical system modeling, 20
rank of, 463 Plant, 18
Mechanical components, 26 input, 8, 18
bodies output, 8, 18
constitutive function, 26 Polar plots, 345
Newton’s Second Law, 26, 36 Potential energy, 873, 924, 925
Coulomb friction Pulse-width modulator (PWM), 770
constitutive function, 27, 28
Newton’s Third Law, 28, 29, 63, 66, 67
spring R
constitutive function, 27 Resonance, 346
Hooke’s Law, 27, 37 Resonance peak, 327, 344, 372
static friction Right-hand rule, 969
constitutive function, 27, 28 Root locus
viscous friction angle condition, 237
constitutive function, 27, 28 magnitude condition, 237
Microcontroller
PIC16F877A, 621, 673, 748, 845, 859, 904
PIC18F4431, 937 S
Minimum phase, 367 Sectionally regular functions, 956
Modern control techniques, 11 Sensitivity function, 542
Separation principle, 492
Shockley equation, 576
N Small-signal circuit, 574
Newton’s Second Law, 764 Source transformation theorem, 153
Noise, 344 Stability, 10, 20, 467
Nonlinearity gain margin, 21
dead zone, 522 phase margin, 21
992 Index