Citation
Adaptive discrete-time sliding mode control of optical storage devices

Material Information

Title:
Adaptive discrete-time sliding mode control of optical storage devices
Creator:
Settje, Chris
Place of Publication:
Denver, CO
Publisher:
University of Colorado Denver
Publication Date:
Language:
English
Physical Description:
xi, 79 leaves : illustrations ; 28 cm

Subjects

Subjects / Keywords:
Optical storage devices ( lcsh )
Control theory ( lcsh )
Control theory ( fast )
Optical storage devices ( fast )
Genre:
bibliography ( marcgt )
theses ( marcgt )
non-fiction ( marcgt )

Notes

Bibliography:
Includes bibliographical references (leaf 79).
Thesis:
Electrical engineering
General Note:
Department of Electrical Engineering
Statement of Responsibility:
by Chris Settje.

Record Information

Source Institution:
|University of Colorado Denver
Holding Location:
Auraria Library
Rights Management:
All applicable rights reserved by the source institution and holding location.
Resource Identifier:
42613656 ( OCLC )
ocm42613656
Classification:
LD1190.E54 1999m .S48 ( lcc )

Downloads

This item has the following downloads:


Full Text
ADAPTIVE DISCRETE-TIME SLIDING MODE CONTROL OF
OPTICAL STORAGE DEVICES
by
Chris Settje
B.S., Colorado School of Mines, 1993
A thesis submitted to the
University of Colorado at Denver
in partial fulfillment
of the requirements for the degree of
Master of Science
Electrical Engineering
1999


This thesis for the Master of Science
degree by
Chris Settje
has been approved
by
Miloje Radenkovic
Tamal Bose
Jan Bialasiewicz
oSU't/f'T
Date


Settje, Chris (M.S., Electrical Engineering)
Adaptive Discrete-Time Sliding Mode Control of Optical Storage Devices
Thesis directed by Professor Radenkovic
ABSTRACT
Variable structure control is a non-linear control technique developed in the USSR
during the 1950s by Emelyanov and several of his coresearchers. Variable structure
systems (VSS) differ from classic control systems in that their structure is purposefully
changed during the transient process. In VSS the dynamic response is forced to track
or slide along a predefined state space trajectory.
The control law for the digital servo problem using sliding mode control is a linear
combination of the error states, a switching term based upon the sliding line, and a
feedforward term A^ + It is this feedforward term that existing approaches to sliding
mode control have not considered in the context presented here. Specifically, when the
system reference is unknown (as is the case for CD ROM and DVD drives) the calcu-
lation of A^+ becomes nontrivial. It is for this purpose two adaptive techniques are
presented to approximate A.k + ,.
As an added benefit, the adapted coefficients from the position error minimization
technique were exploited to adapt the loop gain of the system. This loop gain exploita-
tion provides added stability and improved control over system dynamics.
In short, the adaptive techniques described in this paper allow the advantages of slid-
ing mode control to be unlocked for the digital servo problem described.
The design techniques are verified through simulation resluts.
Ill


This abstract accurately represents the content of the candidates thesis. I recommend
its publication.
Signed
Miloje Radenkovic
IV


DEDICATION
I dedicate this thesis to my wife for her unwavering support and abiding love through
this arduous journey.


ACKNOWLEDGEMENT
My thanks to Cirrus Logic for their flexibility and financial support over the past four
years.


CONTENTS
Figures...................................................................ix
Tables....................................................................xi
Chapter
1. Introduction...........................................................1
2. Background.............................................................2
2.1 Control Theory........................................................2
2.2 Mathematical Existence Conditions for a Sliding Regime...............8
3. Control of a Second Order System Primary Feedback Switching............10
3.1 Model Definition......................................................10
3.2 VSS Definition.......................................................11
3.3 VSS Gain Selection...................................................11
3.4 VSS Primary Feedback Switching Simulation Results....................13
4. Compensator Reformulation..............................................15
4.1 Discretization and Servo Problem Reformulation........................15
4.2 Adaptive Determination of Lambda(k+1)................................19
4.2.1 Generation of X0 and XI.............................................21
4.3 Techniques for the Estimation of Lambda(k+1).........................22
4.4 Nonadaptive Estimation of Lambda(k+1)................................22
4.4.1 Simulation Results Nonadaptive Estimation of Lambda(k+1)
with Reference Containing Fundamental Frequency.....................23
4.4.2 Simulation Results Nonadaptive Estimation of Lambda(k+1)
with Reference Containing Fundamental Frequency and First Harmonic ... 25
4.5 LMS Adaptive Minimization of Position Error..........................27
vii


4.5.1 Simulation Results Minimization of PES with Reference
Containing Fundamental Frequency...................................27
4.5.2 Simulation Results Minimization of PES with Reference Containing
Fundamental Frequency and First Harmonic ..........................29
4.5.3 Summary of the Minimization of Position Error Technique...........31
4.6 Minimization of the Deviation of Sigma From Ideal..................31
4.6.1 Simulation Results Using Fundamental...............................32
4.6.2 Summary of the Minimization of Sigma Deviation from Ideal..........35
5. Plant Gain Variations.................................................36
5.1 Use of Position Error Minimization Coefficients for Adapting
DC Loop Gain.......................................................39
6. Conclusion ...........................................................44
Appendix
A. MATLAB Source Code for Section 2 ....................................45
B. MATLAB Source Code for Section 4 ....................................48
C. MATLAB Source Code for Section 5 ....................................69
Bibliography ............................................................79
viii


FIGURES
Figure
2.1 Conceptual VSS Control of a Second Order System......................2
2.2 Negative Feedback Phase Portrait.....................................4
2.3 Positive Feedback Phase Portrait.....................................5
2.4 Combined Phase Portrait..............................................6
2.5 VSS Operating Regions................................................7
3.1 Second Order System..................................................10
4.1 Sigma Lambda(k+1) known............................................17
4.2 Reference and Position Lambda(k+1) known...........................18
4.3 Position Error Lambda(k+1) known...................................18
4.4 Block Diagram of LMS Adaptation with Sliding Mode Control............20
4.5 Structure of Runout Compensator......................................20
4.6 Sigma using Nonadaptive Estimation of Lambda(k+1)....................23
4.7 Reference and Position using Nonadaptive Estimation of Lambda(k+1)...24
4.8 Position Error using Nonadaptive Estimation of Lambda(k+1)...........24
4.9 Sigma using Nonadaptive Estimation of Lambda(k+1)....................25
4.10 Reference and Position using Nonadaptive Estimation of Lambda(k+1).26
4.11 Position Error using Nonadaptive Estimation of Lambda(k+1).........26
4.12 Sigma using Minimization of PES....................................27
4.13 Reference and Position using Minimization of PES...................28
4.14 Position Error using Minimization of PES...........................28
4.15 Adapted Coefficients using Minimization of PES.....................29
4.16 Sigma using Minimization of PES....................................30
4.17Reference and Position using Minimization of PES.....................30
IX


4.18Position Error using Minimization of PES...............................31
4.19 Sigma using Minimization of Sigma Deviation from Ideal...............32
4.20 Reference and Position using Minimization of Sigma Deviation from Ideal .33
4.21 Position Error using Minimization of Sigma Deviation from Ideal......33
4.22 Adapted Coefficients using Minimization of Sigma Deviation from Ideal ....34
4.23 Adaption Error using Minimization of Sigma Deviation from Ideal .....35
5.1 DC Gain without Adaption.............................................36
5.2 Effects of DC Gain Changes on Sigma without Adaption................37
5.3 Effects of DC Gain Changes on Position and Ref without Adaption.....38
5.4 Effects of DC Gain Changes on Position Error without Adaption.......38
5.5 Effects of DC Gain Change on Sigma with Adaption....................40
5.6 Effects of DC Gain Changes on Position and Reference with Adaption..40
5.7 Effects of DC Gain Changes on Position Error with Adaption..........41
5.8 DC Gain and Estimated DC Gain with Adaption.........................42
5.9 Product of DC Gain and Estimated DC Gain with Adaption..............42
5.10 Coefficient Error A2 with Adaption.................................43


TABLES
Table
2.1 VSS Operating Regions...............................................8
3.1 Linear Lead/Lag Compensator.........................................13
3.2 Summary of Primary Feedback Simulation Results......................13
XI


1. Introduction
Variable structure control is a non-linear control technique developed in the USSR
during the 1950s by Emelyanov and several of his coresearchers. Variable structure
systems (VSS) differ from classic control systems in that their structure is purposefully
changed during the transient process. In VSS the dynamic response is forced to track
or slide along a predefined state space trajectory. This sliding mode provides the
following advantages:
Insensitivity to variations in the plant parameters.
Exact plant parameter not needed to design a stable VSS controller. Only
bounds of the parameters need to be known.
Insensitivity to external disturbances.
Good dynamic response.
Simplicity of physical realization.
Some of the current applications include:
Process control.
Motor control. (DC, induction, synchronous)
Aircraft control.
Spacecraft control.
Robot control.
In todays literature, VSC has been examined for a wide variety of system types
including nonlinear systems, multi-input/multi-output systems, discrete-time systems,
large scale and infinite-dimensional systems and stochastic systems. Adaptive variable
structure control applied to a linear second order system is the topic of this thesis.


2. Background
This section provides the theoretical development necessary to illustrate the advan-
tages of sliding mode control. In the interest of concept clarity, this background sec-
tion presents a continuous time sliding mode control law. It is only after these
underlying concepts of sliding mode control are presented that digital sliding mode
control is scrutinized.
2.1 Control Theory
The control law developed in the theory of VSS changes the structure of the system
whenever the representative point (RP) crosses certain surfaces in the phase space of
the system, which is determined by the plant. A second order system will be consid-
ered now.
Figure 2.1 Conceptual VSS Control of a Second Order System
The system has two structures, one is the negative feedback mode and the other is the
positive feedback mode. The state space equation of the negative feedback mode is
2


given by equation 2.1.
dxx
~dt
eqn2.1
= Xi
dx^
dt
= -kx j
Where Xj is the position error and X2 is the error velocity. The general solution to
the above differential equations is
= Asin(/Kt + 0)
x2 = jKAcos(jKt + 0)
eq 2.2
Combining the above two equations gives
2 2
l
eq 2.3
The above equation can be plotted in phase plane (Xt X2) as a set of ellipses with
eccentricities A and JKA .
3


Figure 2.2 Negative Feedback Phase Portrait
The state space equation of the positive feedback mode is given by
dx j
-dl =
dxo
---- kr
dt "
eq 2.4
Where Xj is the position error and X2 is the error velocity. The general solution to
equation 2.4 is
Xj = J9,e + B2e
Jkt D -Jkt
+ B2e
Jkt r^n -Jkt
= - jKB2e
eq 2.5
Combining equation 2.4 and equation 2.5 gives
ABxB2 4 KBjB2
eq 2.6
4


The phase portrait of equation 2.6 is a set of hyperbolas with two asymptotes.
Figure 2.3 Positive Feedback Phase Portrait
It is now possible to explain that by switching between the two above structures, the
system response can be ideally constrained on the sliding line given by
a = cx j+x2 = 0 eq 2.7
where
0 < c < Jk
eq 2.8
On this line, the hyperbolic and elliptic lines cross in opposite directions, allowing
the motion of the VSS takes on a special regime, called a sliding regime. In this
regime the structure switches back and forth between positive and negative feedback,
and the RP performs oscillations about the switching line a, alternately following an
elliptical path followed by a hyperbolic path. This sliding will occur until steady state
is obtained at the origin. This sliding line is illustrated in figure 2.4.
5


Figure 2.4 Combined Phase Portrait
Since during the time that the RP is moving along the switching line a=0, we have
the equality cxI + x2 = 0, the motion of the system is described by
cxy + ;t2 = 0 ecl 2-9
and the time domain response for movement along the sliding line is given by
eq 2.10
*,(0 = *\(t\)e
where tj is the time when operating point hits the sliding line. Up until the time tj the
motion of the VSS is described by the positive and negative feedback mode differen-
tial equations. Equation 2.10 gives the mean response of the system around the slid-
ing line. It is extremely important to note the absence of K in equation 2.10. This
means the motion of the system is independent of changes in the plant parameters
while the RP is in the sliding mode. Other observations on equation 2.10 are:
The system response can be made faster by increasing the line slope C.
It demonstrates global stability when on the sliding line.
6


Analysis can be extended to higher order surfaces.
To support the invariance in plant parameters suppose K is varied. The phase
portrait in the neighborhood of the sigma line will change in slope but the hyperbolic
and elliptic structures will still point in opposite directions. This allows the system to
move once again in the sliding regime. Of course the transient response occurring
before the sliding regime is entered will be different.
Sliding mode controllers are also invariant to external disturbances. Suppose
the system is exposed to an external disturbance/(7/ As in the above case, the phase
portrait in the neighborhood of the sigma line will de distorted, but the trajectories
will still point in the opposite directions and the system will again move in a sliding
regime. Again, if the external disturbance occurs before the sliding regime is entered,
the system will not be oblivious to this disturbance.
Next we need to develop switching rules to achieve sliding mode. The phase
plane can be divided into six operating regions.
10
6 -
6 -
Region 6 Region 1
4 -
5 2 -
Region 5
£ n

Region 2
? -2 -
-4 -
Region 4 Region 3
-6 - -
-8 - -
IQI--------'---------1---------1----------1--------1---------1---------'---------1---------1----------1
10 -8 -6 -4 -2 0 2 4 6 8 10
position error (X1)
Figure 2.5 VSS Operating Regions
7


Table 2.1 VSS Operating Regions
Region a aX] aX2
1 + + +
2 + + -
3 - - +
4 - + +
5 - + -
6 + - +
The polarity of these parameters help identify when to switch between the modes.
The system is governed by the control law
U = Ta, ed2-11
where
T', = OCJ when ax, >0 eq2.12
for negative feedback mode, and
Tj = pj whenajcj<0 eq2.13
for positive feedback mode. This is based on a second order system. For a n-th order
the phase space is n-dimensional and the sliding line is replaced by a sliding hyper-
plane.
2.2 Mathematical Existence Conditions
for a Sliding Regime
For validity of sliding mode control, it is absolutely necessary that the component
structure trajectories cross the sliding line in opposite directions. Mathematically this
8


crossover criteria can be defined by
eq2.14
lim
c-Vo
da
dt
<0
for quadrant 2 > quadrant 3 or quadrant 6 > quadrant 5. And by
lim ^ > 0
c^"odt
eq2.15
for quadrant 3 > quadrant 2 or quadrant 5 > quadrant 6. Combining these expres-
sions yields an equivalent inequality known as the existence equation.
i- da A
lim a < 0
o > o dt
eq2.16
The existence equation (equation 2.16) helps to determine the controller parameters
as well as guarantee the RP is moving on the sliding line. Equation 2.16 may also be
written as.
lim a
a -> o
da2
dt
<0
eq 2.17
By equation 2.16 the derivative is negative semidefinate in the neighborhood of the
sliding line, in other words it is a nonincreasing function near a = 0. Consequently,
if equation 2.16 is satisfied, the system itself is therefore conditionally stable relative
to the sliding line. Equation 2.16 is known as the existence equation for a sliding
regime on the line a = 0, though it would be more accurate to call it a sufficient
condition for the system to be conditionally stable with respect to the line a = 0. In
short, the variable structure design problem is then to select the parameters of each of
the structures and to switch between these structures in a way that the existence
equation is never violated.
9


3. Control of a Second Order System
Primary Feedback Switching
Now an application of the above theory will be examined both analytically and
through simulation.
3.1 Model Definition
The theory of VSS will be realized through switching the primary feedback of a sec-
ond order system given by
-x2 -xl
where
Figure 3.1 Second Order System
- r -i
X, _ 0 1 *i + 0
*2 ~a2_ *2 rb\.
eqn 3.1
eq 3.2
I0


eq 3.3
~K
"2 = T
-k,k
hl = ^
eq 3.4
where J is the motor inertia in kg*m/s Kt is the motor torque constant in Nm/A, Kv
is the motor back EMF constant in Nm/A and Kpa is the power amplifier gain in V/V.
3.2 VSS Definition
The sliding line is defined as
and u is defined as
C = ex, + x2 = 0
U = T.x,
eq 3.5
eq 3.6
where
T'j = a, when ax, > 0
for negative feedback mode, and
T', = (3, when ax, < 0
for positive feedback mode.
eq 3.7
eq 3.8
3.3 VSS Gain Selection
The VSS gain T* must be selected to guarantee the existence of a sliding regime. To
guarantee the existence of a sliding regime the following inequality must hold.
r do n
lim a < 0
a -> 0 dt
eq 3.9
To analyze this, the derivative of a along the trajectories of the system is evaluated
, eq3.10
do , w
cx,+x2 = cx2 r/2x2 a\x\ ~ Vx,
ll


eq 3.11
= ~(a2-c)x2-(a] +bly¥)xl
Since on the sliding line a = 0, the equation of the line is x2 = -ex, Substitution
yields
Therefore,
do
lim
a > Out
(a2c -c2 -a, b\yF)x,
lim = (a2c-c2-ajwhen Xj >0
a ->'0^
and
lim = (a2c c2 a, - when Xj < 0
eq 3.12
eq 3.13
eq3.14
Likewise for the '0 case,
lim ^ = (a2c-c2-a,-b, a,)x, whenXjcO
a -> nodt
eq3.15
and
lim = (a2c c2 a, - when Xj > 0
o -> ort
eq3.16
These four limits may be overconstrained and ¥ becomes bound by
1 eq3.17
a, > {a2c cL a,)
b\
1 , eq 3.18
Pi <^{a2c-cz-ax)
If the above two inequalities are violated so is the existence equation and the exist-
ence of the sliding regime is not guaranteed. Thus, equation 3.17 and equation 3.18
are necessary and sufficient for the existence of a sliding regime on a = 0.
12


Substituting the actual values from the motor model yields the following set of ine-
qualities
ai>k Akvc + Jc2 + ks) KpaKt eq3.19
M* k(kvc + Jc2 + ks) eq3.20
3.4 VSS Primary Feedback Switching Simulation Results
A summary of the MATLAB simulation are presented in this section. The strengths
of VSS are illustrated through a direct comparison of VSS and a linear lead/lag com-
pensator during control of a second order system plant. The linear lead/lag system is
detailed in table 3.1.
Table 3.1 Linear Lead/Lag Compensator
parameter value units
open loop crossover 1050 Hz
gain margin 25.8 dB
phase margin 48.2 degrees
compensator continuous time transfer function s + 6300 s + 700
The two control methods were compared for step response, steady state performance
and parameter variations. The results are summarized in table 3.2.
Table 3.2 Summary of Primary Feedback Simulation Results
Simulation Metric Linear VSS Comments
Steady State error std (m) 5.9e-7 1,7e-7 VSS 350% lower
error mean (m) -2.5e-9 -3.le-9 VSS 120% lower
13


Table 3.2 Summary of Primary Feedback Simulation Results
Gain Variation error std (m) 1.5e-3 1,7e-4 VSS lower
error mean (m) -l.le-5 -9.2e-7 VSS lower
Step Response 1 % settle time (samples) 317 288 VSS 29 samples faster
It can be seen from the above table that VSS achieves a higher level of performance
that the simple lead/lag compensator it was compared against.
14


4. Compensator Reformulation
The introduction in section 2 was presented in continuous-time for the purpose of clar-
ification and simplicity in understanding the underlying principles of sliding mode
control. This section will describe a design methodology for discrete time sliding
mode control. It is important to note that theoretically, discrete time sliding mode con-
trol systems can not be obtained from their continuous counterparts by means of sim-
ple equivalence.
The discrete time control law used here was created by Gao and is named the reaching
law approach. In this approach the following three attributes are always satisfied:
Starting from any initial state, the trajectory will move monotonically toward
the switching plane and cross in finite time.
Once the trajectory has crossed the switching plane the first time, it will
cross the plane again in every successive sampling period, resulting in a zig-
zag motion about the switching plane.
The size of each successive zigzagging step is nonincreasing and the trajec-
tory stays within a specified band.
It is the properties of the third attribute that are used for the adaptive principles pre-
sented in both this section and the following section.
4.1 Discretization and Servo Problem Reformulation
Consider a discrete time system
xk+ l = 0Xk + ruk
eqn 4.1
where X is the state vector, u is the input vector, is the state matrix and T is the
input matrix. By employing the reaching law approach, Gao composed the following
15


control law
where
*+ 1 = ko^-Asignc*
k = cEk
eq 4.2
eq 4.3
To utilize the reaching law control law in the context of a servo system the error must
be defined as
h
= Rk-*k
eq 4.4
where Rk is the reference.
Substituting equation 4.3 into equation 4.2 yields
cek+1 = Xcek- Asignok eq4.5
c(Rk + (Xk + Tuk)) = Xc(Rk Xk) Asigncr* ed 4-6
Solving for uk yields the control law for the servo problem
uk = c{<$> Xl){cYyX zk + c(Rk+x-<&Rk){cT)-X + A(cT)
Defining
T = c( ^k+\ = c(Rk+ 1
signak(cT)
-1 eq 4.7
eq 4.8
eq 4.9
and
p = a (cry
yields
uk = ^ek + Ak+1 +psign ak
eq4.10
eq 4.11
In summary, the control law for the servo problem is a linear combination of the error
states, a feedforward term that requires knowledge of the reference, and a switching
term based upon the sliding line. Note that for the regulator problem generally dis-
16


cussed in the literature, the reference term Ak + is set to zero for all states. But, for
optical storage devices, A^. + = 0 is not a valid assumption and it is to the solution
of equation 4.9 that adaptive methods are applied.
For reference going forward, simulation results are presented here where the refer-
ence term Ak + t is completely known. Although this is not physically realizable, it
will serve as a basis for comparison in subsequent sections. These simulation results
are for a second order system. First o is presented
sigma
8 -
6 -
2,;
4 - H
'l.................................................. i
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
samples
Figure 4.1 Sigma Lambda(k+1) known
Next the reference position and the actual position are presented (note they are indis-
17


tinguishable in the following plot)
Reference and position
Figure 4.2 Reference and Position Lambda(k+1) known
And finally the error (error = reference position).
0.1
0.08
0.06
0.04
0.02
§ 0
0 02
-0.04
-0.06
0.08
0.1
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Position Error
i i i i----------1----------1----------1 i
Figure 4.3 Position Error Lambda(k+1) known
18


4.2 Adaptive Determination of Lambda(k+1)
Ak+ j may be thought of as a feed forward term into the control effort. If the refer-
ence Rk is completely known (including all future values of Rk), Ak+ i is simply
calculated using equation 4.9. (The simulation results for this case were presented in
section 4.1) Unfortunately for optical disk drives such as CDROM and DVD, the ref-
erence is unknown. But, fortunately, the reference is dominated by either a single fre-
quency or a single frequency plus harmonics. Therefore, the control loop must follow
this reference, commonly referred to in practice as runout. In this application, runout
is sinusoidal and takes the form asin(cot + 0). Using a trigonometric identity the
runout can be represented as
asin(cot + 0) = A0 sin (cot) + A, cos (cot) eq4.12
where A0 and Aj are the parameters to be adapted and are ideally
A0 = acos(0) eq 4.13
and
A. = asin(0) eq4.14
Hence, the purpose of the adaptive runout compensator is to find A0 and A] such that
the feedforward command A0sin(cot) + Ajcos(cot) nullifies the effects of the runout
a sin (cot + 0). In general the reference is modeled as
m eq 4.15
Rk = ^ (An ksin (nwk) + Bn kcos(nwk))
n =
where the coefficients An and Bn are unknown.
The following figure illustrates the system under discussion
19


Figure 4.4 Block Diagram of LMS Adaptation with Sliding Mode Control
The structure of the LMS Adaptive filter is shown in the figure below
X0 = sin(nwk)
X-|=cos(nwk)
Figure 4.5 Structure of Runout Compensator
The goal is to minimize the energy in the error signal e, at the runout frequency.
20


However, if e ] is minimized, e is also minimized, e] is minimized by using the fol-
lowing error cost function
2
1
The expression for ej is
e\{k) = Kre-x0a0-xxa
eq4.16
where Kr is the compensator gain. Squaring yields,
222^222 eq4.17
el = Kre + XqCIq + jcjj + 2x0a0xxax 2Kr(x0a0 + x,aj)
The steepest descent may be calculated as
del2 eq418
=: = 2x0(x0a0 + xlal Kre) = -2x0el
da0
del2 eq4.19
3^- = 2xl(x0a0 + xlal-Kre) = -2xxex
Ultimately, the means of adapting the gains becomes
a^k+l) = ai(k) + 2|lx(e eq4.20
4.2.1 Generation of X0 and Xj
A crucial element in the success of the adaptive runout compensator is the generation
of Xq and X-|. The difficulty of accurately creating X0 and X-| is increased in an opti-
cal drive that uses CLV (Constant Linear Velocity refers to a constant linear scanning
velocity and thus a constant data rate) mode by the fact that the spindle rotational rate
(and thus the runout frequencies) is constantly changing. For this algorithm to be
successful w must be closely related to the present spindle speed at all times.
This is achieved in practice by using a hardware counter specifically designed for
this purpose. This special counter remains locked to the spindle rate, thus accurately
21


passing information on w to the algorithm. The algorithm then uses either a look-up
table or a function approximating equation to generate jc0 = sin(w&) and
X] = cos(wk).
This hardware counter will also accommodate harmonic content in the reference fre-
quency. In other words, this counter does not limit the algorithm to compensating for
the fundamental runout frequency only. As in the fundamental case, the counter can
pass information on w to either a look-up table or a function approximating equation
to generatex0 = sin ((n + 1 )wk) and x, = sin((n + 1 )wk), where n is the desired
harmonic number.
4.3 Techniques for the Estimation of Lambda(k+1)
Since w is known, the determination of Ak+ (equation 4.9) may be found by deter-
mining the coefficients that accomplish one of the following
Nonadaptive Estimation
LMS Adaptive Minimization of Position Error
LMS Adaptive Minimization of the Deviation of a from Ideal
These three possibilities are explored in the following three sections.
4.4 Nonadaptive Estimation of Lambda(k+1)
For a comparison of adaptive and non-adaptive techniques for estimating Ak+l, the
following non-adaptive estimate of Ak+ is used. The development of this non-
adaptive method is done by noting that equation 4.9 may be rewritten as
A > / T-c-l a / r^-1 eq4.21
Ak+] = uk-c&(cV) ek + Xck(cr) Asigna^CcT)
using the sliding identity equation 4.2, equation 4.21 becomes
_l -i eq4.22
A*+1 = M*-c(cr) Ek + ak+l(cT)
22


For this example, Ak + may is estimated by
A ic + i = A.k
uk_l-c^>(cT) lek_, + o^cT)
eq 4.23
4.4.1 Simulation Results -- Nonadaptive Estimation of
Lambda(k+1) with reference containing
fundamental frequency
The simulation results are presented in this section.
sigma
8 -
6 -
2 -
2-
-4 -
-6 -
-8 -
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
samples
Figure 4.6 Sigma using Nonadaptive Estimation of Lambda(k+1)
Note the modulation on a due to the estimation error. Next the reference and actual
23


position are presented.
Reference and position
Figure 4.7 Reference and Position using Nonadaptive Estimation of Lambda(k+1)
And finally the position error is presented. Due to the estimation error, the position
error is larger than the ideal case as shown in figure 4.3.
Position Error
0.11-------1-------1------1-------1------1-------1-------1-------1------1----
0.08 -
0.06 -
0.04 ' A A A
0.02 / j i / j
* 0-. \ \ ; i ; l j.
-0.02 } ; -
-0.04 - V
-0 06 -
o.oe -
0.1'------1-------1------1-------1------1-------1-------1-------1------1----
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
Figure 4.8 Position Error using Nonadaptive Estimation of Lambda(k+1)
24


4.4.2 Simulation Results Nonadaptive Estimation of
Lambda(k+1) with reference containing
fundamental frequency and first harmonic
The simulation results are presented in this section for a reference containing both
the fundamental frequency and the first harmonic. See figure 4.10.
sigma
----1----1----1----1---1----1----1----I----1--!
8
6
2 -
-6 J
-8 -
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
samples
Figure 4.9 Sigma using Nonadaptive Estimation of Lambda(k+1)
Note the modulation on a due to the estimation error. Next the reference and actual
25


position are presented.
Reference and position
Figure 4.10 Reference and Position using Nonadaptive Estimation of Lambda(k+1)
And finally the position error is presented.
Figure 4.11 Position Error using Nonadaptive Estimation of Lambda(k+1)
26


4.5 LMS Adaptive Minimization of Position Error
Now the minimization of position error will be discussed. As illustrated by the fol-
lowing simulation, position error minimization with sliding mode control shows sys-
tem performance benefits. By implementing this method the control law now
becomes
uk = x¥e.k + [lsign(ck) +ffwdk eq4.24
where
ffwdk = A0 sin (tor) + A, cos (cor) eq4.25
By eliminating the necessity of directly calculating Ak + j we have reduced the com-
putational burden of the processor significantly.
4.5.1 Simulation Results Minimization of PES with
reference containing fundamental frequency
The simulation results are presented in this section. Note the modulation of a due to
the feedforward term estimation error ek = Ak+l- Ak+\.
sigma
8 -
0
1000 2000 3000
4000 5000 6000
samples
_______j
9000
Figure 4.12 Sigma using Minimization of PES
27


And again the reference and position are presented.
Figure 4.13 Reference and Position using Minimization of PES
The important point to notice is that although the modulation on a is still present
(figure 4.12) the energy at the reference frequency has been eliminated as witnessed
in the position error plot.
Figure 4.14 Position Error using Minimization of PES
28


Next, the coefficients are examined
Figure 4.15 Adapted Coefficients using Minimization of PES
4.5.2 Simulation Results Minimization of PES with
reference containing fundamental frequency
and first harmonic
In this example, the reference contains not only the fundamental but also the first
harmonic. The adaptation algorithm requires two coefficients adapt for each fre-
quency component of the reference for which attenuation is desired. In this case,
since the reference consists of two frequency components, a total of four parameters
29


are adapted. The simulation results are presented in this section.
sigma
-6
*6
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
samples
Figure 4.16 Sigma using Minimization of PES
And again the reference and position are presented.
Reference and position
Figure 4.17 Reference and Position using Minimization of PES
Again the important point to notice is that although the modulation on o is still
present (figure 4.16) the energy at the reference frequency has been eliminated as
30


witnessed in the position error plot.
Position Error
'
0.08 1
0.06 - -
0.04 .
0.02 \
| w'V
o un 1 ~
-0.02 :
-0.04
0.06 -
0.08

0,1o 1000 2000 3000 4000 5000 6000 7000 8000 9000
Figure 4.18 Position Error using Minimization of PES
4.5.3 Summary of the Minimization of
Position Error Technique
In addition to the standard advantages apparent in the above simulation results, there
are two additional advantages specifically related to minimizing position error with
sliding mode compensation
elimination of feedforward term Ak + j
reduction of c
By reducing the value of c the overall robustness of the system is improved, (note: ro-
bustness is directly related to the value of c.)
4.6 Minimization of the Deviation of Sigma From Ideal
Next, the second adaptive approach is presented. A powerful application of the LMS
adaptive algorithm is described here. In the ideal case the modulation of |g| is bound
by ^ . This information is exploited to develop the following error signals for use
during adaption.
31


For g > 0
A
eq4.26
and for g < 0
eq4.27
By minimizing this error function the algorithm is essentially estimating Ak + and
consequently has the beneficial effect of minimizing the amount of modulation in g .
Although this method does induce a modulation in position error, the modulation can
be bounded by the selection of c.
4.6.1 Simulation Results Using Fundamental
This example illustrates the minimization of the deviation of G from ideal. The con-
trol effort used is described in section 1.3.1 where Ak+l is eliminated. Notice the
modulation of g is nearly eliminated while the position error modulation has
returned.
sigma
1000 2000 3000 4000 5000 6000 7000 8000 9000
samples
Figure 4.19 Sigma using Minimization of Sigma Deviation from Ideal
32


Reference and position
Figure 4.20 Reference and Position using Minimization of Sigma Deviation from
Ideal
Position Error
i----------1---------1----------1---------1---------r
1
!
i
I
Figure 4.21 Position Error using Minimization of Sigma Deviation from Ideal
33


And the coefficients are presented.
Coefficients
Figure 4.22 Adapted Coefficients using Minimization of Sigma Deviation from
Ideal
In this technique ffwdk converges to Ak+l. This graph illustrates this point by plot-
ting
ffwd-Ak+l
34


After the coefficients have adapted (about 3000 samples), the error settles to less than
1%.
caplam ffwd estimation error
Figure 4.23 Adaption Error using Minimization of Sigma Deviation from Ideal
4.6.2 Summary of the Minimization of Sigma Deviation from Ideal
Advantages of minimizing the amount of modulation in a are
simplifies the adaptation strategy for plant gain variations (described in
next section)
more accurate knowledge of system performance
no longer necessary to directly calculate Ak + ,
35


5. Plant Gain Variations
Open loop crossover is an important metric in control system design and any DC gain
variation adversely effects this crossover. Following initial calibration of the cross-
over, any subsequent changes in gain (e.g. due to temperature drift) will degrade the
dynamic response of the loop. In order to correct for this degradation, an adaptive DC
gain algorithm is proposed. The following example demonstrates the degradation of
loop dynamics due to DC gain changes of +10% and -10% of nominal. This gain
change is illustrated graphically in figure 5.1.
gain and coda gain (nominal = 1]
1.251-------1---------1----------1---------,--------1---------1------------------
1.2- -I
1.15- -i
1.1 - r------------------1
1.05- I
jC
0.95 -
0.9 - '----------------------------i
0.85 -
0.8 -
0.751-------1---------1----------1---------1--------1---------1---------1--------
0 1000 2000 3000 4000 5000 6000 7000 8000
samples
Figure 5.1 DC Gain without Adaption
36


sigma
4
0 1000 2000 3000 4000 5000 6000 7000 8000
samples
Figure 5.2 Effects of DC Gain Changes on Sigma without Adaption
37


Reference and position
Figure 5.3 Effects of DC Gain Changes on Position and Ref -- without Adaption
Figure 5.4 Effects of DC Gain Changes on Position Error without Adaption
38


5.1 Use of Position Error Minimization Coefficients
for Adapting DC Loop Gain
This method takes advantage of the gain information contained in the coefficients A0
and A! (see section 4.5) once they have converged. By exploiting the linear relation-
ship between loop DC gain and the coefficients, an error signal is formulated and the
DC gain variation is compensated for in the following manner
£,Dc(k) = An(k) An(nominal) eqn5.1
and the loop gain adjusted as
kcode(k+ 1) = kcode{k){ \ + KpeDC(k)) eq 5.2
where Kp is the adaption gain.
In the ideal case
kcode(k + \ )kplant = 1 eq 5.3
where kplant is the actual plant gain.
The gain information is extracted from the runout algorithm without effecting the per-
formance of the runout compensator as described in section 4.5.
The same example used in section 4 will be used to illustrate the use of the LMS
adapted coefficients as a means of adapting DC loop gain. For this example the refer-
ence frequency was held constant (69Hz) and the plant gain was changed +10% and
39


-10%. Anominai was recorded at sample 2000.
3000 4000 5000
samples
6000 7000 8000
Figure 5.5 Effects of DC Gain Change on Sigma with Adaption
Notice the way sigma returns to the nominal value quickly after the gain change, fig-
ure 5.5 shows much improvement when compared to the non-adaptive case simu-
lated in figure 5.2.
Reference and position
Figure 5.6 Effects of DC Gain Changes on Position and Reference -- with Adaption
40


Position Error
Figure 5.7 Effects of DC Gain Changes on Position Error with Adaption
Its also important to note that not only is the DC gain normalized to 1, the position
error has no reference energy present (figure 5.7) thus proving the runout compen-
sator is operating properly even during the DC gain adaption.
gain and code gain (nominal = 1]
1 25 r----------1 i i i i-----------r----------t
1.2 -
1 15 -
1.1 - j---->----------
1 05 -
0.95 - j
0.9 - 1----------^=.----------------
0.85 -
0.8
0.751---------1---------1---------1-------------------1----------1--------1----------
0 1000 2000 3000 4000 5000 6000 7000 8000
samples
41


Figure 5.8 DC Gain and Estimated DC Gain with Adaption
Also figure 5.8 illustrates the fact that the overall loop gain returns to the nominal
value of 1 after adaptation, thus the DC gain adapted accordingly.
1.25
1.2
1.15
1.1
1.05
1
0.95
0.9
0.85
0.8
0.75
plant gain code gain [nominal = 1)
Figure 5.9 Product of DC Gain and Estimated DC Gain with Adaption
The nominal value is one. (see equation 5.3)
42


0.04
Coefficient Error A2
_J,
\ /
1000 2000 3000 4000 5000 6000 7000 8000
samples
Figure 5.10 Coefficient Error A2 with Adaption
In figure 5.10 it can be seen that the steady state value of A2 is nominal (nominal
recorded at sample 2000) after each gain change (gain changes occur at sample 3000
and sample 5000).
In conclusion, this method has been shown to correct for the degradation of perfor-
mance due to DC gain variation. Consequently, the effective open loop crossover is
held constant.
43


6. Conclusion
The control law for the digital servo problem using sliding mode control is a linear
combination of the error states, a switching term based upon the sliding line, and a
feedforward term Afc+ j It is this feedforward term that existing approaches to sliding
mode control have not considered in the context presented here. Specifically, when the
system reference is unknown (as is the case for CD ROM and DVD drives) the calcu-
lation of + [ becomes nontrivial. It is for this purpose two adaptive techniques were
presented to approximate A^ + j. In one technique the position error was minimized
A
and in the other technique
1 +X
was minimized using LMS adaptive techniques.
As an added benefit, the adapted coefficients from the position error minimization
technique were exploited to adapt the system loop gain. It was shown this exploitation
provides added stability and improved control over system dynamics.
In conclusion, the adaptive techniques described in this paper allow the advantages of
sliding mode control to be realized for the second order digital servo problem
described.
44


Appendix A: MATLAB Source Code for Section 2
% plot circles
% 11.25.98
% cts
elf
rad=[l 2 3 45];
k=3;% define the eccentricity
for i=l :length(rad)
radius = rad(i);
x=-radius:0.05:radius;% create semi circle
y=sqrt(k*(radiusA2-(x.A2)));
x=[x -x];% create full circle
y=[y -y];
plot(x,y,r)
hold on
end
grid
axis([-10 10-10 10])
graph Jabel
print -dtiff pos_feed
% plot hyperbolas
% 11.27.98
% cts
%clf
x=-50:.l:50;
y=-50:.l:50;
bl = l;
b2=l;
k=l;
45


for bl = l:5
x=sqrt(( 1 +(y.A2)/4*k*b 1 *b2)*4*b 1 *b2);
plot(x,y)
hold on
plot(-x,y)
plot(y.-x)
plot(y,x)
end
grid on
axis([-10 10-10 10])
graph_label
print -dtiff neg_feed
% standard phase portrait graph labels
xlabelf position error (XI))
ylabelf velocity error (x2))
%title(phase portrait)
% plot VSS operating regions
% 11.25.98
% cts
elf
x=-9:9;
y=-9:9;
plot(x,zeros( 1 ,length(x)))
hold on
plot(zeros( 1 ,length(y)),y)
Y=-.3.*x;
plot(x,Y,g);
graph_label
axis([-10 10-10 10])
text(5,5,Region 1)
text(6,-l,Region 2)
46


text(5,-5,Region 3)
text(-5,-5,Region 4)
text(-8,l,Region 5)
text(-5,5,Region 6)
print -dtiff regions
47


Appendix B: MATLAB Source Code for Section 4
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
%
% for thesis
% plots : smc without any runout comp or adaptive applications
% used for base line or comparison
%can use ideal caplam or estimated caplam by commenting one line below
%
clear all
%Nominal Values:
%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
cl=.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac=l.5/1024;% V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
%cycles=8;
cycles=8;
N=(l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
48


%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input)
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1 ,Gammal]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gammal;
%
% output??
%if plotflag == 1
%dbode(phi, gamma, [1 1],0,T);
%subplot(2,l,l)
%title(Open loop Bode)
%pause
%end
% controller design
c=[13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
mc^phiy^^gamma)^ estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u( 1:2)=[0 0];
49


fbiasmax=(2*delta/(l+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0.1 *ones(2,2);
xl=zeros(2,2);
% define reference
k=[l:N+l];
ref(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5;
k_plant= 1;
c=[13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
ffwd = zeros/1 ,length(ref)+1);
sensor = 0*randn(l,length(ref)+l);% Sensor noise
kcode=1;
k_plant=l;
caplam=[0 0];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
for k=2:N-l
err(:,k)=ref(:,k)-x(:,k)+sensor(l,k);
% Calculate control effort
sigma(k)=c*err(:,k);
% ideal caplam note r(k+l) term does not exist in practice
caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamma);
% actual caplam
% caplam(k)=caplam(k-l);
u(k)=psi*err(:,k)+caplam(k)+mu:t:sign(sigma(k));
x(:,k+l )=(phi*x(:,k)) + (gamma*(u(k) + fbias));
50


caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamma);
end
smc_plots
figure(l)
print -dtiff no_ro_ideal_sigma
figure(2)
print -dtiff no_ro_ideal_refpos
figure(3)
print -dtiff no_ro_ideal_error
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
%
% for thesis
% plots : smc without any runout comp or adaptive applications
% used for base line or comparison
%can use ideal caplam or estimated caplam by commenting one line below
%
clear all
%Nominal Values:
%
Kf= 204 ;%Nt/A
m=.766e-3;% Kg
cl=.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;% V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
51


T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
%cycles=8;
cycles=8;
N=( l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1 .Gamma 1 ]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gamma 1;
%
% output??
%if plotflag == 1
%dbode(phi,gamma,[1 1],0,T);
%subplot(2,l,l)
%title(Open loop Bode)
%pause
%end
% controller design
52


c=[ 13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u(l:2)=[0 0];
fbiasmax=(2*delta/(l+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0.1*ones(2,2);
xl=zeros(2,2);
% define reference
k=[l:N+l];
ref(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5;
k_plant=l;
c=[ 13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
ffwd = zeros/l,length(ref)+l);
sensor = 0*randn(l,length(ref)+l);% Sensor noise
kcode=1;
k_plant=l;
caplam=[0 0];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
for k=2:N-l
err(: ,k)=ref(: ,k)-x(: ,k)+sensor( 1 ,k);
% Calculate control effort
53


sigma(k)=c*err(:,k);
% ideal caplam note r(k+l) term does not exist in practice
%caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamrna);
% actual caplam
caplam(k)=caplam(k-1);
u(k)=psi*err(:,k)+caplam(k)+mu*sign(sigma(k));
x(:,k+l)=(phi*x(:,k)) + (gamma*(u(k) + fbias));
caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamma);
end
smc_plots
figure( 1)
print -dtiff no_ro_sigma
figure(2)
print -dtiff no_ro_refpos
figure(3)
print -dtiff no_ro_error
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp but without adaptive applications
%two frequencies in reference
%
clear all
54


%Nominal Values:
%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
c 1 =.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;%V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=8;
N=(l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1 ,Gammal ]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gammal;
%
55


% controller design
c=[ 13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u( 1:2)=[0 0];
fbiasmax=(2*delta/( 1+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0.1*ones(2,2);
xl=zeros(2,2);
% define reference
k=[l :N+1];
refl(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref2(l,k)=ref_amplitude/2*sin(2*2*pi*k*ref_freq*T + pi/3);% position ref
ref=refl+ref2;
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
sl2=sin(2*2*pi*k*ref_freq*T + pi/4);
s22=cos(2*2*pi*k*ref_freq*T + pi/3);
Mu=5;
k_plant=l;
c=[ 13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
A12 = 72*ones(l,length(ref)+l);
A22 = 73*ones(l,length(ref)+l);
ffwd = zeros/1 ,length(ref)+l);
sensor = 0*randn( 1 ,length(ref)+1);% Sensor noise
56


kcode=1;
k_plant=l;
caplam=[0 0];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
for k=2:N-l
err(:,k)=ref(:,k)-x(:,k)+sensor( 1 ,k);
% Update the adaptive gain coefficients.
A1 (k+1) = A1 (k) + (2*Mu*err( 1 ,k)*s 1 (k));
A2(k+1) = A2(k) + (2*Mu*err(l,k)*s2(k));
% Update the adaptive gain coefficients for first harmonic
A12(k+1) = A12(k) + (2*Mu*err( 1 ,k)*s 12(k));
A22(k+1) = A22(k) + (2*Mu*err(l,k)*s22(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + (A2(k)*s2(k)) + (A12(k)*sl2(k)) + (A22(k)*s22(k));
end
% Calculate control effort
sigma(k)=c*err(:,k);
caplam(k)=caplam(k-1);
u(k)=psi*err(:,k)+caplam(k)+mu*sign(sigma(k));
x(:,k+l)=(phi*x(:,k)) + (gamma*(u(k) + fbias));
caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamma);
end
smc_plots
figure(6)
elf
plot(A12,r)
hold on
plot(A22,b)
hold off
grid
title(Coefficients of First Harmonic)
57


figure(4)
axis([OOON -150 100])
figure(l)
print -dtiff no_ro_sigma2
figure(2)
print -dtiff no_ro_refpos2
figure(3)
print -dtiff no_ro_error2
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp but without adaptive applications
%one frequency in reference
%
clear all
%Nominal Values:
%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
cl=.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac=1.5/1024;%V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
58


% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=8;
N=( l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 1 ;-kl/m -cl/m];
B=[0; (Kf/m) Kdac Kpa];
%
%Translate to Digital Domain:
%
[Phi 1,Gamma 1 ]=c2d( A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gammal;
%
% controller design
c=[13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c:t:gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u( 1:2)=[0 0];
59


fbiasmax=(2*delta/( 1+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0.1 *ones(2,2);
xl=zeros(2,2);
% define reference
k=[l :N+1];
ref(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(ref))=zeros( 1 Jength(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5;
k_plant=l;
c=[13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones( 1 ,length(ref)+l);
ffwd = zeros/l,length(ref)+l);
sensor = 0*randn(l,length(ref)+l);% Sensor noise
kcode=l;
k_plant=l;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
for k=2:N-l
err(:,k)=ref(:,k)-x(:,k)+sensor( 1 ,k);
% Update the adaptive gain coefficients.
Al(k+1) = Al(k) + (2*Mu*err(l,k)*sl(k));
A2(k+1) = A2(k) + (2*Mu*err(l,k)*s2(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + (A2(k)*s2(k));
end
% Calculate control effort
sigma(k)=c*err(:,k);
u(k)=psi*err(:,k)+mu*sign(sigma(k)) + ffwd(k);
x(:,k+l )=(phi*x(:,k)) + (gamma*(u(k) + fbias));
60


end
smc_plots
figure(l)
print -dtiff ro_sigma
figure(2)
print -dtiff ro_refpos
figure(3)
print -dtiff ro_error
figure(4)
print -dtiff ro_coeffs
figure(5)
print -dtiff ffw
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp but without adaptive applications
%two frequencies in reference
%
clear all
%Nominal Values:
%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
cl=.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;%V/cnt
61


Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=8;
N=( l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1 ,Gammal ]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gamma 1;
%
% controller design
c=[l 3 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*l))/(c*gamma);
mu=delta/(c*gamma);
62


L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u(l:2)=[0 0];
fbiasmax=(2*delta/( 1+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0. l*ones(2,2);
xl=zeros(2,2);
(
% define reference
k=[l:N+l];
refl(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref2(l,k)=ref_amplitude/2*sin(2*2*pi*k*ref_freq*T + pi/3);% position ref
ref=refl+ref2;
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
sl2=sin(2*2*pi*k*ref_freq*T + pi/4);
s22=cos(2*2*pi*k*ref_freq*T + pi/3);
Mu=.5;
k_plant=l;
c=[13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
A12 = 72*ones(l,length(ref)+l);
A22 = 73*ones(l,length(ref)+l);
ffwd = zeros) l,length(ref)+l);
sensor = 0*randn(l,length(ref)+l);% Sensor noise
kcode=1;
k_plant=l;
% % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% execute
for k=2:N-l
err(:,k)=ref(:,k)-x(:,k)+sensor( 1 ,k);
63


% Update the adaptive gain coefficients.
A l(k+l) = Al(k) + (2*Mu*err( 1 ,k)*sl(k));
A2(k+1) = A2(k) + (2*Mu*err( l,k)*s2(k));
% Update the adaptive gain coefficients for first harmonic
A12(k+1) = A12(k) + (2*Mu*err(l,k)*sl2(k));
A22(k+1) = A22(k) + (2*Mu*err(l,k)*s22(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + )A2(k)*s2(k)) + (A12)k)*sl2(k)) + (A22(k)*s22(k));
end
% Calculate control effort
sigma(k)=c*err(:,k);
u(k)=psi*err(:,k)+mu*sign(sigma(k)) + ffwd(k);
x(:,k+l)=(phi*x(:,k)) + (gamma*(u(k) + fbias));
end
smc_plots
figure(6)
elf
plot(A12,r)
hold on
plot(A22,b)
hold off
grid
titlefCoefficients of First Harmonic)
figure(4)
axis([000 N -150 100])
figure) 1)
print -dtiff ro_sigma2
figure(2)
print -dtiff ro_refpos2
figure) 3)
print -dtiff ro_error2
64


figure(4)
print -dtiff ro_coeffs2
figure(5)
print -dtiff ffw2a
figure(5)
print -dtiff ffw2b
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp but without adaptive applications
%one frequency in reference
%sigma minimization
%
clear all
%Nominal Values:
%
Kf= 204 ;%Nt/A
m=.766e-3;% Kg
c 1 =.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;% V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
65


% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=8;
N=(l/(ref_freq*T))*cycles;% number of reference periods per sim
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1,Gamma 1 ]=c2d( A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gammal;
%
% controller design
c=[13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u( 1:2)=[0 0];
66


fbiasmax=(2*delta/(l+lambda) delta)/ (c*gamma);
fbias=fbiasmax*fbiasp;
x=0. l*ones(2,2);
xl=zeros(2,2);
% define reference
k=[l:N+l];
ref(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5/5;
k_plant=l;
c=[ 13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
ffwd = zeros) 1 ,length(ref)+1);
sensor = 0*randn)l,length)ref)+l);% Sensor noise
kcode=1;
k_plant=l;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
for k=2:N-l
err(:,k)=ref(:,k)-x(:,k)+sensor( 1 ,k);
if c*err(:,k) > 0
sig_err(k)=c*err(:,k) delta/) 1+lambda);
else
sig_err(k)=c*err(:,k) + delta/) 1+lambda);
end
% Update the adaptive gain coefficients.
Al(k+1) = Al(k) + (2*Mu*sig_err(l,k)*sl(k));
A2(k+1) = A2(k) + (2*Mu*sig_err( 1 ,k)*s2(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + (A2(k)*s2(k));
end
% Calculate control effort
67


sigma(k)=c*err(:,k);
caplam(k) = c*(ref(:,k+l)-(phi*ref(:,k)))/(c*gamrna);
u(k)=psi*err(:,k)+mu*sign(sigma(k)) + ffwd(k);
x(:,k+l)=(phi*x(:,k)) + (gamma*(u(k) + fbias));
end
smc_plots
figure(6)
elf
plot(caplam-ffwd( 1 :length(caplam)))
title(caplam ffwd {{estimation error}})
axis([0N-100/2 100/2]);grid
figure( 1)
print -dtiff ro_sig_sigma
figure(2)
print -dtiff ro_sig_refpos
figure(3)
print -dtiff ro_sig_error
figure(4)
print -dtiff ro_sig_coeffs
figure(5)
print -dtiff sig_ffw
figure(6)
print -dtiff sig_est_error
68


Appendix C: MATLAB Source Code for Section 5
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp and with adaptive applications for DC gain
%
clear all
%Nominal Values:
%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
c 1=.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;% V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=12;
N=( l/(ref_freq*T))*cycles;% number of reference periods per sim
N=8000
%N=100;
%
69


%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 1 ;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1,Gamma 1 ]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gammal;
%
% controller design
c=[13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u(l :2)=[0 0];
x=0. l*ones(2,2);
xl=zeros(2,2);
% define reference
k=[l:N+l];
ref( 1 ,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(reO)=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
70


s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5/2;
k_plant=l;
c=[13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
ffwd = zeros( 1 ,length(ref)+1);
sensor = 0*randn( 1 ,length(ref)+1);% Sensor noise
kcode=1;
k_plant=l;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
%for k=2:N-l
for k=2:N
err(:,k)=ref(:,k)-x(:,k)+sensor( 1 ,k);
% Update the adaptive gain coefficients.
Al(k+1) = Al(k) + (2*Mu*err(l,k)*sl(k));
A2(k+1) = A2(k) + (2*Mu*err(l ,k)*s2(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + (A2(k)*s2(k));
end
% change plant gain
if k==3000
k_plant= 1.1;
ea_gain=0.005;
elseif k==5000
k_plant=0.9;
ea_gain=0.01;
end;
if k>3000
ea(k)=((A2(2999))-A2(k))*ea_gain;
%kcode=kcode*( 1 -ea(k));
end
kc(k)=kcode;% used for plotting only
71


kp(k)=k_plant;% used for plotting only
% Calculate control effort
sigma(k)=c*err(:,k);
u(k)=kcode*k_plant*(psi*err(:,k)+mu*sign(sigma(k)) + ffwd(k));
x(:,k+l)=(phi*x(:,k)) + (gamma*u(k));
end
smc__plots
figure(4)
axis([000 N 75.62 75.74])
figure(6)
elf
plot(l./kc,r)
hold on
plot(kp)
hold off
title(gain and code gain [nominal = 1])
ylabel(% gain)
xlabel(samples)
axis([0 N 0.75 1.25])
grid
figure(7)
elf
plot(kc.*kp)
title(plant gain code gain [nominal = 1])
ylabel(% gain)
xlabel(samples)
axis([0 N 0.75 1.25])
grid
figure(8)
elf
plot(100.*ea)
title(Coefficient Error [A2])
ylabel(Coefficient Error)
xlabel(samples)
grid
72


figure( 1)
print -dtiff ro_dc_sigma
figure(2)
print -dtiff ro_dc_refpos
figure(3)
print -dtiff ro_dc_error
figure(4)
print -dtiff ro_dc_coeffs
figure(5)
print -dtiff ro_dc_ffw
figure(6)
print -dtiff ro_dc_gain
figure(7)
print -dtiff ro_dc_gainx
figure(8)
print -dtiff ro_dc_coeff_error
% LMS runout compensator with sliding mode
% cts
% 3/31/98
%
% Chris Settje
% 4/23/98
% added system ID feature
% for thesis
% plots : smc with runout comp and with adaptive applications for DC gain
%
clear all
%Nominal Values:
73


%
Kf=.204 ;%Nt/A
m=.766e-3;% Kg
c 1 =.0299;%Nt/(m/sec)
kl=58.5;%Nt/m
Kdac= 1.5/1024;% V/cnt
Kpa=0.46;% A/V
Kadc=256/2;% cnts/trk
Ks=2.0/.74e-6;%V/m
T=12e-6;%sec
fbiasp=0;% bias term in percent of max
% simulation parameters
ref_freq=69;% reference frequency in Hz
ref_amplitude=100;% max ref amplitude in bits
cycles=12;
N=(l/(ref_freq*T))*cycles;% number of reference periods per sim
N=8000
%N=100;
%
%Scaling Matrix:
I=eye(2);
%
Q=[Ks*Kadc 0;0 Ks*T*Kadc];
%
%Nominal System Model (Continuous Domain, control input):
%
A=[0 l;-kl/m -cl/m];
B=[0;(Kf/m)*Kdac*Kpa];
%
%Translate to Digital Domain:
%
[Phi 1,Gamma 1 ]=c2d(A,B,T);
%
%Scale the Phi, Gamma Matrices:
%
phi=Q*Phi 1 *inv(Q);
gamma=Q*Gamma 1;
%
% controller design
74


c=[13 1];
delta=2.04;
lambda=0.7;% ???
psi=(c*(phi-lambda*I))/(c*gamma);
mu=delta/(c*gamma);
L=(c*phi)/(c*gamma);% estimate of derivative ref term
cginv=l/(c*gamma);
% initialize sim
u(l:2)=[0 0];
x=0.1 *ones(2,2);
xl=zeros(2,2);
% define reference
k=[l:N+l];
ref(l,k)=ref_amplitude*sin(2*pi*k*ref_freq*T);% position ref
ref(2,1 :length(ref))=zeros( 1 ,length(ref));
sl=sin(2*pi*k*ref_freq*T + pi/4);
s2=cos(2*pi*k*ref_freq*T + pi/3);
Mu=.5/2;
k_plant=l;
c=[13 1]
A1 = 72*ones(l,length(ref)+l);
A2 = 73*ones(l,length(ref)+l);
ffwd = zeros(l,length(ref)+l);
sensor = 0*randn(l,length(ref)+l);% Sensor noise
kcode=1;
k_plant= 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% execute
%for k=2:N-l
for k=2:N
err(:,k)=ref(:,k)-x(:,k)+sensor(l,k);
% Update the adaptive gain coefficients.
A1 (k+1) = A1 (k) + (2*Mu*err( 1 ,k)*s 1 (k));
75


A2(k+1) = A2(k) + (2*Mu*err(l,k)*s2(k));
% Calculate the adpative feedforward for runout
if k>50
ffwd(k) = (Al(k)*sl(k)) + (A2(k)*s2(k));
end
% change plant gain
if k==3000
k_plant= 1.1;
ea_gain=0.005;
el seif k==5000
k_plant=0.9;
ea_gain=0.01;
end;
if k>3000
ea(k)=((A2(2999))-A2(k))*ea_gain;
kcode=kcode*( l-ea(k));
end
kc(k)=kcode;% used for plotting only
kp(k)=k_plant;% used for plotting only
% Calculate control effort
sigma(k)=c*err(:,k);
u(k)=kcode*k_plant*(psi*err(:,k)+mu*sign(sigma(k)) + ffwd(k));
x(:,k+l)=(phi*x(:,k)) + (gamma*u(k));
end
smc_plots
figure(4)
axis([000N 75.62 75.74])
figure(6)
elf
plot(l./kc,r)
hold on
plot(kp)
hold off
titlefgain and code gain [nominal =1])
76


ylabel(% gain)
xlabel(samples)
axis([0 N 0.75 1.25])
grid
figure(7)
elf
plot(kc.*kp)
title(plant gain code gain [nominal = 1])
ylabel(% gain)
xlabel(samples)
axis([0 N 0.75 1.25])
grid
figure(8)
elf
plot(100.*ea)
titlef Coefficient Error {A2})
ylabel(Coefficient Error)
xlabel(samples)
grid
figure(l)
print -dtiff dc_sigma
figure(2)
print -dtiff dc_refpos
figure(3)
print -dtiff dc_error
figure(4)
print -dtiff dc_coeffs
figure(5)
print -dtiff dc_ffw
figure(6)
print -dtiff dc_gain
figure(7)
77


print -dtiff dc_gainx
figure(8)
print -dtiff dc_coeff_error
78


Bibliography
B.K. Bose, Sliding Mode Control of Induction Motor, IEEE CH2207, pp. 479-486,
September, 1985.
J.H. Hung and W.B. Gao and J.C. Hung, Variable Structure Control: A Survey, IEEE
Transaction on Industrial Electronics, Vol 40, No. 1, pp. 2-22, February 1993.
H.N. Ioranou and B.W. Surgenor, Experimental Evaluation of the Robustness of Dis-
crete Sliding Mode Control Versus Linear Quadratic Control, IEEE Transaction on
Control Systems Technology, Vol 5, No. 2, pp. 254-260, March 1997.
U. Itkis, Control Systems of Variable Structure, New York: Wiley, 1976.
V. I. Utkin, VAriable Structure Systems with Sliding Modes,, IEEE Transaction on
Automatic Control, Vol AC-22, No. 2, pp. 212-222, April 1977.
S.I. Sarpturk and Y. Istefanopulos and O. Kaynak, On the Stability of Discrete-Time
Sliding Mode Control Systems,, IEEE Transaction on Automatic Control, Vol AC-
32, No. 10, pp. 930-932, October 1987.
79


Full Text

PAGE 1

ADAPTIVE DISCRETE-TIME SLIDING MODE CONTROL OF OPTICAL STORAGE DEVICES by Chris Settje B.S., Colorado School of Mines 1993 A thesis submitted to the University of Colorado at Denver in partial fulfillment of the requirements for the degree of Master of Science Electrical Engineering 1999

PAGE 2

This thesis for the Master of Science degree by Chris Settje has been approved by Miloje R adenkovic Tarnal Bose Jan Bialasiewicz Date

PAGE 3

Settje, Chris (M.S., Electrical Engineering) Adaptive Discrete-Time Sliding Mode Control of Optical Storage Devices Thesis directed by Professor Radenkovic ABSTRACT Variable structure control is a non-linear control technique developed in the USSR during the 1950's by Emelyanov and several of his coresearchers. Variable structure systems (VSS) differ from classic control systems in that their structure is purposefully changed during the transient process. In VSS the dynamic response is forced to track or "slide" along a predefined state space trajectory. The control law for the digital servo problem using sliding mode control is a linear combination of the error states, a switching term based upon the sliding line, and a feedforward term Ak + 1 It is this feedforward term that existing approaches to sliding mode control have not considered in the context presented here. Specifically, when the system reference is unknown (as is the case for CD ROM and DVD drives) the calcu lation of Ak + 1 becomes nontrivial. It is for this purpose two adaptive techniques are presented to approximate Ak + 1 As an added benefit, the adapted coefficients from the position error minimization technique were exploited to adapt the loop gain of the system. This loop gain exploita tion provides added stability and improved control over system dynamics. In short, the adaptive techniques described in this paper allow the advantages of s lid ing mode control to be unlocked for the digital se rvo problem described. The design technique s are verified through s imulation resluts. Ill

PAGE 4

This abstract accurately repre ents the content of the candidate s thesis. I recommend its publication. Miloje Radenkovic I V

PAGE 5

DEDICATION I dedicate this thesi s to my wife for her unwavering upport and abiding love through this arduous journey.

PAGE 6

ACKNOWLEDGEMENT My thanks to Cirrus Logic for their flexibility and financial support over the pa t four years.

PAGE 7

CONTE TS Figures ........................... ............... ..................... .................... .... ....... .... ............ .... ix Tabl es .................................. ... ..... ....... ............ .... ........ ....... ....... .......... .................. x i Chapter 1 Introduction . ........ . ............ ......................... ......... ......... ......... ............. ..... ..... ... 1 2. Background ...................... . ....................................................... . .... . ........... .... 2 2.1 Contro l Theory ................. ...... .... ......... .......... .... .... . .... .... ....... ... ................. . 2 2.2 Mathematical Existence Conditions for a Sliding Regime ......................... ..... 8 3. Contro l of a Second Order System Primary Feedback Switching ...................... 10 3.1 Model D efinition . .... ..... . . . ...... . .......... ............................ ....................... . ... 10 3.2 VSS Definition ..... ...... ............... ..................................... ...... ....... .... . .... ....... 11 3.3 VSS Gain Selection .......................................................................................... 11 3.4 VSS Primary Feedback Switching Simulation Results .............................. ...... 13 4. Compensator Reformulation ...... ................ .......................... ...... ................. ........ 15 4.1 Discretization and Servo Problem Reformulation ...................... .......... ........ .... 15 4 .2 Adaptive D etermi n ation ofLambda(k+1 ) ........................................................ 19 4.2.1 Generation of XO and X1 ............................................................................... 21 4 3 Techniques for the Estimation of Lambda(k+ 1 ) ...... .... .... ................................ 22 4.4 on a d aptive Estimation of Lambda(k+ 1) ................................ .... .................... 22 4.4.1 Simulation Results--Nonadaptive Estimation ofLambda(k+1) with Reference Containing Fundamental Frequency .................... ...... .......... 23 4.4.2 Simu l ation Re s ults--Nonadaptive Estimat i on ofLambda(k+1) with Reference Containing Fundamental Frequency and First Harmonic ... 25 4 5 LMS Adaptive Minimization of P ositio n Error ................ ... ................... .......... 27 VI I

PAGE 8

4.5 1 Simulation Results--Minimizat ion of PES w ith Reference Containing Fundamental Frequency ............. ..... ............................................ 2 7 4.5 .2 Simulat ion Res ults--Minimiza tion of PES w ith Reference Containing Fundamental Frequency and First Harmonic ............................................... 29 4.5.3 Summary of the Minimization of Pos ition Error Technique .......................... 3 1 4.6 Minimiza tion of the Deviation o f Sigma From Ide a l ........................................ 31 4 6.1 Simulatio n Res ult s Usi ng Fundamental ...................... .... .............................. 32 4.6.2 Summary of the Minimization of Si gma Deviation from Idea l ..................... 35 5 Plant Gain Variation s ......... .............. ..... ........................... ............................ ..... 36 5.1 Use of P osition Error Minimization Coefficients for Adapting DC Loop Gain ........................................................ ........................ ............. 39 6. Conclusion .... ..... . .......... ... . .... ... . . ..... . ....... . ....... . . ........ . ... ...... ... .......... ... 44 Appendi x A. MA TLAB Source Code for Section 2 ...................... ...... ................................. .45 B MA TLAB Source Code for Section 4 ......................... .................................... .48 C. MATLAB Source Code for Secti on 5 ............................. ..... ... ......................... 69 Bibliography ......... ....... . ......................... ..... ......... ......... .................... .... . ...... ..... 79 viii

PAGE 9

FIGURES Figure 2.1 Conceptual VSS Control of a Second Order Sy ste m ...... ....... ....... .... ..... ..... . . 2 2.2 Negative Feedback Ph ase Portrait ........ .... ...... ... . ......... ................... ... ......... 4 2 3 Positive Fee dback Ph ase Portr a it.. ........................ ......... ............. ............ . . ... 5 2.4 Combined Phase Portrait ..... ....... .......................................... ...... .... ... ........... 6 2.5 VSS Operatin g Region s .... ........ ..... ...... . ........................................................ 7 3 1 Second Order System ..... . ........................... ..... ....... ............. ...... ....... ............ 10 4.1 Sigma-Lambda(k+1 ) known ..... ....... ............ . .... ... .... ...... ... ........... ............... 17 4 2 R efe rence a nd Position -Lambda(k + 1 ) known ...................................... ........ 18 4 3 Po s ition Error-L ambda(k+l) known ............... .... ............ ........... ............. .... 18 4 4 Block Di ag r am of LMS Adaptation w ith Sliding Mode Control .. ........ .... ... ... 2 0 4 5 Structure of Run out Compensator ............... ... ................................. ........... ...... 20 4.6 Sigma u si n g Nonadaptive E sti mation of L ambda(k + 1) ................................... 23 4 7 Reference a nd Position using Nonadaptive Estimation of Lambda(k + 1 ) ......... 24 4.8 Po s ition Error u s ing Nonadaptive Estimation of L ambda(k+ 1) ..... .... ............. 24 4 9 Si g ma u s in g Nonadaptive Estimation of Lambda(k+ 1) .............. .................... 25 4 10 R efere n ce a nd P os iti on using ona d apt i ve Estimation ofLambd a(k+1) ....... 26 4 .11 P os ition Enor u s in g Nonadaptive Estimation ofLambda (k+1) ..................... 26 4 1 2 Sigma u s in g Minimization of PES ........... ..... .................... ........... ....... ......... 27 4 .13 R eference and Po s iti on u sing Minimization of P ES ....................... ............... 28 4 .14 Position Enor using Minimization of P ES ............ .............. .......... ...... ....... .. 28 4.15 Adapted Coefficients u sing Minimi za tion of P ES ......... ............................... 29 4.16 Sig m a u sing Minimiz a tion of P ES ...... ................... ...................................... 30 4.1 7Reference a nd Po s ition u sing Minimi zat i o n of PES ........................................ 30 I X

PAGE 10

4 18Position Error using Minimization of PES ..... ..... ..... . .............. ... ... . . . . .... . . 31 4 .19 Sigma using Minimization of Sigma Deviation from Ideal . ......... ... ... ... ... . 32 4.20 Reference and Position using Minimization of Sigma Deviation from Ideal .33 4 .21 Po s ition Error using Minimization of Sigma D ev iation from ldeal . .............. 33 4 22 Adapted Coefficients using Minimization of Sigma Deviation from Ideal ... 34 4 .23 Adaption Error using Minimization of Sigma Deviation from Ideal . . ... . ... 35 5.1 DC Gain--without Adaption ...... . ... . .... . .... . .... .... ......... ..... .... .... . ..... . ... ... . 36 5 .2 Effects of DC Gain Changes on Sigma--without Adaption ......... .... ....... .... . 37 5.3 Effects of DC Gain Changes on Position and Refwithout Adaption . . . .... . 38 5.4 Effects of DC Gain Changes on Pos ition Error-without Adaption ....... . ... ... 38 5 5 Effects of DC Gain Cha n ge o n Sigma--with Adaptio n ... . . ......... ...... . . . .... .40 5.6 Effects of DC Gain Changes on Position and Reference--with Adaption . .... .40 5.7 Effects of DC Gain Changes on Position Error w ith Adaption . .............. .... .41 5 8 DC Gain and Estimated DC Gain -w ith Adaption ... ........ ...... ....... ....... ..... ... .. .42 5 9 Product of DC Gain and Estimated DC Gain--with Adaption . .......... ... . . .... .42 5 10 Coefficient Error A2 with Adaption .... ............ . ... . .......... ........... .. ... ... ... .. .43 X

PAGE 11

TABLES Tab l e 2.1 VSS Op e r a tin g Region s . . ......... ......... ....... . ................ ...... ...... .............. ...... 8 3. 1 Linear Lead/Lag Compensator ....... ........................ .... .......................... .......... 1 3 3.2 Summary of Primary Feedback Simu lation Re sults ............ .... ...... ..... .... .... ...... 1 3 XI

PAGE 12

1. Introduc t i on Variable structure control is a non-linear control technique developed in the USSR during the 1950 's by Emelyanov and several of his coresearchers. Variable st ructure sys tems (VSS) differ from classic control systems in that their structure i s purpo sef ully changed during the transient process. In VSS the dynamic response is forced to track or "slide" along a predefined state space trajectory. This "s liding mode" provides the following advantages: Insensitivity to variations in the plant parameters. Exact plant parameter not needed to de s ign a stable VSS controller. Only bounds of the parameters need to be known. Insensitivity to external disturbances. Good dy n amic respo n se Simplicity of physical realization. Some of the current applications include: Process control. Motor control. (DC, induction, synchronous) Aircraft control. Spacecraft control. Robot control. In today 's literature VSC has been examined for a wide variety of syste m types including nonlinear sys tems, multi-input/multi-output sys tems discrete-time syste ms, large sca le and infinite-dimensional syste ms and stoc ha s tic syste ms. Adaptive variable st ructure control applied to a linear second order sys tem i s the topic of thi s thesis.

PAGE 13

2. Background This section provides the theoretical development necessary to illustrate th e advan tages of sliding mode control. In the interest of concept clarity, this background sec tion presents a continuou s time sliding mode control law It is only after the se underlying concepts of s liding mode contro l are pre se nted that digital s lidin g mode control is scrutinized 2.1 Control Theory The control law developed in the theory of VSS changes the structure of the sys tem whenever the representative point ( RP ) crosses certain surfaces in the pha se s pace of the system, which is determined by the plant. A second order system will be consid ered now reference po s ition Figure 2.1 Conceptual VSS Control of a Second Order Sy s tem The system ha s two s tructure s, one is the negative feedback mode and the other i s the po s itive feedback mode The state space eq u ation of the negative feedback mode i s 2

PAGE 14

given by equation 2.1. eqn 2 1 d x2 -= -kx dt I Where X1 is the po s ition error and X2 is the error ve locity Th e ge neral sol ution to the above differential equations is x1 = Asin(JKt + 0 ) x2 = JKA cos (JKt + 0 ) Combinin g the above two equations g ive s 2 2 XI X2 -+-= A2 KA2 eq 2 2 eq 2 3 The above equation can be plotted in pha se plan e (X 1 -X2 ) as a se t of ellipses with eccentricities A and ,JKA 3

PAGE 15

10 r-----.---,----,-----,-----,--,----,--------,---,----, 2 -4 B 10 '------'---'---'----'----'-----'---"------'-----'----' -10 8 -6 4 0 1 0 position erro r (X1) Figure 2.2 Negative Feedback Phase Portrait The state space equation of the positive feedback mode is given by dx1 dt dx2 -= kx dt I eq 2.4 Where X1 is the position error and X2 is the error velocity. The general solution to equation 2.4 is J/<1 -J/<1 x1 = B1e +B2e eq 2.5 x2 = JKB I eJ/<1JKB2e -J/<1 Combining equation 2.4 and equation 2.5 gives eq 2 6 4

PAGE 16

The phase portrait of equation 2.6 is a set of hyperbola s with two asymptotes. Figure 2 3 Positive Feedback Phase Portrait It is now possible to explain that by switching between the two above structures, the system response can be ideally constrained on the sliding line given by eq 2 .7 where eq 2 8 On this line, the hyperbolic and elliptic lines cross in opposite directions allowing the motion of the VSS takes on a special regime, called a s liding regime. In this regime the structure switc h es back and forth between positive and negative feedback, and the RP performs oscillations about the switching line cr, alternately following an elliptical path followed by a hyperbolic path. This s liding will occur until steady state is obtained at the origin. This sliding line i s illustrated in figure 2.4 5

PAGE 17

Figure 2.4 Combined Phase Portrait Since during the time th at the RP is moving along the swi tching line cr=O, we have the equality cxl + x2 = 0, the motion of the system is described by eq 2 .9 and the time domain response for movement along the sliding line is given by x1(t) = x1(t1)e -c(t-t1 ) eq2.10 where t1 is the time when operating point hits the sli ding line Up until the time t1 the motion of the VSS is described by the positive and negative feedback mode differen tial equations. Equation 2 .10 gives the mean re sponse of the system around the s lid ing line. It is extremely important to note the absence of Kin equation 2.10 This means the motion of the system is independent of changes in the plant parameters while the RP is in the s lidin g mode. Other observations on equation 2.10 are: The sys tem re spo n se can be made faster by increasing the line slope C. It demonstrates global stability when on the sliding line 6

PAGE 18

Analysis can be extended to higher order surfaces. To support the invariance in plant parameters suppose K is varied. The phase portrait in the neighborhood of the sigma line will change in slope but the hyperbolic and elliptic structures will still point in opposite directions. This allows the ystem to move once again in the sliding regime. Of course the transient response occurring before the sliding regime is entered will be different. Sliding mode controllers are also invariant to external disturbances. Suppose the system is exposed to an external disturbance f(t). As in the above case, the phase portrait in the neighborhood of the sigma line will de distorted, but the trajectories will st ill point in the opposite directions and the system will again move in a sliding regime. Again, if the external disturbance occur s before the sliding regime i s entered, the system will not be oblivious to this disturbance Next we need to develop switching rules to achieve sliding mode The phase plane can be divided into six operating regions. Region 6 Region 1 R e gion 5 -.. -. Region 2 4 Region 4 Region 3 6 -8 -10l__----L __._ _.._ _,__--' __,_ __._ _.__..____, -10 8 -6 4 2 0 10 p o s1hon error (X 1 ) Figure 2 5 VSS Operatin g Re g ion s 7

PAGE 19

Table 2.1 VSS Operating Regions Region cr crX1 crX2 1 + + + 2 + + -3 -+ 4 -+ + 5 -+ -6 + -+ The polarity of these parameters help identify when to switch between the modes. The system i s governed by the control law eq 2.11 where eq 2 12 for negative feedback mode and \f/1 = when crx1 <0 eq 2.13 for positive feedback mode. This is based on a second order system. For a n th order the phase space is n-dimen s ional and the sliding line i s replaced by a sliding hyper plane. 2.2 Mathematical Existence Conditions for a Sliding Regime For validity of s liding mode control, it i s absolutely necessary that the component st ructure trajectorie s cross the s liding line in opposite directions. Mathematically thi s 8

PAGE 20

crossover criteria can be defined by lim da < 0 for quadrant 2 -->quadrant 3 or quadrant 6 -->quadrant 5. And by 1 da 0 liD -d > "o t eq 2 14 eq 2.1 5 for quadrant 3 -->quadrant 2 or quadrant 5 -->quadrant 6. Combining these expres sions yields an equivalent inequality known as the existence equation. 1 da 0 1m a-d < 0 t eq 2.16 The existence equation (equation 2.16) helps to determine the controller parameters as well as guarantee the RP is moving on the sliding line. Equation 2.16 may also be written as. da2 lim a-d < 0 (J 0 t eq 2.17 By equation 2.16 the derivative is negative semidefinate in the neighborhood of the sliding line, in other words it is a nonincreasing function near a = 0. Consequently, if equation 2.16 is satisfied the system itself is therefore conditionally stable relative to the sliding line. Equation 2.16 is known as the existence equation for a sliding regime on the line a = 0 though it would be more accurate to call it a sufficient condition for the system to be conditionally stable with respect to the line a = 0. In short, the variable structure design problem is then to s elect the parameter s of each of the structures and to switch between these structure s in a way that the exi s tence equation is never violated 9

PAGE 21

3. Control of a Second Order System Primary Feedback Switching Now an application of the above theory will be examined both analyticall y a nd t hrough simulation. 3.1 Model Definition The theory of VSS will be realized through switching the primary feedback of a ec ond order sy s tem giv e n by -x2 -x 1 u Fi g ure 3.1 Second Order Sy s tem eqn 3 1 wher e k s eq 3 2 J 10

PAGE 22

-kv 1 -k k b I -1 eq 3.3 eq 3.4 where J is the motor inertia in kg rnls2 Kt is the motor torque constant in Nm/A, Kv i s the motor back EMF constant in Nm/A and Kpa i the power amplifier gain in VN. 3.2 VSS Definition The sliding line is defined as eq 3.5 a nd u is defined as eq 3 .6 where eq 3 .7 for negative feedback mode, and \f/1 = when crx1 <0 eq 3.8 for positive feedback mode 3.3 VSS Gain Selection The VSS gain \f' mu st be se lected to g uarantee the existence of a s lidin g regime. To guara ntee the exi tence of a s liding regime the following inequality must hold. eq 3 9 1 dcr 0 1m cr< cr o dt To ana lyze this, the derivative of cr along the trajectories of the ystem is evaluated eq 3 10 II

PAGE 23

Since on the s lidin g line cr = 0 the e quation of the line i s x2 = yields Therefore and l dcr Im-= odt l dcr 1m-= a Likewise for the o case and l dcr tm-= n0dt l dcr 1m-= n0dt eq 3 .11 -ex 1 Substitution eq 3.12 eq 3 13 eq 3.14 eq 3 15 eq 3 16 These four limit s may be overconstrained and \f become s bound by 1 2 a1>b(a2c-c -a1 ) I eq 3 17 eq 3 18 If the above two inequalitie s are violated so i s the existence equation and the ex i ste nc e of th e s lidin g regime is not guaranteed Thus, e quation 3.17 and e qu at ion 3.18 are n ecessary a nd s uffici e nt for the existence of a s liding regime o n cr = 0 1 2

PAGE 24

Substituting the actual values from the motor mod e l y ield s the following set of ine qualitie s eq 3.19 eq3.20 3.4 VSS Primary Feedback Switching Simulation Results A summary of the MATLAB s imulation are present e d in thi s sec tion The st rength s of VSS a re illustrated through a direct comparison of VSS a nd a linear lead/lag com pen sa tor during control of a sec ond order syste m plant. The linear lead/la g system i s detailed in table 3.1 Table 3.1 Linear Lead/Lag Compensator parameter value unit s open loop crossove r 1050 Hz gain margin 25 8 dB phase margin 48 .2 degre es compensator continuou s s + 6300 time transfer f unction s+700 The two control method were co mpared for ste p re ponse steady s t ate performance a nd parameter variatio n s The results are s umm arize d in table 3.2. Table 3.2 Summary of Primary Feedback Simulation Re s ults Simulation Metri c Linear vss Comments Steady State er r or s td 5.9e-7 1.7e-7 VSS 35 0 % l ower ( m ) e rr or mean -2.5e-9 -3. le-9 VSS 120 % l owe r ( m ) 1 3

PAGE 25

Table 3.2 Summary of Primary Feedback Simulation Results Gain Variation error std l.Se-3 1.7e-4 VSS lower (m) error mean -l.le-5 -9.2e-7 VSS lower (m) Step Respon se 1 % settle time 317 288 vss 29 amples (samples) faster It can be seen from the above table that VSS achieves a higher level of performance that the simple lead/lag compensator it was compared against. 14

PAGE 26

4. Compensator Reformulation The introduction in section 2 was presented in continuou -time for the purpose of clar ification and simplicity in understanding the underlying principle s of s lidin g mode control. Thi s sectio n will describe a de sig n methodology for discrete time slidi n g mode control. It is important to note that theoretically discrete time s liding mode con trol systems can not be obtained from their continuous counterparts by mean s of si m ple equivalence. The discrete time control law u s ed here was created by Gao and is named th e reaching law approach. In this approach the followin g three attributes are always satisfied: Starting from any initial state, the trajectory will move monotonically toward the switching plane and cross in finite time. Once the trajectory has crossed the switching plane the first time it will cro ss the plane again in every s uccessive sa mpling period, resultin g in a zig zag motion about the sw itchin g plane. The size of each s uccessive zigzagging step is nonincrea s ing a nd the trajec tory stays within a specif ied band. It is the properties of the third attribute that are used for the adaptive principle s pre sented in both this section and the following section. 4.1 Discretization and Servo Problem Reformulation Consider a discrete time system Xk+ I = X k + [uk eqn 4 1 where X i s the s tate vector, u is the input vec tor is the state matrix a nd r i s the input matrix. B y e mplo ying the reaching law approach, Gao composed the followi n g 1 5

PAGE 27

control law eq 4.2 where eq 4 3 To utilize the reaching law control law in the context of a s ervo system th e error mu s t be defined as where Rk is the reference. Substituting equation 4 3 into equation 4.2 yield s c k + 1 = 'Ack-L1signcr k Solving for uk yields the control law for the servo problem eq 4.4 eq 4 5 eq 4.6 -I I I 1 eq 4 7 u k = c(
PAGE 28

cussed in the lit erature, th e reference term A k + 1 i s se t to ze ro for all states. But for optical s torage d ev ic es A k + 1 = 0 i s not a valid assumption a nd it i s to the so lution of equation 4.9 that a daptive method s are applied. For reference going forward, simulation results are pre ented h e re where the refer ence term A k + 1 is comp letely known. Although this is not physically realiz a ble it will serve as a basis for co mpari so n in s ub se qu e nt sect i ons. These s imul atio n r es ult s are for a seco nd order sys tem Fir s t cr i s pre se nted signa -6 -8 1000 2000 3000 4 000 5000 6000 7000 8000 9000 samples Fi g ure 4 1 Sigma--Lambda(k+ 1 ) known Next the r efe rence position and the actua l position are presented ( note they are indis-17

PAGE 29

tinguishabl e in the foll o wing plot ) Reference and pos ition 00 I\ I\ I '\ 1\ 1\ I : I II \'I \! \ 80 ., 00 o :-----:>: Fi g ure 4.2 Re f erence and Po sition-L a mbda ( k+ 1 ) known And finally the e rror (error= reference-po s ition). 0 .08 0 06 0 .04 0 .02 3 0 0 .02 04 -0. 06 -0.08 Fig ure 4.3 Po s ition Err o r -Lambda(k+ 1 ) kn ow n 1 8

PAGE 30

4.2 Adaptive Determination of Lambda(k+ 1) Ak + 1 may be thought of as a feed forward term into the control effort. If the reference Rk is completely known ( including all future values of R k ), Ak + 1 is s imply calculated u s ing equation 4.9. (The simulation results for this case were presented in section 4.1) Unfortunately for optical disk drives such as CDROM and DVD, the ref erence is unknown. But, fortunately, the reference is dominated by either a single fre quency or a single frequency plus harmonics. Therefore the control loop must follow this reference commonly referred to in practice as runout. In this application, runout i s sinusoidal and takes the form a sin( rot+ 8). Using a trigonometric identity the runout can be represented as a sin( rot+ 8) = A0sin( rot)+ A 1 cos(rot) where A0 and A1 are the parameters to be adapted and are ideally A0 = acos(8) and A1 = asin(8) eq 4.12 eq 4.13 eq 4 14 Hence, the purpose of the adaptive runout compensator is to find A0 and A1 s uch that the feedforward command A0sin( rot)+ A 1 cos( rot) nullifies the effects of the runout a sin (rot+ 8) In general the reference is modeled as 111 eq 4 15 n=l where the coefficients An and Bn are unknown. The following figure illu st r ates the sy tern under discussion 1 9

PAGE 31

Spindle Motor .. Speed 1 w dsin((nwk\11 ; LMS A Transducer cos nwk Estima\;; .. 1--t ... Estimated A k + 1 + Sliding I ref error .. Mode Plant .. I -Compensator jll Figure 4.4 Block Di agram of LMS Adaptation with Slidin g Mode Control The structure of the LMS Adaptive filter is shown in the figure below X0 = si n (nwk) e(l,k) A0(k+1) = A0(k) + 2 mu*X0*A0 A1(k+1) = A1(k) + 2*mu*X1* A1 A0(k) Figure 4 5 Structure of Runout Compensator The goal is to minimize the energy in the erro r s ignal e, at the runout frequency. 20 ...

PAGE 32

However, if e1 is minimized e is also minimized. e1 is minimized by using the fol lowing error cost function The expression for e1 is where Kr is the compensator gain. Squaring yields, 2 22 22 22 el = K re +x0a0+x1a1 +2x0a0x1a1-2K r(x0a0+ x1a1 ) The steepest descent may be calculated as de12 = 2x0(x0a0+x1a1-Kre) = -2x0e1 oa0 de12 = 2x1(x0a0+x1a1-Kre) = -2x1e1 da1 Ultimately, the means of adapting the gai n s becomes 4.2.1 Generation of X0 and X1 eq 4 16 eq 4.17 eq 4.18 eq 4 19 eq 4 .20 A crucial element in the s uccess of the adaptive runout compensator is the generation of X0 and X1 The difficulty of accurately creating X0 a nd X1 is increased in an opti cal drive that uses CLV (Cons tant Linear Velocity refer s to a constant linear scannin g velocity and thus a constant data rate ) mode b y the fact that the s pindle rotational rat e (a nd thus th e runout frequencies) i s constantly ch a n ging. For thi s algorithm to b e s uccessful w must be close l y related to the present s pindle speed at a ll times. Thi s is achieved in practic e by u s ing a h ardware count e r s pecifically des i g ned for this purpo se. Thi s s pecial counter rem ains l oc ked to the s pindl e r a t e, thu s acc urat ely 2 1

PAGE 33

pa ss ing information on w to the algorithm The algorithm then u ses either a look-up table or a function approximating equation to generate x0 = sin ( wk) and x1 = cos(wk). This h ardware counter will also accommodate harmonic content in the reference frequency. In other words, thi s counter does not limit the algorithm to compensating for the fundamental runout frequency only. A s in the fundamental case, the counter can pass inform atio n on w to either a look-up table or a function app roximatin g e quation to ge nerate x0 = sin((n+ l )wk) andx1 = s in((n+ l)wk),wherenisthede ir e d n n harmonic number. 4.3 Techniques for the Estimation of Lambda(k+ 1) Since w i s known the determination of A k + 1 (e quation 4.9) may be found by determining the coefficients that accomplish one of the following Nonadaptive Estimation LMS Adaptive Minimization of Position Error LMS Adaptive Minimization of the Dev i a tion of cr f r o m Ideal The se three po ss ibilitie s are exp lored in the following three se ctions. 4.4 Nonadaptive Estimation of Lambda(k+l) For a comparison of a dapti ve a nd nona daptive t ec hniqu es fore timating Ak + 1 the following non-adaptiv e estimate of A k + 1 is u se d Th e d eve lopm e nt of thi s nona d a ptive method i s done b y noting that equation 4.9 may be rewritten as Ak+ 1 = ukc
PAGE 34

For this example A k + 1 may is estimated by 4.4.1 Simulation Result s --N onadaptive Estimation of Lambda(k+l) with reference containing fundamental frequency The s imulation results are pre sented in this sec tion sigma 4 6 6 0 1000 2000 3000 4 000 5000 6 000 7000 8 000 9000 samples Figure 4.6 Sigm a u s ing Nonadaptive E s timation of Lambda( k+ 1) eq 4.23 Note the modulation on a due to the estimation error. Next the reference a nd act u a l 23

PAGE 35

position are presented. Reference and position 1 00 4 I (\ f\ (\ I I \ \ I I I I \ I I \ I \ I \ 0 I I /' I 0 I I I I 0 \ v ) \. I.J v I.J 80 60 4 0 20 8 100 0 1000 2000 3000 4 000 5000 6000 7000 8000 9000 Figure 4.7 Reference and Position using Nonadaptive Estimation of Lambda (k + 1) And finally the position error is presented. Due to the estimation error, the position error is larger than the ideal case as shown in figure 4 .3. Position Error 0 1 0 08 0 06 0 0 4 0 02 5 0 -o 02 \: .04 .. : 06 08 1 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 Figure 4.8 Positio n Error u sing Nonadaptive E s timation of L a mbda ( k+ I ) 24

PAGE 36

4.4.2 Simulation Results --Nonadaptive Estimation of Lambda(k+ 1) with reference containing fundamental frequency and first harmonic The simulation results are pre sented in this section for a reference containing both the fundam enta l frequency and the first harmonic See figure 4 1 0. sigma 4 Figure 4.9 Sigma using Nonadaptive Estimation of Lambda(k+ 1 ) Note the modulation on cr due to the estimation error. Next the reference and actual 2 5

PAGE 37

position are presented. Reference and position 1 00 A 1\ ,, A I' {I n /' \ I \ /1 I. I V1 Vi IV1 I v I \ I I \ I I I eo 40 20 4 0 I BO 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 Figure 4.10 Reference and Position using Nonadaptive Estimation of Larnbda(k+ 1) And finally the position error is presented. 0 06 0 06 0 04 f 1 0 02 5 0 l ,". !. /! 1 I I I j I 02 111,1 \ I 1 ; 1 0 4 0 06 08 I 'I ; I ' I: i 1 t I \ r l \I i \. i I, 'I 'I ,. 1 '------'---'--__.J_ __.._ ___._ _._ __.__:-:'c-:-_...,.,_,__, 0 1000 2000 3000 4 000 5000 6000 7000 8000 9000 Figure 4.11 Position Error using Nonadaptive E s timation of Lambda ( k+ l) 26

PAGE 38

4.5 LMS Adaptive Minimization of Position Error Now the minimization of po s ition error will be disc u ssed. As illu s trated by the fo l lowin g simulation position erro r minimization with s lidin g mode control s how s sys tem performance benefits. B y implementing this method the contro l law now becomes eq 4 2 4 where eq 4.25 B y eliminating the n ecessity of directly calculating Ak + 1 we h ave reduced the com putational burden of th e proc essor sig nificantly 4.5.1 Simulation Results --Minimization of PES with reference containing fundamental frequency The si mulation re s ult s are pre se nted in this section. Note the modulation of cr due to the feedforward term estimation error e k = A k + 1 -A k + 1 sigma 1000 2000 3000 4 000 5 000 6000 7000 8000 9000 samples Figure 4 1 2 Sigma using Minimization of PES 27

PAGE 39

And again the reference and position are presented. 100 80 1\ 1\ I\ (\ (\ 1\ f\ I\ I \ I I I I \ I I I \ I 60 20 20 4 0 8 0 100 .II \1 _l _l J1 jJ_ 0 1000 2000 3000 4 000 5000 6000 7000 8000 9000 Figure 4.13 Reference and Position using Minimization of PES The important point to notice is that although the modulation on cr is still present (fig ure 4.12 ) the energy at the reference frequency ha been eliminated as witnessed in the position error plot. .0.06 .0 08 , I i I Position Error 0 1 000 2000 3000 4 000 5000 6000 7000 8000 9000 Figure 4.14 Po s ition Error u ing Minimization of PES 28

PAGE 40

Next, the coefficients are examined 1 20il 'I(' \j \ \ 110 \ l \,\ \ 100 l \ eo l Figure 4.15 Adapted Coefficients using Minimization of PES 4.5.2 Simulation Results --Minimization of PES with reference containing fundamental frequency and first harmonic In this example, the reference contains not only the fundamental but also the first harmonic. The adaptation algorithm requires two coefficients adapt for each fre quency component of the reference for which attenuation is desired. In this case since the reference consists of two frequency components, a total of four parameters 29

PAGE 41

are adapted. The simulation results are presented in thi s s ection. v 6 -8 1000 2000 3000 4 000 5000 6000 7000 8000 9000 samples Figure 4.16 Sigma using Minimization of PES And again the reference and position are presented. Aelerence and position 4 0 20 20 4 0 -60 I I \ I I I I I \ i I I \ I I -80 1 00 0 1000 Figure 4 .17 Reference and Position u s ing Minimization of PES A g ain the important point to notice i s that although the modul a tion on cr i s still pre s ent (fig ure 4.16 ) the energy at the referenc e frequenc y ha s be e n eliminated as 30

PAGE 42

witnessed in the position error plot. Position Erro r .0 04 -o.oo -o.oe -o. 1 CLI..._._._...._--L _L.._--'----'---"-----"'------'----L-----' 0 1000 2000 3000 4 000 5000 6 000 7000 8000 9000 Figure 4.18 Position Error using Minimization of PES 4.5.3 Summary of the Minimization of Position Error Technique In addition to the tandard advantages apparent in the above simulation re s ults there are two additional advantages specifica lly related to minimizing position error with sliding mode compensation elimination of feedforward term Ak + 1 reduction of c By reducing the value of c the overall robustness of the system is improved (note: ro bustness i s directly related to the value of c.) 4.6 Minimization of the Deviation of Sigma From Ideal Next, the second adaptive approach i presented. A powerful application of the LMS adaptive algorithm is de sc ribed here In the ideal case the modulation of icrl i s bound by This information is exploited to develop the following error signa l s for u se 1+11.. during adaption 3 1

PAGE 43

For cr > 0 and for cr < 0 L'l e=cr-l+A L'l e=cr+l+A. eq 4 26 eq4. 27 By minimizing this error function the algorithm i s essentially estimating A k + 1 and consequently has the beneficial effect of minimizing the amount of modulation in cr. Although this method doe s induce a modulation in position error the modulation can be bounded by the selection of c. 4.6.1 Simulation Results Using Fundamental This example illustrates the minimization of the de v iation of cr fro m ideal. The control effort used is described in section 1.3.1 where A k + 1 i s eliminated. Notice the modulation of cr is nearly eliminated while the po s ition error modulation h as returned. -6 8 sample s Figure 4.19 Si g ma u sing Minimization of Sigma Deviatio n fro m Id ea l 32

PAGE 44

Reference and position 100 8 0 1 \ 1 \ (\ 1\ {\ \ f \ I I I I 1 I I \ \ I \ I I I I I I I I I I J \ \} \, \i, \ 1 60 4 0 20 -20 4 0 -80 -100 0 1000 2000 3000 4 000 5000 6000 7000 8 000 9000 Figure 4.20 Reference and Position using Minimization of Sigma Deviation from Ideal Position Error Figure 4 .2 1 Po ition Error u si n g Minimiz at ion of Si gma D eviation from Ide a l 33

PAGE 45

And the coefficients are presented. Coefficients 180 0 1 000 3000 4 000 5000 6000 7000 8000 9000 10000 Figure 4.22 Adapted Coefficients using Minimization of Sigma Deviation from Ideal In this technique ffwdk converges to Ak + 1 This graph illustrates this point by plot ting ffwd-Ak + I 34

PAGE 46

After t h e coeffic i e nt s h ave a d ap t e d ( a b o u t 3 000 samples) the error s ett l es to l ess t h a n 1 % 50 4 0 30 20 I 10 1 0 30 40 \ / I caplam ffwd estimation erro r Fig ur e 4 23 Adaption Erro r u si n g Mi n imiza t ion of Sigma D eviatio n from Idea l 4.6.2 Summary of the Minimization of Sigma Deviation from Idea l Adva n tages of mi n imizi n g the a m ount of mod u lation in cr are s impl i f i es the adaptation s trategy for plant gain variation s ( de cribed in next s ection ) more accurate know l edge of system performa n ce n o l o n ge r n ecessa r y t o dir e ctl y cal c ul ate A k + 1 35

PAGE 47

5. Plant Gain Variations Open loop crossover i s a n important metric in control sys tem de s ign a nd any DC gain variatio n adversely effects thi s crossover. Followin g initia l calibrat i on of the cross over any sub equent changes in gain ( e .g. due to tempera ture drift ) will degrade the dynamic re s ponse of the loop In order to correct for this de gradatio n a n adaptive DC gain a l gor ithm is proposed The following examp l e demonstrate s the degrad a tion of loop dynamic s due to DC gain changes of+ 10% an d -10 % of nominal This gai n change is illustrated graphically i n figure 5.1. gain and code gain (nominal = 1 ( 1.25,---...,----.---.----,,--.,-----.---.,----, 1 2 1.15 1 1 1.05 0 95 0 9 0 .85 0 8 0 75 0 1000 2000 3000 4 000 5000 6000 7000 8 000 Figure 5.1 DC Gain--without Adaption 36

PAGE 48

sigma saflll{es Figure 5.2 Effects of DC Gain Changes on Sigma--without Adaption 37

PAGE 49

Reference and position 100 ,--,--,---,(( \,---,-\\ \\--r--;-r---r---,---, eo / \ \ ('\ !' : 1 I \ I I I I' \1 I \\ I J I \ I I : I II I \\ I I I \ I j ,, \1 \/ \/ \ -80 Figure 5.3 Effects of DC Gain Change on P osition and Ref-without Adaption Position Error 0 1 I 0 08 i 0 06 I 0 0 4 I 0 02 5 0 : -o 02 -004 06 -o .oe -0 1 0 1 000 2000 3000 4000 5000 6000 7000 8000 Figure 5.4 Effects of DC Gain Changes on Po iti on Error -witho ut Adaption 38

PAGE 50

5.1 Use of Position Error Minimization Coefficients for Adapting DC Loop Gain This method takes adva nta ge of the gain information contained in the coefficients Ao and A1 (see section 4.5) once they have converged. By exploiting the lin ear relation ship between loop DC gain and the coefficients, an error signal is formulated a nd the DC gain variation i s compensated for in the following manner and the lo op gai n adjusted as kcode(k + l) = kcode(k)( 1 + KpDc(k)) where Kp is the adaption gain. In the id eal case kcode(k + 1 )kplant = where kplant i s the actual plant gain. eq n 5.1 eq 5 2 eq 5.3 The gai n informatio n is extracted from the runout algorit hm wit hout effecting the per formance of the runout compensator as described in sec tion 4.5. The same example used in section 4 will be used to illustrate the u se of the LMS adapted coefficients as a means of adapting DC loop gain For thi s example the refer ence freq u ency was held constant (69Hz) and the plant gain was changed + 10 % and 39

PAGE 51

-10 % Anomina l was recorded at sample 2000. sigma 1000 2000 3000 4 000 5000 6000 7000 8000 samples Figure 5.5 Effect s of DC Gain Change on Sigma-with Adaption Notice the way sigma returns to the nominal value quickly after the gain change fig ure 5.5 show much improvement when compared to the nona daptive case s imu lated in figure 5.2. Ref e r ence and pos ition 60 4 0 20 4 0 60 I \ I \ I I I I \ I I I Figure 5 6 Effect s of DC Gain Chan ges on Po s ition and Refer e nce--with Ad a pti o n 4 0

PAGE 52

Position Eno r 0 1 008 0 06 I I 0 04 0 02 ---____________ _j_ --------.0. 02 I -0. 04 ; .0 06 -o.oe -o. 1oL.._ '::10oo::--2000-=:--3000-=:----::.ooo':':---::sooo:-::---::6000=---=7ooo=---=8ooo Figure 5.7 Effects of DC Gain Changes on Po sitio n Error--with Adaption It's also important to note that not only is the DC gain normalized to 1 the position error has no reference energy present ( figure 5.7 ) --thus proving the runout compen sator is operating properly even during the DC gain adaption. 1 25 gain and cod e ga i n ( nominal = 1 ( 1.2 1.15 1.1 v I \ 1.05 I \ I .. i 0 95 I \ 0 9 0 85 0 8 0 75 0 1000 2000 3000 4 000 5000 6000 7000 8000 samples 4 1

PAGE 53

Figure 5.8 DC G ain and E timated DC Gain -with Adaption Also figure 5.8 illu st rate s the fact that the overall l oo p gain returns to the nominal value of 1 after adaptation thus the DC gain adapted accordi n g l y plant gain c-gain (nominal 1( 1.25,.-----.-----,---,---.----,---,---.-------, 1.2 1 .15 1 1 1.05 I ;/ I I i II L/ 0 95 0 9 0 6 5 0 6 0 75 L__..,.,..,.. __._,----'---...J.._---'-,------,--J'---,::-:':-:---_j 0 1 000 2000 3000 4 000 5000 6000 7000 6000 samples Figure 5 9 Product of DC Gain a nd Estimated DC Gain -with Adaption Th e nominal val ue i one. ( see equation 5 3 ) 42

PAGE 54

8 Coefficient Error A2 0 0 4 0 .03 h 0 .02 0 .01 l -D.01 -D.02 -D.03 as Figure 5.10 Coefficient Error A2 --with Adaption In figure 5.10 it can be seen that the steady state value of A2 i s nominal ( nominal recorded at sample 2000) after each gain change (gain changes occur at sample 3000 and ample 5000). In conclusion, this method has been shown to correct for the degradation of perfor mance due to DC gain variation. Con s equently the effective open loop ero s over i s held constant. 43

PAGE 55

6. Conclusion The control Jaw for the digital se rvo probl e m u s ing s lidin g mode control i s a linear combination of the error states, a sw itchin g term based upon th e liding lin e a nd a feedforward term A k + 1 It i s thi s feedforward term that existing approaches to s liding mode control have not considered in the context presented here Specificall y w h e n the sys tem reference is unknown (as is the case for CD ROM and DVD drive s) the calc u lation of A k + 1 becomes nontrivial. It i s for thi s purpose two adaptive technique s were presented to approximate A k + 1 In one technique the po s ition erro r was minimized and in the other technique lcr1 was minimized u s ing LMS adaptive tec hniques. As an added benefit, the adapted coefficients from the position error minimization technique were exploited to adapt the syste m loop gain. It was s hown thi s exp loitation provides added stability and improved control over sys tem dynamics In conclusion, the adaptive technique s described in this p a p er allow the advantages of s liding mode control to be realized for the s econd order digital servo probl e m described. 44

PAGE 56

Appendix A: MATLAB Source Code for Section 2 % plot ci rcles % 11.25.98 % ct elf rad=[1 2 3 4 5]; k=3; % define the eccentricity for i= 1 :length(rad) radius = rad(i) ; x = -radius:0.05:radius ;% create semi circle y = sqrt(k (radius"2-(x ."2))); x=[x -x]; % create full circle y=[y -y ] ; plot(x y r') hold on end grid axis([-10 10-10 10]) grap h abel prin t dtiff pos_feed % plot hyperbol as % 11.27.98 % cts %elf x =-50: 1 :50 ; y = -50:.1 :50; bl=l; b2=1 ; k=l; 45

PAGE 57

for bl=l :5 x= sqrt((l + ( y ."2)/4* k b 1 b2) 4 b 1 b2) ; plot ( x y ) hold on plot ( -x y ) plot ( y ,x ) plot ( y x) end grid on axi s ([-10 10-10 10]) graph label print dtiff neg_feed %standard ph as e portra it gr a ph label s xlabel('position error (XI)') ylabel('velocit y error ( x2)') o/otitle ('pha e portrait') % plot VSS operating region % 11.25 98 % cts elf X=-9:9; y=9 : 9; plot( x zeros( 1 length ( x ))) hold on plot ( zero s( 1 l e n g th ( y )),y) Y=. 3 x ; plot( x Y ,' g'); g r a ph abel axi s ([ -10 10 -I 0 10]) t e xt ( 5 5 ,'Reg i o n I') t ex t ( 6,-l ,' Regi o n 2') 46

PAGE 58

text(5,-5 ,' R eg ion 3') text(-5,-5,' R egion 4') text (-8, 1 ,' R egion 5') text( -5,5,' Region 6') print -dt iff regions 47

PAGE 59

Appendix B: MATLAB Source Code for Section 4 % LMS runout compensator with sliding mode % cts % 3/31/98 % % Chris Settje % 4/23/98 % adde d system ID feature % % for thesis % plots : smc without any runout comp or adaptive applications % used for base line or comparison % can use ideal caplam or estimated caplarn by commenting one line below % clear all % Norrtinal Values: % Kf=.204 ;%Nt/A m=.766e-3; % Kg c 1= 0299; % Nt/(rn/sec) kl=58.5;%Nt/m Kdac=l.S/1024;% V/cnt Kpa=0.46; % A/V Kadc=256/2; % cnts/trk Ks=2.0/.74e-6; % V/m T=l2e-6;%sec fbiasp=O; % bias term in percent of max % s imul atio n parameters ref_freq=69; % reference frequency in Hz ref_amplit ud e=lOO; % max ref amplitude in bits % cycles=8; cycles=8; N=(ll(ref_freq* T)) cycle s;% number of r efere nc e periods per s im % =100; 48

PAGE 60

% % Scaling Matrix: l=eye(2); % Q=[Ks Kadc 0;0 Ks T Kadc]; % % Nominal System Mode l (Co ntinuou Domain, control input): % A=[O 1 ;-kllm -cllm]; B=[O;(Kf/m) Kdac Kp a]; % %Tra nslate to Digital Domain: % [Phi1,Gamma1]=c2d(A B,T); % % Scale the Phi Gamma Matrices: % phi=Q*Phi 1 inv(Q); gamma=Q*Gamma 1 ; % % output?? %if plotflag == 1 % dbode(phi,gamma,[1 1], 0 T); %s ubplot(2, 1, I) o/otitle('Open loop Bode') % pause %end % co ntroller de ign c=[ 13 1]; delta=2.04; lambda=0.7;% ??? psi=(c*(phi-lambda I ))/(c*gamma); mu=delta/(c *ga mma); L=(c* phi)/ (c*ga mma) ;% e timate of derivative ref term cginv=ll(c*gamma); % initialize s im u ( I :2) =[0 0] ; 49

PAGE 61

fbiasmax= (2* delta/(1 +lambda)-delta ) / ( c *gamma); fbias=fbiasmax fbi asp; x=O.l one s(2,2); x 1 =zeros(2 ,2); % define reference k=[l:N+l]; ref ( 1 k)=ref_amplitude sin(2*p i k ref_freq T );% po s ition ref ref (2, 1 :length(ref))=zeros ( 1 l e ngth ( r ef)); s 1=sin(2 pi k ref_freq T + pi/4) ; s2=cos(2 *pi* k ref_freq T + pi/3) ; Mu=.5; k plant=1 ; c=[13 1] AI = 72* ones(l,length(ref)+1); A2 = 73 *ones(l length ( ref)+ 1 ); ffwd = zero s (I len gth ( ref)+ 1 ); se n sor= O r andn(l length (ref) + 1 );% Sensor noi se kcode=l; k _plant=l; caplam=[O 0]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % exec ute for k=2:N-l err(:,k)=ref(:, k ) -x ( : k ) +sensor( 1 ,k) ; % Calculate control effo rt sigma(k)=c *e rr(: k ) ; % ideal cap l a m --note r ( k+ 1 ) term does not exi tin practic e caplam(k ) = c *( ref (:, k+ I ) ( phi ref ( : k ))) / ( c *gamma); % actual caplam % caplam(k) =capl a m ( k 1 ); u ( k )=ps i *e rr ( : ,k ) +caplam ( k ) +mu i g n (s i g m a( k )); x(:,k + I ) =(phi x(: k)) + (gamma*( u ( k ) + fbias)); 50

PAGE 62

caplam ( k ) = c *(ref( : ,k+l)-(phi*ref(:, k ))) /(c *gamma) ; end s mc_plots figure( 1) print -dtiff no ro_ideal _sigma figure ( 2) print -dtiff no ro_ideal refpos figure ( 3 ) print -dtiff no ro_ideal error % LMS runout compen s ator with sliding mode % cts % 3/31/98 % % Chris Settje % 4/23/98 % added sy tern ID feature % % for thesi % plots : smc without any runout comp or adaptive application s % used for base I ine or comparison % can use ideal caplam or estimated caplam by commenting one line below % clear all % Nominal Values: % Kf=.204 ;% Nt/A m=.766e-3 ;% Kg c 1 =.0299 ;%Nt/( rn/ s ec ) k1=58 .5 ;% Nt/m Kdac= 1.5/1 024; % V lent Kpa=0.46 ;% NV K a dc=256/2 ;% cnt s /trk K s =2 0/.74e 6 ;% V/m 5 1

PAGE 63

T= 12e-6; % ec fbiasp=O; % bias term in percent of max % s imulation parameters ref_freq=69; % reference frequency in Hz ref_amplitude=lOO ;% max ref amplitude in bit s % cycles=8; cycles=8; N=( 1/ ( ref_freq *T))*cycles;% number of reference periods per sim %N=100; % %Scaling Matrix: l=eye(2); % Q=[Ks* Kadc 0 ; 0 K T Kadc]; % % Nominal System Model (Continuous Domain, control input): % A=[O 1;-kl/m -cl/m]; B=[O ; (Kf/m) *Kdac* Kpa]; % % Translate to Digital Domain: % [Phi 1 ,Gammal]=c2d(A, B T); % %Scale the Phi, Gamma Matrices: % phi=Q*Phil inv(Q ); gamma=Q*Gammal; % % output?? % if plotflag == 1 % dbode(phi ,gamma, [ I 1 ],O, T ); %s ubplot (2, 1,1) %title('Open loop Bode') %pause %end %controller design 5 2

PAGE 64

c=[l3 1]; delta=2.04; l ambda =0 .7;% ??? p i=(c*(phil ambda*I))/(c gamma); mu=delta/ (c*gamma); L=(c* phi)/(c *ga mma) ;% estimate of derivative ref term cginv= 1/(c gamma); % initialize im u( 1 :2) =[0 0]; fbiasmax=(2 delta/( I +lambda) -delta)/ (c*ga mma); fbia =fbia smax fbiasp ; x=O. l ones(2,2) ; x 1 =zeros(2,2); % define reference k=[l:N+l]; ref(l ,k) =r ef_amplitude sin(2*pi*k*ref_freq T );% po s ition ref ref (2, 1 : len gth(ref))=zeros( 1 length(ref) ); 1=sin(2 pi k ref_freq T + pi/4 ); s2 =cos(2 pi k*ref_freq T + pi/3); Mu=.5; k_pla nt=1 ; c=[ 13 1] A 1 = 72 ones( 1 ,length(ref)+ 1 ); A2 = 73 one ( 1 len gth(ref)+ 1 ); ffwd =zeros (I ,length( ref)+ 1 ); se n or= O randn(l length ( ref)+ 1 ); % Sensor noi se kcode=1; k_plant=l; cap l am=[O 0] ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % execute for k=2:N-1 err(:,k) =r ef(:,k)-x(: k ) +sensor( 1 ,k); % Calculate control effort 53

PAGE 65

sigma(k)=c err(: k); % ideal caplam --note r(k+ 1) term does not exist in practice % caplam(k) = c *( ref(:,k+ 1 )-(p hi *ref(:,k))) / (c*gamrna); % actual caplam caplam(k)=caplam(k-1 ); u(k)=p i *e rr(: ,k) + caplam(k) +mu *s ign(sigma(k)) ; x(:,k+ l)=(phi*x(: k)) + (gamrna*( u (k) + fbia )); caplam(k) = c*(ref( : ,k+ 1 )-(phi *ref(:,k))) /(c *gamma); end mc_plots figure(!) print -dtiff no ro_sigma figure(2) print -dtiff no_ro_refpo figure(3) print -dtiff no ro_error % LMS runout compensator with sliding mode % cts % 3/31 /98 % % Chris Settje % 4/23/98 % ad ded sy tern ID fe a ture % for thesis % plots : s mc with runout comp but without adaptive applications % two frequencies in reference % clear all 54

PAGE 66

% Nominal Values : % Kf=.204 ; % Nt/A m= 766e 3 ;% Kg c 1=. 0299; % Nt/ ( m/ sec ) kl=58.5;% Nt/m Kdac= 1.511 024 ;% V lent Kpa=0.46; % AIV Kadc=256/2; % cnts/trk Ks=2.0/.74e-6;%V/m T=l2e-6;% sec fbiasp=O; % bias term in percent of max % simulation parameters ref_freq=69; % reference frequency in Hz ref_amplitude= 1 00; % max ref amplitude in bit cycles=8; N=(l/(ref_freq T)) cycles;% number of reference periods per sim % N=100; % % Scaling Matrix: I=eye(2 ) ; % Q=[Ks Kadc 0 ; 0 Ks*T Kadc] ; % % Nominal Sy s tem Model ( Continuou Domain control input): % A=[O 1 ;-kl/m -cl/m]; B=[O ; (Kf/m)*Kdac Kpa]; % % Translate to Digital Domain: % [Phi I Gamm a 1 ]=c2d ( A B T ); % % Scale the Phi Gamma Matrices: % phi=Q*Phi I inv(Q); gamma=Q Gamma I ; % 55

PAGE 67

% controller design c=[ 13 1]; delta=2.04 ; Jambda=0.7; % ??? p i=(c *( phi lambda l ))/(c*gamma); mu=delta/ (c*gamma); L=(c phi)/(c *gamma);% estimate of derivative ref term cginv= 1/(c*gamma); % initialize sim u(l :2)=[0 0] ; fbiasmax= (2* delta/(l +lambda)-delt a)/ (c*gamma); fbias=fbiasmax fbi asp ; x=O.l *o nes (2,2); x l=zeros (2,2); % define reference k=[l:N+l]; refl(l, k)=ref_amplitude *sin(2* pi *k*ref_f req T );% po ition ref ref2(1 k)=ref_amp1itude/2 *sin(2 2 *pi k ref_freq T + pi/3); % position ref ref=refl +ref2 ; ref(2, 1 :Jength(ref))=zeros(l ,length(ref)); s l=sin(2 pi k ref_freq T + pi/4 ); s2=c os(2 pi k ref_freq T + pi/3); s 12=sin(2 *2* pi k *ref_f req T + pi/4 ); s22=cos(2*2*pi*k*ref_freq*T + pi/3); Mu=.5; k_plant=l; c=[ 13 I] A I = 72 *ones(l ,length(ref)+ I); A2 = 73 *ones(l ,Jengt h ( ref)+ I); Al2 = 72* ones(l,Jength ( ref)+l ); A22 = 73 *o nes( I ,length( ref)+ I ); ffwd = zero ( I len gth( ref)+ I); se n sor= O randn( I len gth( ref)+ I );% Sensor noi se 56

PAGE 68

kcode=l; k_plant=l; caplam=[O 0]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %execute for k=2 :N-l err (:, k )=ref(:, k )-x(:, k ) + e n so r ( I k); % Update the adaptive gain coefficients. Al(k+l) = Al( k ) + ( 2 Mu *err(l, k) *s l ( k )); A2 ( k+ 1) = A2 ( k ) + (2*Mu*err(l k )*s2( k )); % Update the adapt ive gain coefficient for first harmonic Al2(k+l) = Al2( k ) + (2*Mu*err(l,k)*sl2( k )); A22( k+ 1) = A22 ( k ) + (2*Mu*err(l k )* 22(k)); % Calculate the adpative feedforw a rd for runout if k>50 ffwd(k) = ( A 1 ( k )*s I (k)) + ( A2 ( k )*s2( k )) + ( A 12( k) *s 12( k )) + ( A22 ( k )*s22( k )); end % Calculate control effort igrna ( k)=c err(: k); caplam ( k ) =c ap l arn(k-1 ); u ( k )=ps i err(: k ) + caplam(k)+mu *s i g n (s i g ma ( k )); x(:,k+ l ) = ( phi x(:,k)) + (gamma*(u ( k ) + fbia s)); caplam ( k ) = c *( ref (:, k+ I ) -(phi ref (:, k ))) / ( c *gamma); end s mc plot s figure(6) elf plot ( A 12,' r') hold on plot(A22 ,' b') hold off grid title(' Coeffi c i e nt s of F ir t H a rm onic') 57

PAGE 69

figure(4 ) axi ([000 N -150 I 00]) figure(l) print dtiff no _ro_sigma2 figure(2) print dtiff no ro_refpo s2 figure(3) print -dtiff no ro_error2 % LMS runout compensa tor with s lidin g mode % ct % 3/31198 % % Chris Settje %4/23/98 % added system ID fe a ture % for thesis % plots : smc with runout comp but without adaptive applications %one frequency in reference % clear all %Nominal Values : % Kf=.204 ;%Nt/A m=.766e-3;% Kg c I =.0299;%Ntl(m/ ec) k1=58 5 ;%Nt/m Kdac= 1 .5/l 024;% V/cnt Kpa=0.46;% NV K adc=256/2;% c nt /trk Ks=2.0/.74e6 ;% V/m T= 12e-6 ;% ec fbiasp=O; % bias term in perce nt of max 5 8

PAGE 70

% simulation parameter s ref_freq=69 ;% reference frequency in Hz ref_amplitude=lOO; % max ref amplitude in bit s cycles=8 ; N=( 1/( ref_freq T)) cycles; % numb e r of reference period s per s im %N=l00; % % Scaling Matrix: I=eye (2); % Q=[Ks Kadc 0;0 Ks T Kadc] ; % % Nominal System Model ( Continuou Domain, control input): % A=[O 1 ;-kl/m -cllm]; B=[O;(Kf/m) *Kdac* Kpa] ; % % Translate to Digital Domain: % [Phil ,Gammal]=c2d( A B T) ; % %Scale the Phi Gamma Matrices: % phi=Q* Phi 1 inv(Q) ; gamma=Q*Gamma 1 ; % % controller design c=[l3 1]; delta=2 .04; lambda=0 7 ;% ??? p s i= (c*(p hi-lambda I )) / ( c *gamm a); mu=delta/ (c*gamma); L=(c phi )/(c*gamma);% e s timate of derivative ref term cginv= 1/(c *gamma); % initialize s im u ( I :2) =[0 0] ; 59

PAGE 71

fbia max=(2*de ltal ( I +lambda)-delt a)/ (c*gamma); fbias=fbia max fbia sp; x=O.I ones(2 ,2); xI =zeros(2,2) ; % define reference k=[l:N+l]; ref ( I k )=ref_amplitude in(2 pi k ref_freq T );% position ref ref(2, 1 : len g th ( ref) ) =zero ( 1 length ( re f)); s I= in(2* pi k ref_freq T + pi/4) ; s2 =co s( 2 pi k ref_freq T + pi/3) ; Mu=. 5; k_plant=1; c=[ 13 1] A 1 = 72*ones(l ,length( ref)+ 1 ); A2 = 73 *ones(l ,Jength ( ref)+ 1 ); ffwd = zeros(l length ( ref)+ 1); en or= O *randn(l ,length(ref)+ l );% Sen so r noise kcode=l; k _plant=l; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %execute for k=2:N-I err(:,k)=ref(:, k) -x(:, k ) +sen or( I k); %Update the a daptiv e gain coefficient Al(k+l) = A1( k ) + (2*Mu*err(l,k)* l ( k )); A2( k+1) = A2( k ) + (2*Mu*err(l,k)* 2(k)); % Calculate the adpative feedforward for runout if k>50 ffwd(k) = ( A I ( k )*s I ( k )) + ( A2 ( k )*s2( k )); end %Calculate control effort s i gma( k)=c err(: k); u ( k )=ps i *err(:, k )+mu*s ign (s igm a(k)) + ffwd(k); x(:,k + I ) = ( phi x(:,k)) + (gamma*( u ( k ) + fbias)); 60

PAGE 72

end smc_pl ot figure(l) print -dtiff ro_sigma figure(2) print -dtiff ro_refpos figure(3) print -dtiff ro_error figure(4) print -dtiff ro_coeffs figure(5) print -dtiff ffw % LMS runout compensator with sliding mode % cts % 3/31/98 % % Chri s Settje % 4/23/98 %added sy tern ID feature % for thesi % plots : me with runout comp but without adaptive application % two frequencies in reference % clear all %Nomina l Value s : % Kf=.204 ;%N t/A m=.766e-3; % K g cl =.0299 ;%Nt/(m/sec ) k I =58.5; % Nt/m Kd ac= 1 .5/1 024; % V lent 61

PAGE 73

Kpa=0.46;% NV Kadc=256/2;% cnts/trk Ks=2.0/.74e-6;% V /m T= 12e-6 ;%sec fbiasp=O ;% bias term in percent of max % imulation parameter ref_freq=69;% reference frequency in Hz ref_amplitude= lOO;% max ref amplitude in bit cycles=8; N=(l/(ref_freq*T))*cycles;% number of reference periods per sim % N=IOO; % %Scaling Matrix: I=eye( 2 ) ; % Q=[Ks *Kadc 0;0 Ks* T Kadc]; % %Nominal System Model (Continuou s Domai n control input): % A=[O I ;-k 1/m -c lim]; B=[O ;(Kf/m) *Kdac* Kpa]; % %Translate to Di gital Domain: % [Phi I ,Gamma I ]=c2d( A B T ) ; % %Scale the Phi Gamma Matrices: % phi=Q* Phi I *inv(Q); gamma=Q*Gamma I; % % controller design c=[l3 I]; delta=2.04; lambda=0.7;% ?? ? psi=( c (philambda I )) / ( c gamma); mu=deltal( c*gamma); 62

PAGE 74

L=(c phi ) / ( c gamma); % estimate of derivative ref term cg inv= 1/(c *gamma); % initi alize si m u( l :2)=[0 0]; tbiasmax= ( 2 delta/ ( I +lambda) d e lt a ) / ( c *gamma); tbias=fbia max tbiasp ; x=O. l *o n e (2 2) ; x l = zeros ( 2 2 ) ; % define reference k=[l:N+l]; ref l (1 k )=ref_amplitud e sin ( 2 *pi* k ref_freq T );% position ref ref2(1 ,k)=ref_amplitud e/2 si n (2 2 *pi* k ref_freq T + pi/ 3); % po iti o n ref ref=refl +ref2; ref(2, l :length(ref))=zeros( l length ( re f)); s l=s in (2 pi*k ref_freq T + pi/4 ); s 2=co (2 *pi* k ref_freq T + pi/3); s l2=sin(2* 2 pi k ref_fr eq T + pi/4 ); s 22 = cos(2 2 pi k *ref_ f r eq T + pi/3); Mu=.S ; k_plant= I ; c=[ 1 3 I] A I = 72* one (1 ,length ( r ef) + I ) ; A2 = 73 o n es( I length ( r ef) + I ); A 1 2 = 72 ones ( I l e n gt h ( ref)+ l ); A22 = 73 ones ( l l e n gt h ( r ef)+l) ; ffwd = z e ro s( l l ength ( ref)+ I); s en sor= O r a ndn ( I l engt h ( ref)+ I ) ; % Sen s o r noi s e kcode=l; k plant= I ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %execut e for k=2 : N l err (:,k)=ref (:, k )x ( : k ) + s en s or ( I ,k); 63

PAGE 75

% Update the a daptive gain coefficient Al(k+l) = A1(k) + (2*Mu*e rr ( l k )* l ( k )); A2( k+ I)= A2 ( k ) + (2 Mu *e rr ( I ,k) *s 2(k)); % Update the a daptiv e gain coefficient for first h ar moni c Al2(k+1) = A12(k ) + (2*Mu*e rr ( l k )*s l 2(k)); A22 ( k+ 1 ) = A2 2( k ) + ( 2 *Mu*e rr(l k )*s 22(k)); % Calculate the adpative feedforward for runout if k>50 ffwd(k) = (A1( k )*s 1(k )) + ( A2(k)*s2(k)) + ( A12 (k)*s12( k )) + ( A2 2( k )* 22( k )); e nd % Calculate control effort sigma( k)=c err (:, k); u(k)=p i *e rr (:, k )+mu* ign (s igma(k )) + ffwd(k); x(:,k + 1 ) = (phi x (:, k )) + (gamma*( u ( k ) + fbias)); end s mc_plots figure(6 ) elf plot(Al2,'r') hold on plot(A22,'b') hold off grid title(' Coefficient s of Fir s t Harmonic') figure(4 ) axi ([000 N -150 1 00]) figure( I ) print dtiff r o s i g ma2 figure(2) print -dt iff ro_refpos2 fig ur e(3) print -d tif f ro _e rr or2 64

PAGE 76

figure(4) print -dtiff ro coeffs2 figure(S) print -dtiff ffw2a f igure ( S ) print -dtiff ffw2b % LMS runout compensator with s liding mode % cts % 3/31198 % % Chri s Settje % 4/23/98 % added syste m ID feature % for thesi s % plot s : smc with runout comp but without adaptive a pplications %one frequency in reference %sigma minimization % clear all %Nominal Value s : % Kf= .204 ;%Nt/A m=.766e-3; % Kg c I =.0299 ;%Nt/( m/sec ) k l=58.5;%Nt/m Kdac=1 511024 ;%V/c nt Kpa=0.46;% NV Kadc=256/2;% cnts/trk Ks=2.0/.74e-6; % V/m T=l2e6 ;%sec fbiasp=O; % bia s term in percent of max 65

PAGE 77

%simulation parameter ref_freq=69;% reference frequency in Hz ref_amplitude= I 00;% max ref amplitude in bit cycle s = 8 ; N=( 1/ (ref_fre q T))*cycles;% numbe r of refe r ence periods p e r s im % N=IOO ; % %Scaling M a trix : l=eye(2); % Q=[Ks*Kadc 0 ; 0 K s* T *Kadc]; % %Nominal Sy tem Model (Continuou Doma in control input): % A=[O 1 ;-kl/m -cl/m]; B=[O ;(Kf/m)*Kdac*Kpa]; % %Translate to Digital Domain: % [Phi 1 ,Gamma ]=c2d( A B T ); % %Scale the Phi, G amma M a trice s: % phi=Q*Phi I in v( Q ); gamma=Q*Gamma 1 ; % % controller design c=[l 3 I ]; delta=2.04; l ambda=0. 7;% ??? p s i=(c*(phi-l ambda* I))/(c*gamma); mu=deltal(c*gamma); L=(c* phi ) /(c*gamma);% e timate of derivative ref term cginv= 1/ (c*gamma); %initialize im u ( I :2)=[0 0]; 66

PAGE 78

fbi asmax=( 2 d e lta/ (l+lambda)-d e lt a) / ( c gamma); fbi as=fbia max fbia s p ; x=O.J *ones( 2,2 ); x I =ze ro s( 2 2) ; % define referenc e k=[l :N+l]; r e f ( 1 k )=ref_amplitud e sin( 2 pi k re f_fr e q T );% p ositio n ref r e f ( 2 I :len g th ( r ef))=zeros( I J e n gth( r ef)) ; s I = s in ( 2 pi k ref_freq T + pi/4); s2=cos(2* pi k *ref_ freq T + pi/3); Mu=.S/5 ; k pl ant=l; c =[ 13 1] A I = 72*ones(l Jength ( re f) + 1 ); A 2 = 73 *ones(! Jength ( ref)+ 1 ); ffwd = zero s (! length ( ref)+ 1 ); e n sor = O *randn(l,Jeng th ( r ef)+l);% Sen sor n o i se k c ode=1 ; k plant=1; %%%%%%%% % % %%%%%%%%%%%%%%%%%%% % e xecute for k= 2:N-I e rr ( : k ) =r e f (:, k ) -x(: k ) + se n or( 1 k); i f c e rr (:, k ) > 0 ig_err( k ) =c e rr (:, k)-d e lt a/( l +l ambda); e l e s ig_err( k ) =c *err(:, k ) + d e lt a/(l+la mbd a); e nd % Update the a d a pti ve gain c oeffici e nt s Al(k+l) = Al( k ) + (2 *Mu* s i g e rr ( l k)*s l ( k )); A 2( k+ I ) = A2( k ) + ( 2 *Mu* s ig_err ( I k ) s2( k )); %Calcul a t e the adpative fee d fo r wa rd for run o u t i f k>50 ffwd ( k ) = ( A I ( k )*s I ( k )) + (A2( k )*s2( k )) ; e nd % Calculat e control e f fo rt 67

PAGE 79

s i gma( k )=c e rr(: k); c aplam ( k ) = c ( r e f (:, k+ I ) ( phi ref(:, k ))) / ( c gamma); u ( k)=ps i *err (:,k )+mu* s i g n ( i g m a ( k )) + ffw d ( k); x (:,k+l) = ( p h i x ( : k ) ) + (gamm a ( u ( k ) + fbia s)); e nd s mc_plot s fig ure ( 6 ) e l f plot ( c a pl a mff wd ( 1 : l e n g th (capla m ) )) title('capl am-ffwd { { e s tim a tion e rr o r }}' ) axi ( [0 N 100 /2 100 /2]);g rid f i gure( I ) print -dtiff r o s i g_s i g m a fig ure (2) print -dti ff ro _s ig_refpo s fig ure (3) print -dtiff ro s ig_err o r f i g ur e(4) print -dtiff ro s ig_coeffs fig ure ( S ) print -dtif f s ig ffw f i g ure ( 6 ) print -dtiff s i g_es t_error 68

PAGE 80

Appendix C: MATLAB Source Code for Section 5 % LMS runout compensator w ith sliding mode % cts % 3/3 1/ 98 % % Chris Settje %4/23/98 % added sys tem ID feature % for the s i s %plots: smc with runout compand with adaptive applicatio n for DC gain % c lear all %Nominal V a lu es: % Kf=. 204 ;%Nt/A m=.766e-3;% K g c l=. 0299; %Nt/( rn/ ec) k1=58.5; % N t/m Kdac=l.S/1024;% V/c nt Kpa=0.46;% NV Kadc = 256/2;% c nt s/t rk K s = 2.0/.74e-6; % V /m T=l2e-6 ;% ec fbiasp=O; % bias t e rm in p e rcent of m ax %simulation parameters ref_freq=69; % reference freq u e n cy in H z ref_amplitud e = I 00;% max ref a mplitud e in bit s cy cl es = 1 2; N=( 1/( ref_fr e q T )) *cycle s; % number of refer e nce p e riod s p e r s im N=8000 % N =IOO ; % 69

PAGE 81

% Scal in g M a tri x: l=eye(2); % Q =[Ks* Kadc 0; 0 K s* T K a d c ] ; % %Nomina l S y t ern M o d e l (Contin uo u D o m a in control input): % A =[O 1 ;-kl/m cllm]; B=[O ;( K f/m) *Kda c *Kpa ] ; % %Tra n s late t o Dig it a l D o m ain: % [Phi 1 G amma 1 ]=c2d ( A B T ); % %Scale th e Phi G a mma Matrices: % phi=Q*Phi 1 *i n v( Q ); gamma=Q* G amma l ; % % controller d es i g n c=[ 13 I]; d e lt a = 2.04; l ambda=0.7; % ??? p s i=(c*(phi l ambda I )) /(c*gamma); mu=de ltal(c*gamma); L=(c*phi)/(c*gamma); % estima t e of d e riv ative ref t erm cgin v = 1/ (c *gamma); % initi a lize s i m u ( I :2)=[0 0 ]; x =O.I o nes(2,2); x 1=zero (2,2); % defin e reference k=[ I :N+ I ]; r e f ( I k )=ref_ampl itude*sin (2 pi k ref_freq* T ); % positi o n ref ref(2, I : le ngth ( ref))=zero ( 1 le ngth(ref)); s I = s in ( 2 pi k *ref_ freq T + pi/4); 70

PAGE 82

s 2=cos(2 *pi* k ref_freq T + pi/3); Mu=.S/2 ; k plant=l ; c=[l3 I] A I = 72*o n es( I len g th ( ref)+ I); A2 = 73 one s( I len g th ( ref)+ I ); ffwd = zero ( l length ( ref)+ I); s en sor= O r a ndn ( l length ( ref)+ I);% S e n s or n o i se k code=l; k _plant=l; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% % execute % for k=2:N-1 f o r k=2:N err (:, k)=ref ( : k )x (:, k ) + en s or ( I k); % Update the adaptive gain coefficient s Al(k+l) = Al( k ) + ( 2 *Mu*err(l,k)*s 1 ( k )); A2 (k+ 1 ) = A2( k ) + ( 2 *Mu*err(l k )* 2 ( k )); % Calculate the adpative feedforward for runout if k>50 ffwd ( k) = (AI( k )*s 1 ( k )) + (A2( k )*s 2 ( k )); end % change plant gain if k==3000 k plant= 1.1; ea_gain=0. 005 ; elseif k==5000 k plant=0 9 ; ea_ gain=O O I ; end ; if k>3000 e a ( k ) = (( A2 ( 2999 )) -A2 ( k ))*ea_gain; % kcode=kcode *( 1-ea ( k )); e nd k c( k ) =k co d e; % u e d for p l o ttin g only 71

PAGE 83

kp(k)=k_plant ;% used for plotting only % Calculate control effort sigma(k)=c*err( : k ) ; u(k)=kcode* k plant *( psi err( : ,k)+mu *s ign(sigma ( k )) + ffwd ( k ) ); x (:,k+l)=( phi x (:, k )) + (gamma* u ( k )); end smc_plots figure(4 ) axis([OOO N 75 .62 75.74]) figure(6) elf plot( 1./kc,'r') hold on plot(kp) hold off title(' gain and code gain [nominal = 1 ]') ylabel(' % gain') xlabel('samples') axis([O N 0.75 1.25]) grid figure(7) elf plot ( kc. kp ) title('plant gain code gain [nominal= 1]') ylabel('% gain') xlabel('samples ') axis ([O N 0.75 1 25]) grid figure ( 8 ) elf plot( l 00. *ea) title(' Coefficient Error {A2} ') ylabei (' Coefficient Error') xla bel('samples') g rid 72

PAGE 84

figure( I) print -dtiff ro_dc _sigma figure(2) print -dtiff ro_dc_refpos figure(3) print -dtiff ro dc_error figure(4) print -dtiff ro_dc coeffs figure(5) print -dtiff ro dc_ffw figure(6) print -dtiff ro_dc_gain figure(7) print -dtiff ro_dc gainx figure(8) print -dtiff ro_dc_coeff_error % LMS runout compensator with sliding mode % cts % 3/31/98 % % Chris Settje % 4/23/98 % added system ID feature % for thesis %plots: smc with runout compand with adaptive application for DC gain % clear all % Nominal Value s : 73

PAGE 85

% Kf= .2 04 ;%Nt/ A m=.766e-3;% Kg c l=. 0299 ;%Nt/( m/ sec) ki=58.5;% Nt/m Kdac=l.5/ 1 024; % V/cnt Kpa=0.46 ;% NV Kadc=256/2 ;% cnts/trk K s =2.0/.74e-6;% V/m T= 12e-6; % ec fbia sp=O;% bia s term in percent of m ax %simulation parameters ref_freq=69 ;% reference frequency in H z ref_amplitude=lOO; % max ref a mplitude in bits cycles=12 ; N=(l/( ref_ f req T ))*cycles;% numb er of reference periods per s im N=8000 %N=l00; % % Scaling Matrix: l=eye(2 ); % Q=[K s* K adc 0 ; 0 K T K a dc] ; % % Nominal S ys tem Model ( Continu ous D o m a in co ntrol input): % A=[O 1 ;-kl/m -cl/m]; B=[O;(Kf/m)*Kdac Kp a ] ; % % Translate to Digital Dom ain: % [Phil G amma l ]=c 2 d (A, B T); % % Scale the Phi G amma M atrices: % phi=Q Phi I inv ( Q ); gamma=Q *Gamma I ; % % controller de s i g n 74

PAGE 86

c=[ 13 1 ] ; delta=2.04 ; lambda=0 .7;% ??? p s i= ( c (phi-Iambda I ))/( c gamma); mu=delta/ (c*gamma); L=(c* phi ) / (c*gamma);% e timate of derivativ e ref term cginv= 1/ (c*gamma); % initialize sim u ( 1 :2 ) =[0 0] ; x=O.l one s(2,2); x l=zeros (2,2); % define referenc e k=[1 :N+ 1]; ref ( 1 k ) =ref_amplitude *sin(2 pi k re f_f req T );% position ref ref (2, I :length ( ref) ) =zero s( 1 length ( re f)); sl= in(2* pi k ref_freq T + pi/4 ); s2 =co s(2* pi k ref_freq T + pi/3); Mu=.5/2 ; k pl ant=l; c=[13 1] A1 = 72* ones(l,length(ref)+1) ; A2 = 73 *ones(l length ( ref)+ 1); ffwd =zeros (I length ( ref)+ 1 ); sensor = O randn(l,Jength ( ref)+l);% S ensor noi se kcode=1 ; k_plant=1 ; %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %execute %for k=2 :N-l for k=2:N err ( :,k)=ref ( : k ) -x ( : ,k) + en or ( l k); % Update the adaptive gai n coefficient Al(k+l) = Al( k ) + (2* Mu *e rr ( l ,k) *s l ( k )); 75

PAGE 87

A2 ( k+1) = A2 ( k) + (2 Mu *e rr(l k )*s2( k )); % Calculate the adpative feedforward for runout if k>50 ffwd(k) = ( A I (k)*s I ( k )) + ( A 2( k )*s2(k)); end % change plant gain if k==3000 k_plant= 1 1 ; ea_gain=0.005; elseif k==5000 k_plant=0 9 ; ea_gain=O.O I ; end; if k>3000 ea(k)=((A2(2999))-A2(k)) ea_gain; kcode=kcode *( 1-ea ( k )); end kc ( k)=kcode; % used for plotting only kp(k)=k_plant; % u se d for plotting only % Calculate control effort i gma(k) = c*err(:,k); u ( k)=kcode k plant *( p s i err(:,k)+mu *s i g n (s i g ma ( k )) + ffwd(k)); x(:,k+ 1 ) = (p hi x(:,k)) + (gamma* u (k)); e nd s mc_plot s figure(4) ax i s([OOO N 75 .62 75.74]) figure(6) e lf plot( 1 /kc,'r') hold on plot ( kp ) hold off title(' gain and code gai n [nominal = I]') 76

PAGE 88

ylabe l('% gain') xlabel(' amples') axis([O N 0.75 1.25]) gri d f i g ure(? ) elf plot(kc kp ) tit le(' plant gain code gain [nomin a l = 1 ]') y l a bel (' % gain') xlabe l('samples') axis([ O N 0 75 1.25]) gri d figure(8) elf plot( 100. ea) title (' Coefficient Error { A2} ') ylabel('Coefficient Error') xlabel('samples') gr id fig ur e( 1) print dtiff dc _s i g m a fig ure (2) print dtiff dc_r efpos figure(3) print dtiff dc_error figure(4) pr int -dtiff dc_coeffs fig ur e(5) print -dt i ff dc ffw f igure ( 6) pr int -dtiff dc_gain f i g ur e(?) 77

PAGE 89

print -dtiff dc_gainx figure(8) print -dtiff dc_coeff_ error 78

PAGE 90

Bibliography B.K Bose Sliding Mode Control of Induction Motor ," IEEE CH2207 pp 479-486, September, 1985. J.H. Hung and W B. Gao and J.C. Hung Variable Structure Control : A Surv ey," IEEE Transaction on Industrial Electronics Vol 40 No 1 pp 2-22, February 1993. H.N. Ioranou and B.W. Surgenor "Experime ntal Evaluation of the Robu stness of Dis crete Sliding Mode Control Versus Linear Qu adratic Control ," IEEE Tran sact ion on Control Systems Technology Vol5, No .2, pp 254-260 March 1997 U. Itkis, Control Systems of Variable Structure ," New York: Wiley, 1976 V.I. Utkin VAriable Structure System s with Sliding Mode s,", IEEE Tran sac tion on Automatic Control Vol AC-22, No.2, pp. 212-222 April 1977. S .I. Sarpturk and Y. Istefanopulos and 0 Kaynak "On the Stability of DiscreteTime Sliding Mode Control Sy s tems, ", IEEE Transaction on Automatic Control Vol AC32, No. 10 pp. 930-932 October 1987. 79