Intro2modernControl First 2chaps
Intro2modernControl First 2chaps
University of Washington
University of California, Berkeley
Introduction to Modern Controls, with Illustrations in MATLAB and Python
Copyright
To cite this material: Xu Chen and Masayoshi Tomizuka, “Introduction to Modern Controls – with Illustrations
in MATLAB and Python,” 2023, ISBN: 9798860587496.
Preface
This book introduces the theory and practice of modern control systems. The emphasis is on using state-space
methods to model, analyze, and control dynamic systems. Topics include state-space modeling and solutions,
stability, controllability and observability, state-feedback control, observers, observer state feedback controls,
least square estimation, Kalman filter, and Linear Quadratic Gaussian optimal control. These topics are discussed
in both continuous- and discrete-time settings throughout the book.
The material in this book is based on many years of teaching experience at the University of Washington and the
University of California, Berkeley. The main sources of the material are:
This book consists of four parts. Part I introduces the basics of dynamic systems modeling, such as Laplace and Z
transforms, state-space descriptions and realization theory, and how to solve the state equation. Part II examines
the properties of dynamic systems, such as classic and Lyapunov stability theories, controllability, observability,
and the decomposition of an uncontrollable and/or unobservable system. After understanding these system
properties, in Part III, we cover estimation and controls for state-space systems. Chapter 11 centers on the power
of state feedback. Then in Chapter 12, we discuss state observers and observer-state feedback. As a powerful
state-feedback control method, Chapter 13 covers the linear quadratic optimal control algorithm. Part IV is
dedicated to estimation and control of stochastic systems, where the state-space system equations are subject to
input and output stochastic noises. We review first relevant results in probability theory in Chapter 14, building
on which we derive the least square estimation in Chapter 15 and then the discrete- and continuous-time Kalman
filters in Chapter 16. Chapter 17 integrates linear quadratic optimal control with the Kalman filter, to provide the
celebrated Linear Quadratic Gaussian (LQG) Optimal control. At the end of the book, we provide a review of
related linear algebra for controls.
Over three hundred examples, figures, table summaries, and exercises distilled from physical systems supplement
the learning. Perhaps unique in this book is the modernization of tools we use to illustrate controls. MATLAB
and Python are the primary tools for our numerical demonstrations. Whenever MATLAB examples appear,
complementary Python codes will follow to provide results as equivalent as possible in the more nascent
computation environment.
All the main codes are available for download on the book website https://mcimp-book.github.io/mcimp/. We
have also provided accompanying slides and lecture recordings – all accessible from the book website.
All the MATLAB demonstrations were performed in MATLAB 2022b, and the Python demonstrations in
Python 3.9.13, using toolboxes SymPy v1.11.1 and python-control v0.9.2. For simple calculations and graphical
illustrations, we use gnuplot, a light-weight command-line driven graphing utility across different operation
systems. The coding commands and results are all provided in an “in-line” fashion, directly embedded in the
text materials. Appendix “How to Install and Run Python” provides a summary of ways to configure
Python in different operation systems.
We are grateful to the many teaching assistants and students who helped typeset problems and proofread course
contents over the years. In particular, we would like to thank Liting Sun for creating some of the drawings
in LATEX and Lingfeng Sun for typesetting the Berkeley ME 233 course reader. Jonas Beachy, Xiaohai Hu, and
Marina Ruediger helped with a few case studies. Their contributions have greatly enhanced the quality of this
book.
We hope this book will serve as a useful reference for students and researchers interested in the field of dynamics
and control.
Preface iii
Contents v
1 Introduction 1
1.1 The Power of Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Relevant Terminologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 The Objectives and The Means of Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Societies to Learn More about Controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
System Description 7
2 Modeling 9
2.1 Methods of Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.2 Continuous-Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Discrete-Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Example: Atomic Force Microscopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.5 Example: Hard Disk Drive and Information Storage . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.6 Model Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.7 Nonlinear Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7.1 Example: Magnetically Suspended Ball . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.7.2 Example: Water Tank . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7.3 Example: Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.7.4 Example: Vehicle Steering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.8 “All Models are Wrong, but Some are Useful” . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.9 Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1 Block diagram of the controllable canonical form for third-order systems. . . . . . . . . . . . . . . 85
5.2 Block diagram of the observable canonical form for third-order systems. . . . . . . . . . . . . . . . 87
5.3 Block diagram of the diagonal realization for third-order systems with distinct poles. . . . . . . . 90
5.4 Block diagram of the Jordan form realization for third-order systems with repeated poles. . . . . . 91
5.5 Block diagram of the modified canonical form for third-order systems with complex poles. 𝑘2 =
(𝛽 + 𝛼𝜎)/𝜔 and 𝑘3 = 𝛼 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
List of Tables
16.1 Comparison of the estimation error covariances (diagonal entries) between a Kalman filter and a finite
settling time observer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Introduction 1
1.1 The Power of Controls . . . . 1
1.1 The Power of Controls
1.2 Relevant Terminologies . . . 1
1.3 The Objectives and The
Our internal body temperature is regulated around the normal value of Means of Controls . . . . . . 3
about 37◦ C or 98.6◦ F. A part of our brain called the hypothalamus checks
1.4 Societies to Learn More
our current temperature and compares it with the normal value. In a sauna about Controls . . . . . . . . . 6
room where the temperature is too high, sweat is produced to cool the
skin,1 and the blood vessels under our skin get wider to increase the blood 1: The middle layer of the skin, or dermis,
flow to the skin.2 On the other hand, when building a snowman outside, stores most of the body’s water. When the
temperature is too high, that water, along
the blood vessels under our skin become narrower to decrease blood flow with the body’s salt, are brought to the
to the skin, retaining heat near the warm inner body; muscles, organs, and surface of the skin as sweat. On the skin
brain produce heat (e.g., muscles can produce heat by shivering); and our surface, the water evaporates and cools
thyroid gland releases hormones to increase our metabolism.3 4 That is the the body.
power of feedback controls: it allows us to make a precision device out of a 2: This process is called vasodilatation.
crude one that works well even in changing environments. 3: The three mechanisms are called vaso-
constriction, thermogenesis, and hor-
We also use prediction and feedforward controls in our regulation of body monal thermogenesis, respectively.
temperature: as kids, we had learned to wear T-shirts in summer, long 4: We are continuously losing heat:
The Basal Metabolic Rate (BMR) is the
sleeves and coats in winter. With such predictive and feedforward controls,
number of calories we burn as our body
the burden of feedback control is greatly lifted. performs basic (basal) life-sustaining
function. An average man has a BMR
Using these temperature-control activities, fine-tuned naturally as we of around 7,100 kJ per day, while an
grow, our body can respond to internal and external stimuli and make average woman has a BMR of around
adjustments to keep the body within one or two degrees of the normal 5,900 kJ per day. See more at https:
//www.betterhealth.vic.gov.au/health/
temperature, whether in summer or winter, at the north pole or in the
conditionsandtreatments/metabolism.
Sahara Desert!
More formally, feedback is the use of information of the past or the present
to influence behaviors of a system. A system is an interconnection of
elements and devices for a desired purpose. In your undergraduate control
course, you have obtained basic understandings of a control system with
concepts such as transfer functions, proportional integral derivative (PID)
controllers, and frequency responses in classic control. Below, we provide
a brief review of the key concepts and terminologies.
We use a block diagram such as the one in Figure 1.1 to visualize the
system structure and the interconnection of system components. Here, the
plant consists of: (i) a process whose output is to be controlled and (ii) an
actuator – a physical device capable to influence the controlled variable
of the process. The sensor measures the output of the plant and feeds it
back to be compared to a reference signal. The error after the comparison
then drives the controller to generate the command for the actuator. It
is not uncommon to have an input filter that shapes the reference signal:
2 1 Introduction
Disturbance
Plant
Reference Output
+
Input filter Controller Actuator Process
−
Sensor
An open-loop control system (cf. Figure 1.2) is one where the output of the
plant does not influence the input to the controller.
Disturbance
Heat Loss
Desired 𝑇 − Room 𝑇
Thermostat Gas Valve Furnace House
+
reference is useful. This is often the case in machine tool control and robot
control. Feedforward control is also effective if the disturbance signal can
be measured or estimated. Figure 1.4 shows a control system that integrates
these benefits of feedback and feedforward controls.
Feedforward
Controller
Disturbance
Desired Error
output + 𝑒(𝑡) Feedback + Controlled 𝑦(𝑡)
− Controller + Plant
𝑢(𝑡)
Sensors
Figure 1.4: Control system with feedfor-
ward control.
To achieve the control objectives, the control engineer must model the
controlled plant, analyze the characteristics of the plant, design control
algorithms (controllers), analyze performance and robustness of the control
system, and implement the controller.
fer func
ns
Tra
tio
Discreti-
n
zation
ate e LQG
St
spac
Block Z
Diagram Kalman
Probability
Transform
State Theory Filter
Lap e
Space
l ac LQR
System Causality Least
Realization Linear &
Nonlinear Square
State Estimate
Estimation
Static &
Dynamic
Stability
Controll-
ability
Observa-
bility
Figure 1.5: Overview of book topics from
system description to estimation and con-
trols.
𝜏 = 𝐽 𝛼 .
|{z} |{z} |{z}
net torque moment of inertia angular acceleration Power Connector
Jumper Block
Actuator
Let the angular position 𝜃 be the output and 𝜏 be the input. Then the IDE Connector
input-output dynamics follow the formula: Figure 2.1: Major components in a hard
disk drive.
1 https://en.wikipedia.org/wiki/
𝜃¥ = 𝛼 = 𝜏.
𝐽
Hard_disk_drive#/media/File:
Hard_drive-en.svg
10 2 Modeling
P cv
100
Gain [dB] 50
-50
10 1 10 2 10 3 10 4
Frequency [Hz]
-90
Phase [deg.]
-180
-270
-360
10 1 10 2 10 3 10 4
Figure 2.2: Example frequency response Frequency [Hz]
of the voice coil motor in a hard disk drive.
position: 𝑦(𝑡)
𝑘
𝑚 𝑢=𝐹
𝑦(𝑘 + 1) = 𝑓 (𝑦(𝑘), 𝑦(𝑘 − 1), . . . , 𝑦(𝑘 − 𝑛), 𝑢(𝑘), 𝑢(𝑘 − 1), . . . , 𝑢(𝑘 − 𝑛)),
Example 2.3.1 (Banking and Interest Rate) In a bank account, let 𝑥(𝑘)
Figure 2.3: Isaac Newton (1642-1726)
denote the beginning balance at the 𝑘 -th month, and let 𝑢(𝑘) denote the developed Newton’s laws in 1686. He is
accumulated deposit/credit or payment/debit during the 𝑘 -th month). an extremely brilliant scientist and in the
A discrete dynamic model to describe the balance at the beginning of meantime often known to be eccentric.
He was described as "...so absorbed in his
every month is studies that he forgot to eat".
https://en.wikipedia.org/wiki/
𝑥(𝑘 + 1) = (1 + 𝑎(𝑘))𝑥(𝑘) + 𝑢(𝑘), Isaac_Newton#/media/File:
Portrait_of_Sir_Isaac_Newton,_1689.jpg
where 𝑎(𝑘) is the interest rate of the 𝑘 -th month. This model is used for a
variety of purposes, for example, to predict the balance after 12 months
assuming the interest rate and the pattern of deposit during the period.
The AFM system has two working modes: the tapping mode and the contact
mode. A contact mode AFM system that images a sample surface is shown
in Figure 2.4. The system consists of a cantilever with an atomic-point
needle that scans the sample’s surface. The contact point follows the surface
topology by moving up and down. A laser beam is directed at the cantilever
and is reflected onto a photodiode that measures the beam’s exact location.
Based on this information, a control system can adjust the position of the
cantilever (or the sample under it). The height of the point is recorded as
the surface height at that location. A map of the surface can be created by
combining the heights from the whole scan.
The control system aims to maintain a constant force on the sample surface
by the needle tip. The cantilever deflection changes with the force on the
needle, and the photodiode can sense the laser movement. This information
is fed into the control system, which adjusts the sample height to keep the
cantilever deflection at the desired level.
The needle encounters forces on the nanoscale that are not obvious to us.
Forces such as the attractive van der Waals force, which pulls molecules
together, and the repulsive Pauli force, which pushes molecules away,
influence the needle as it moves across the surface, in addition to the
reaction force from the surface. These forces are nonlinear. However,
[1]: Schitter et al. (2007), Design and Model- the major mode of AFM is a spring-mass-damper system. Reference [1]
ing of a High-Speed AFM-Scanner created two models, one second-order and one fourth-order, to describe
the dynamics of the AFM system simply, and then more accurately.
Figure 2.5 shows the second-order system. Here, 𝑀1 models the sample
and the upper part of the piezo element, and has a combined mass of
𝑚1 . 𝑀2 models the lower part of the piezo element and the mass of the
2.4 Example: Atomic Force Microscopy 13
𝑑2 𝑥1
𝑚1 = 𝐹,
𝑑𝑡 2
𝑑2 𝑥2 𝑑𝑥 2 (2.3)
𝑚2 2 = −𝑏 2 − 𝑘 2 𝑥2 − 𝐹,
𝑑𝑡 𝑑𝑡
𝑙 = 𝑥1 − 𝑥2 ,
where 𝑙 is the distance between 𝑥 1 and 𝑥 2 as shown in Figure 2.5. Fourth order is known to be the highest-
order model for an AFM system that pro-
vides benefits in control design. Models
with higher orders do not enhance the
To account for the piezo element dynamics, we need to modify the system precision much, but instead will increase
to a fourth-order model. This is done by adding another spring-damper the computational cost considerably.
component. The final schematic model in Figure 2.5 shows 𝑘 1 as the effective
spring constant and 𝑏 1 as the effective damping coefficient of the piezo
element. Force 𝐹 still affects both masses. The fourth-order model includes
the dynamics of the second-order model and also captures high-order
dynamics observed in the frequency response of a real-world AFM system
[2]. [2]: Schitter et al. (2001), High performance
feedback for fast scanning atomic force micro-
scopes
Using first principles in Figure 2.5, when spring and damping effects are
considered between the two masses, the governing equations become:
𝑑2 𝑥1 𝑑𝑥1 𝑑𝑥 2
𝑚1 2 = −𝑏1 − − 𝑘1 (𝑥1 − 𝑥2 ) + 𝐹,
𝑑𝑡 𝑑𝑡 𝑑𝑡
𝑑2 𝑥2 𝑑𝑥1 𝑑𝑥 2 𝑑𝑥2
𝑚2 = 𝑏1 − + 𝑘1 (𝑥1 − 𝑥2 ) − 𝑏2 − 0 − 𝑘 2 𝑥2 − 𝐹.
𝑑𝑡 2 𝑑𝑡 𝑑𝑡 𝑑𝑡
(2.4)
14 2 Modeling
Figure 2.6: Control-related components HDDs are examples of high-precision engineering, as they operate at
in a hard disk drive. nanometer scales and millisecond speeds, while being mass-produced and
affordable. HDDs are also versatile, as they can store any kind of digital
data, from text and images to audio and video. They are truly remarkable
devices that have revolutionized the field of data storage and enabled the
Read more about the HDD mechatronics development of modern computing.
at, e.g.,
1. Hard disk drive - Wikipedia. In a modern HDD, data is stored in circular patterns of magnetization
https://en.wikipedia.org/wiki/ known as data tracks or simply, tracks (Figure 2.6). During reading and
Hard_disk_drive. writing of the data, the disk spins and the read/write head is controlled to
2. Anatomy of a Storage Drive: Hard
follow the circular tracks. This creates the track-following problem, where
Disk Drives | TechSpot. https:
//www.techspot.com/article/ the servo system performs regulation control to position the read/write
1984-anatomy-hard-drive/ head at the desired track, with as low variance as possible. During track
Accessed 6/7/2023. following, the position errors are measured periodically at servo sectors
3. Hard disk | Definition
& Facts | Britannica.
that are embedded uniformly over one period of rotation of the disk.
https://www.britannica.com/ Suppose a disk has a rotational speed of 7200 revolutions per minute
technology/hard-disk Accessed (rpm) and the number of servo sectors are 220. Then at every revolution
6/7/2023. of the disks, 220 measurements are obtained, at a sampling frequency of
220 × 7200/60 (= 26 , 400) Hz.
P cv
100
50
Gain [dB]
-50
10 1 10 2 10 3 10 4
Frequency [Hz]
-90
Phase [deg.]
-180
-270
-360
10 1 10 2 10 3 10 4
Figure 2.7: Baseline model of the VCM
Frequency [Hz]
component in an HDD.
% modeling/hddvcm.m
% MATLAB code to generate a single-stage HDD model
num_sector=420; % Number of sector
num_rpm=7200; % Number of RPM
Ts = 1/(num_rpm/60*num_sector); % Sampling time
% VCM
Kp_vcm=3.7976e+07; % VCM gain
omega_vcm=[0, 5300 ,6100 ,6500 ,8050 ,9600 ,14800 ,17400 ,21000 ,26000
↩→ ,26600 ,29000 ,32200 ,38300 ,43300 ,44800]*2*pi;
kappa_vcm=[1, -1.0 ,+0.1 ,-0.1 ,0.04 ,-0.7 ,-0.2 ,-1.0 ,+3.0 ,-3.2
↩→ ,2.1 ,-1.5 ,+2.0 ,-0.2 ,+0.3 ,-0.5 ];
zeta_vcm =[0, 0.02 ,0.04 ,0.02 ,0.01 ,0.03 ,0.01 ,0.02 ,0.02 ,0.012
↩→ ,0.007 ,0.01 ,0.03 ,0.01 ,0.01 ,0.01 ];
Sys_Pc_vcm_c1=0;
for i=1:length(omega_vcm)
Sys_Pc_vcm_c1=Sys_Pc_vcm_c1+tf([0,0,kappa_vcm(i)]*Kp_vcm,[1,
↩→ 2*zeta_vcm(i)*omega_vcm(i), (omega_vcm(i))^2]);
end
%% Frequency response
f=logspace(1,log10(60e3),3000);
Fr_Pc_vcm_c1=squeeze(freqresp(Sys_Pc_vcm_c1,f*2*pi)).';
figure
subplot(211)
semilogx(f,20*log10(abs(Fr_Pc_vcm_c1)))
title('P_{cv}');xlabel('Frequency [Hz]');ylabel('Gain
↩→ [dB]');grid;axis([1e1 f(end) -90 100])
subplot(212)
semilogx(f,mod(angle(Fr_Pc_vcm_c1)*180/pi+360,360)-360)
xlabel('Frequency [Hz]');ylabel('Phase [deg.]');grid;axis([1e1 f(end)
↩→ -360 0]);yticks(-360:90:0)
% if you want, you can save the images as follows:
16 2 Modeling
% saveas(gcf,'images/hdd_pcvm_baseline.pdf')
% saveas(gcf,'images/hdd_pcvm_baseline.png')
# modeling/hddvcm.py
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
import control as ct
# VCM
Kp_vcm = 3.7976e+07 # VCM gain
omega_vcm = np.array([0, 5300, 6100, 6500, 8050, 9600, 14800, 17400,
21000, 26000, 26600, 29000, 32200, 38300, 43300,
↩→ 44800]) * 2 * np.pi
kappa_vcm = np.array([1, -1.0, +0.1, -0.1, 0.04, -0.7, -
0.2, -1.0, +3.0, -3.2, 2.1, -1.5, +2.0, -0.2, +0.3,
↩→ -0.5])
zeta_vcm = np.array([0, 0.02, 0.04, 0.02, 0.01, 0.03, 0.01,
0.02, 0.02, 0.012, 0.007, 0.01, 0.03, 0.01, 0.01,
↩→ 0.01])
Sys_Pc_vcm_c1 = ct.TransferFunction(
[], [1]) # Create an empty transfer function
for i in range(len(omega_vcm)):
Sys_Pc_vcm_c1 = Sys_Pc_vcm_c1 + ct.TransferFunction(np.array(
[0, 0, kappa_vcm[i]]) * Kp_vcm, np.array([1, 2 * zeta_vcm[i] *
↩→ omega_vcm[i], (omega_vcm[i]) ** 2]))
# Frequency response
f = np.logspace(1, np.log10(60e3), 3000)
w = f * 2 * np.pi
magPc_vcm, phase_Pc_vcm, omega_Pc_vcm = ct.freqresp(
Sys_Pc_vcm_c1, w) # Get the frequency response
plt.figure()
plt.subplot(211)
plt.semilogx(f, 20*np.log10(magPc_vcm))
plt.title('$P_{cv}$')
plt.xlabel('Frequency [Hz]')
plt.ylabel('Gain [dB]')
plt.grid()
plt.axis([10, f[-1], -90, 100])
plt.subplot(212)
plt.semilogx(f, np.mod(phase_Pc_vcm*180/np.pi+360, 360)-360)
plt.xlabel('Frequency [Hz]')
plt.ylabel('Phase [deg.]')
plt.grid()
plt.axis([10, f[-1], -360, 0])
plt.yticks(np.arange(-360, 90, 90))
20
-
Gain [dB]
10
-10
10 3 10 4
Frequency [Hz]
180
90
Phase [deg.]
-90
-180
10 3 10 4 Figure 2.9: Baseline model of the PZT
Frequency [Hz] component in an HDD.
% modeling/hddpzt.m
% MATLAB code to generate the pzt-stage HDD model
num_sector=420; % Number of sector
num_rpm=7200; % Number of RPM
Ts = 1/(num_rpm/60*num_sector); % Sampling time
% PZT
omega_pzt=[14800 ,21500 ,28000 ,40200 ,42050,44400,46500
↩→ ,100000]*2*pi;
kappa_pzt=[-0.005,-0.01 ,-0.1 ,+0.8 ,0.3 ,-0.25 ,0.3 ,10.0 ];
zeta_pzt =[0.025 ,0.03 ,0.05 ,0.008 ,0.008 ,0.01 ,0.02 ,0.3 ];
Sys_Pc_pzt_c1=0;
for i=1:length(omega_pzt)
Sys_Pc_pzt_c1=Sys_Pc_pzt_c1+tf([0,0,kappa_pzt(i)],[1,
↩→ 2*zeta_pzt(i)*omega_pzt(i), (omega_pzt(i))^2]);
end
Sys_Pc_pzt_c1=Sys_Pc_pzt_c1/abs(freqresp(Sys_Pc_pzt_c1,0));
18 2 Modeling
%% Frequency response
f=logspace(1,log10(60e3),3000);
Fr_Pc_pzt_c1=squeeze(freqresp(Sys_Pc_pzt_c1,f*2*pi)).';
figure
subplot(211)
semilogx(f,20*log10(abs(Fr_Pc_pzt_c1)))
title('P_{cp}');xlabel('Frequency [Hz]');ylabel('Gain
↩→ [dB]');grid;axis([1e3 f(end) -10 30])
subplot(212)
semilogx(f,angle(Fr_Pc_pzt_c1)*180/pi)
xlabel('Frequency [Hz]');ylabel('Phase [deg.]');grid;axis([1e3 f(end)
↩→ -180 180]);yticks(-180:90:180)
# modeling/hddpzt.py
import numpy as np
import matplotlib.pyplot as plt
import control as ct
# PZT
omega_pzt = np.array([14800, 21500, 28000, 40200, 42050,
44400, 46500, 100000]) * 2 * np.pi
kappa_pzt = np.array([-0.005, -0.01, -0.1, +0.8, 0.3, -0.25, 0.3,
↩→ 10.0])
zeta_pzt = np.array([0.025, 0.03, 0.05, 0.008, 0.008, 0.01, 0.02,
↩→ 0.3])
# Frequency response
f = np.logspace(1, np.log10(60e3), 3000)
w = f * 2 * np.pi
plt.figure()
plt.subplot(211)
plt.semilogx(f, 20*np.log10(magPc_pzt))
plt.title('$P_{cp}$')
plt.xlabel('Frequency [Hz]')
plt.ylabel('Gain [dB]')
plt.grid()
plt.axis([1000, f[-1], - 10, 30])
plt.subplot(212)
plt.semilogx(f, phase_Pc_pzt*180/np.pi)
2.6 Model Properties 19
plt.xlabel('Frequency [Hz]')
plt.ylabel('Phase [deg.]')
plt.grid()
plt.axis([1000, f[-1], - 180, 180])
plt.yticks(np.arange(-180, 270, 90))
With the VCM and PZT models, a dual-stage HDD model can be formed
as follows.
% MATLAB:
Sys_Pc = [Sys_Pc_vcm_c1; Sys_Pc_pzt_c1];
# Python
Sys_Pc = ct.append(Sys_Pc_vcm_c1, Sys_Pc_pzt_c1)
M is said to be
for any input signals 𝑢1 (𝜎) and 𝑢2 (𝜎), and any real numbers 𝛼 1 and 𝛼 2 . If
not, the system is nonlinear.
Fup y
mg
Let 𝑦 be the position of the ball, measured down from the base of the
electromagnet. If a current 𝑢 is injected into the coils of the electromagnet,
it will produce a magnetic field which in turn exerts an upward force on
the ball given by 𝐹𝑢𝑝 = − 𝑐𝑢 . Note that the force decreases as 𝑦 2 increases
2
𝑦2
because the effect of the magnet weakens when the ball is further away,
and that the force is proportional to 𝑢 2 which is representative of the power
supplied to the magnet.
Let us assume that we can measure the position 𝑦 of the ball. This can be
arranged optically using light-emitting diodes with photocells.
We can then write a simple model for the motion of the ball from Newton’s
second law as
𝑐𝑢 2
𝑚 𝑦¥ = 𝑚 𝑔 − 2 . (2.6)
𝑦
Note that this is a single-input, single-output nonlinear model. The input
and output of this model are:
2.7 Nonlinear Systems 21
𝑢(𝑡)
?
ℎ(𝑡)
6
𝐴
𝑎, 𝑞 𝑜𝑢𝑡 (𝑡)
Denote by 𝑞 𝑖𝑛 (𝑡) the water flow entering the tank and 𝑞 𝑜𝑢𝑡 (𝑡) the water
flow leaving the tank from a hole of area 𝑎 . Out goal is to obtain a model
that describes the evolution of the tank height ℎ(𝑡) as a function of the
external input 𝑢(𝑡) = 𝑞 𝑖𝑛 (𝑡). Let 𝐴 be the area of the tank. By using the
conservation law we can state that
Let 𝑣 𝑜𝑢𝑡 (𝑡) be the speed of the water at the outlet. Then, 𝑞 𝑜𝑢𝑡 (𝑡) = 𝑎𝑣 𝑜𝑢𝑡 (𝑡).
Torricelli’s law states that the speed of a fluid through a sharp-edged hole
under the force of gravity is the same as the speed p that a body would
acquire in falling freely from a height ℎ , i.e. 𝑣 𝑜𝑢𝑡 (𝑡) = 2 𝑔 ℎ(𝑡), where 𝑔 is
the acceleration due to gravity. Considering all the above, our nonlinear
model is q
1
ℎ¤ = (𝑢(𝑡) − 𝑎 2 𝑔 ℎ(𝑡)).
𝐴
dynamics and writing Euler’s equation for the pendulum, we can readily
arrive at a differential equation model for this system:
¥ = 𝑇𝑐 − 𝑚 𝑔𝑙 sin(𝜃(𝑡)),
𝐼 𝜃(𝑡)
or,
𝑔
¥ = 1 𝑇𝑐 − sin(𝜃(𝑡)),
𝜃(𝑡)
𝑚𝑙 2 𝑙
which is a second-order nonlinear differential equation.
𝑎 tan 𝛿
𝛼 = arctan . (2.7)
𝑏
2.7 Nonlinear Systems 23
O
<latexit sha1_base64="aX5OSAcy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AhTZ3x5Hjat93MoMzvwB9oUHys5CWEdtKmPV2K6NZGQM2LiA1nIKSHhSNkOHCAc7TftFNHs7HOic0aBJJnC6CClNYDbA6weoDPAV4PaJU6MmIKa6myN5ieqHowqoJHBjBgOKygj+vJx+thTK/HjXBV4hk2aCRyVEG7clSPxnrxFsA2SOSDSj4YqUcVq5DHplcXVMDDwAD6frGPuI9gRyIZwvbnfj2N6et5PWDXQ1IUGUFAuC2kjAzreMURIeG8L8hNdPD82cmLmhAvnu/7uNDt+fkJgDhUEyAqEQKrAVsjrleJ660ZN6zEDZOlMCjv/Cf0dP/k+PAcPew97/6AHh3uPznef1pXsCcuIN+DL/oH225x1Ovmzbh4iCmjV/TWm3CK4+ECf2N2KrWe461VNAE6fdCXcKkRrogJg4Qz8MBNTQxW2Wcrhf9Oum3Ykkpl/r5yDW6Ru4XJneTuxOSmuZsa3bCIqtC3/d3UrCIDaQlcmVGUQKPwDExKoLkEqQuJrdZKiVInJW5VPlrizJVILUqcsZDTGbS3as7egjHmebRgjJqOF8xsHcqH8UV3v3f47AkERkqOOGX/7bsOuWKCYcMOso4lCcLaROt87jevtwgCe9P+jpv+fL9pf542d/KOgPuQAA4HhQ6NkwtfwS2/Ue4txiUHRGddFkTgROgthCmFJtDn471ijbaQvWcHwRba2dsNAtDne3KsEsGaNsptUAcTZ4vqc/Psiv1P8y9dJkzxUXbxwqYzd0QLqowtaiFeZQWJ199dQ/nlkGuWic47VVCbvaQsf3qvuXtveiUbumi72jMvG2c7Lfvr1lc/ftnsPCz66VvWp9Zn1n3Ltr6xOtb31pF1ahHrtfWL9av1W+P3xh+Nvxp/z9CbN4qYT6xrT+OffwG2EVC6</latexit>
Given a vehicle speed 𝑣 at its center of mass, the motion of the center of
mass is expressed as:
𝑑𝑥
= 𝑣 cos(𝛼 + 𝜃),
𝑑𝑡
(2.8)
𝑑𝑦
= 𝑣 sin(𝛼 + 𝜃).
𝑑𝑡
𝑣 𝑣 sin 𝛼 𝑣 𝑎 tan 𝛿
𝜃¤ = = = sin arctan . (2.9)
𝑟𝑐 𝑎 𝑎 𝑏
When the steering angle 𝛿 and the angle 𝛼 (known as the slip angle) is
small, the above equation becomes
𝑣
𝜃¤ ≈ 𝛿. (2.10)
𝑏
Let the input 𝑢 be the steering angle 𝛿 . The full set of nonlinear equations
of motion for the vehicle steering problem is now:
-20
Gain [dB]
-40
-60
-80
10 3 10 4
Frequency [Hz]
-90
Phase [deg.]
-180
-270
-360
Figure 2.12: Example frequency responses
10 3 10 4
of the voice coil motor stage in a batch of Frequency [Hz]
hard disk drives.
% modeling/hdddsa.m
% Dual-stage HDD model
num_sector=420; % Number of sector
num_rpm=7200; % Number of RPM
Ts = 1/(num_rpm/60*num_sector); % Sampling time
% VCM
Kp_vcm=3.7976e+07;
omega_vcm=[0, 5300 ,6100 ,6500 ,8050 ,9600 ,14800 ,17400 ,21000 ,26000
↩→ ,26600 ,29000 ,32200 ,38300 ,43300 ,44800]*2*pi;
kappa_vcm=[1, -1.0 ,+0.1 ,-0.1 ,0.04 ,-0.7 ,-0.2 ,-1.0 ,+3.0 ,-3.2
↩→ ,2.1 ,-1.5 ,+2.0 ,-0.2 ,+0.3 ,-0.5 ];
zeta_vcm =[0, 0.02 ,0.04 ,0.02 ,0.01 ,0.03 ,0.01 ,0.02 ,0.02 ,0.012
↩→ ,0.007 ,0.01 ,0.03 ,0.01 ,0.01 ,0.01 ];
% PZT
omega_pzt=[14800 ,21500 ,28000 ,40200 ,42050,44400,46500
↩→ ,100000]*2*pi;
kappa_pzt=[-0.005,-0.01 ,-0.1 ,+0.8 ,0.3 ,-0.25 ,0.3 ,10.0 ];
zeta_pzt =[0.025 ,0.03 ,0.05 ,0.008 ,0.008 ,0.01 ,0.02 ,0.3 ];
% PZT
Sys_Pc_pzt_c1=0;
for i=1:length(omega_pzt)
Sys_Pc_pzt_c1=Sys_Pc_pzt_c1+ss(tf([0,0,kappa_pzt(i)],[1,
↩→ 2*zeta_pzt(i)*0.8*omega_pzt(i)*1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Pd_pzt_c9];
%% Frequency response
f=logspace(1,log10(60e3),3000);
Fr_Pc_vcm_all=squeeze(freqresp(Sys_Pc_vcm_all,f*2*pi)).';
Fr_Pc_pzt_all=squeeze(freqresp(Sys_Pc_pzt_all,f*2*pi)).';
Fr_Pd_vcm_all=squeeze(freqresp(Sys_Pd_vcm_all,f*2*pi)).';
Fr_Pd_pzt_all=squeeze(freqresp(Sys_Pd_pzt_all,f*2*pi)).';
figure
subplot(211)
semilogx(f,20*log10(abs(Fr_Pc_vcm_all(:,1:7))))
hold on
semilogx(f,20*log10(abs(Fr_Pc_vcm_all(:,8:9))),'--')
hold off
title('P_{cv}');xlabel('Frequency [Hz]');ylabel('Gain
↩→ [dB]');grid;axis([1e3 f(end) -90 10])
subplot(212)
semilogx(f,mod(angle(Fr_Pc_vcm_all(:,1:7))*180/pi+360,360)-360)
hold on
semilogx(f,mod(angle(Fr_Pc_vcm_all(:,8:9))*180/pi+360,360)-360,'--')
hold off
xlabel('Frequency [Hz]');ylabel('Phase [deg.]');grid;axis([1e3 f(end)
↩→ -360 0]);yticks(-360:90:0)
legend('Case 1','Case 2','Case 3','Case 4','Case 5','Case 6','Case
↩→ 7','Case 8','Case 9','Location','NorthWest')
figure
subplot(211)
28 2 Modeling
semilogx(f,20*log10(abs(Fr_Pc_pzt_all(:,1:7))))
hold on
semilogx(f,20*log10(abs(Fr_Pc_pzt_all(:,8:9))),'--')
hold off
title('P_{cp}');xlabel('Frequency [Hz]');ylabel('Gain
↩→ [dB]');grid;axis([1e3 f(end) -10 30])
subplot(212)
semilogx(f,angle(Fr_Pc_pzt_all(:,1:7))*180/pi)
hold on
semilogx(f,angle(Fr_Pc_pzt_all(:,8:9))*180/pi,'--')
hold off
xlabel('Frequency [Hz]');ylabel('Phase [deg.]');grid;axis([1e3 f(end)
↩→ -180 180]);yticks(-180:90:180)
legend('Case 1','Case 2','Case 3','Case 4','Case 5','Case 6','Case
↩→ 7','Case 8','Case 9','Location','NorthWest')
2.9 Exercise