![]()
APN01V10-0792
Abstract
Plant Model
Topologies
Proportional Control -- Classical
Proportional Control -- Fuzzy
Integral Control
Fuzzy Integral Control
Phase PD Control
Fuzzy Phase PD Control
Phase and Tach Feedback
Fuzzy Phase and Tach Feedback
Synchronized Phase
Fuzzy Synchronized Phase
Summary of Fuzzy Topologies
Control Surface Design
Conclusion
Brian P. Tremaine
Seagate Technology, Scotts Valley, CA
This paper compares classical and fuzzy servo control of a disc drive DC spindle motor. A C program simulates the plant and the classical feedback control law. The plant program is compiled with a fuzzy Inference development program, FIDE, from Aptronix Inc. The paper assumes a knowledge of fuzzy Logic principles.
The DC spindle motor, driver electronics and digital transducers comprise the plant and are inherently nonlinear. The driver only develops positive torque, a common practice in disc drive spindle applications. Therefore deceleration of the motor is dependent on coulomb friction only. The plant nonlinearities include saturation of the error signal, torque control in only one quadrant, and quantization of the transducer signals and of the output control voltage. Linear analysis methods do not apply to either the classical or fuzzy design method. The control surfaces of classical linear controllers do not necessarily provide good performance as measured by start up settle time. A fuzzy controller has a nonlinear control surface that can take advantage of the plant nonlinearity and yield a higher performance system.
An argument is presented that an input to output mapping of classical servo controllers is a linear subset of fuzzy controllers.
Five classical topologies are examined. An analogous fuzzy system is presented for each classical topology. The topologies considered are:
1. Tachometer feedback with proportional (P) control.
2. Tachometer feedback with proportional plus integral control (PI).
3. Phase detector feedback with proportional plus derivative control (PD)
4. Phase detector and tachometer feedback with proportional control.
The sample rate is eighteen times per motor revolution for both loops.
5. Phase detector feedback once per motor revolution with
tachometer feedback eighteen times per motor revolution.
The plant model (Figure 1) is a DC three phase 12 pole spindle motor and driver electronics. The driver only develops positive torque. Therefore deceleration of the motor is dependent on coulomb friction only. The output topology is three half-bridge drivers with current sense feedback. The input to the driver is an analog voltage commanding spindle current with a gain gm (amps per volt). When the input is Vth volts, the current command is zero, and the output stages are off. In this case only coulomb friction decelerates the motor. Maximum current occurs when the input is zero volts. The motor resistance, supply voltage, and bemf voltage limits the maximum current. The current control loop around the motor and driver stage typically has a bandwidth several orders of magnitude above the velocity bandwidth. For this reason, the dynamics of the current control loop are not in the plant simulation. The plant model calculates the maximum available current and drives the motor with a current source equal to the lesser of the commanded current or maximum available current.
Figure 1 - Plant Block Diagram

The plant model also calculates motor speed (radians per sec), position (radians) and a digital encoder pulse, fcom. The digital tachometer and digital phase detector use the signal fcom, which occurs eighteen times per motor revolution (Np=18). The continuous time linearized transfer function of the motor and driver (control voltage to velocity) is:
H(s) = ( gm× Kt/Jm )/(s + Kv/Jm ), rad/sec· volt .............(1)
gm, transconductance amps/volt
Kt, torque constant oz-in/amp
Kv, viscous constant oz-in-sec
Jm, inertia in-oz-sec
Since the transducers have discrete time outputs one might be tempted to convert to discrete time using z-transform methods. This involves an approximation because the sample interval is a fixed motor rotation 2P /Np, not a fixed sample time. As a practical matter, the discrete system is sometimes designed assuming T is the fixed sample time at running speed. Note however that the linearized system in equation 1 along with the fixed sample time completely ignores the real system nonlinearity. Stability of the linearized system does not ensure global stability of the real system. This paper will not address the non linear stability analysis, other than to say that an appropriate Lyapunov function would determine the degree of stability. The linearized discrete time transfer function has the form shown in equation 2.
H(z) = Kd/( z - a ), rad/sec· volt..................... ..................(2)
Five control topologies are simulated. The results are plotted and the settle time is marked as the time to achieve 0.3% speed regulation for a period of four consecutive revolutions.
Proportional Control -- Classical
The most simple control method for the plant given by equation 1 is proportional control. Figure 2 shows the system block diagram. The digital tachometer compares the fcom period to a reference period and outputs the signed difference as an error count. The error count is converted to an analog signal using a gain and offset value and the result is limited to the range (0, Vth+0.7).
Vout = K1× count/256 + K2........................... (3)
In the simulation, the reference clock has a 1 usec period. At the final speed of 3546.01 RPM, the fcom period is 940 usec. The 9-bit signed count is then truncated to 8-bits with sign. If the tachometer gain is Kw volts per rad/sec, the total open loop gain of the discrete time loop is:
Hol(z) = Kw× Kd/( z - a ) ................................(4)
Figure 6 shows a plot of motor speed and current for a spin up condition from a dead stop. Notice there is steady state speed error. This is characteristic of the proportional control loop with input offsets. In our case, coulomb friction of 0.06 oz-inches requires 59 ma of motor run current and results in a speed error of approximately 15 RPM. Also notice there is a steady state limit cycle caused by quantization.
Figure 2a - Classical Proportional Control

The fuzzy implementation of the proportional control replaces the linear equation 3, with a fuzzy system. The input to the system is velocity error count and the output is volts.
The domain of the quantized single input, xd_err, is the integer range {-128, 127}. The fuzzy labels Neg_Large, Neg_Med, Zero, Pos_Med, and Pos_Large are assigned to the input. The Membership Functions shown in Figure 3 define the mapping from the crisp input to the fuzzy labels.
Figure 3 Demo1 - Membership Functions

The fuzzy output variable is an integer count in the domain {0, 255} The output labels are Neg_Large, Neg_Med, Neg_Small, Zero, and Pos_Large. The output labels are assigned the Singletons shown in Figure 4. Note that the same label name can be used for several variables. In FIDE, a label name is defined by the variable which is referenced.
Figure 4 Demo1 - Output Singletons

Figure 5 (FIU Demo1 sourec code) is a listing of the FIDE source file. The min-max fuzzy inference method is used. The following translation converts the digital output of the fuzzy system, x, to analog.
Vout = K1× (x - 128)/256 + K2 .............................................(5)
Figure 7 shows a plot of motor speed and current for spin up from a dead stop. The linearized small signal gains near steady state are set the same for both the classical and fuzzy systems. Notice the response is the same for both systems, including the steady state error and limit cycle.
Figure 6 Demo1 - Classical Proportional Control

Figure 7 Demo1 - Fuzzy Proportional Control

In order to force the speed error to zero, classical feedback control sums the error and time integral of error (PI) to form the feedback control law. The control law calculation is as follows for a discrete time system.
Vint(k) = Vint(k-1) + ki× count(k); ..........................................(6a)
Vout(k) = kp× count(k) + Vint(k); ...........................................(6b)
For a linear time invariant (LTI) system the discrete time open loop gain has the form in equation 7.
Hol(z) = Kw× Kd× ((kp + ki)× z - kp)/( (z - a)× (z - 1)) ..................(7)
The variables count and Vint are both truncated to the integer range {-128, 127}. Figure 10 shows a plot of motor speed and current for spin up from a dead stop. Notice that the steady state speed is very nearly the commanded speed. The very small speed error is due to the quantization using a 1.0 usec clock in the tachometer. Also note however that the transient response is worse. There is over speed due to "integrator windup" and a long coast period caused by single quadrant control.
A common nonlinear approach to improve the classical PI system is to clamp and hold the integrator during spin-up. The integrator is unclamped when the speed error is small. Using this "anti-windup" control results in much less overshoot.
Figure 8 Demo2 - Fuzzy PI Block Diagram

Figure 10 Demo2 - Classical PI Control

This method uses one fuzzy inference unit (FIU), see the block diagram in Figure 8. This block is analogous to the proportional and integral control of classical methods. A FIU does not have memory. Therefore "integral" action was achieved using feedback from output to input on the FIU. The FIU has the listing shown in Figure 9 (FIU Demo 2 source code). The inputs are speed error and previous output integral count. The outputs are proportional count, x, and integral count, y. The control law is a summation of both output counts.
Vout = K1× (x-128)/255 + K2× (y-128)/255 + K3 ...........................(8)
Figure 11 shows a plot of motor speed and current for spin up from a dead stop. Notice that the steady state speed is very nearly the commanded speed as is the case of the integral controller. Note however that the transient response is improved. There is less overshoot and faster settling with the fuzzy Integral control. In the classical PI system there is a trade off between overshoot and settle time. The fuzzy system Rules and Membership Functions effectively implement "anti-windup" integral control.
Figure 11 Demo2 - Fuzzy PI Control

Figure 12 - Phase Detector State Diagram

This method uses a digital phase detector for feedback. Figure 12 shows the state diagram of the phase detector. The inputs are a reference frequency,fref, at the desired motor fcom rate and the motor fcom. The digital phase detector counts the leading or lagging time interval between reference and feedback. The output is a digital count truncated to the integer range of {-128, 127}. Each count represents 5.0 micro-seconds. The digital phase detector will output a constant value when there is a constant phase error. A constant frequency error is a phase ramp and the digital phase detector will output an alias or beat frequency. For this reason a 2nd order lowpass filter, LPF(z), was added to the plant model to filter the control voltage when the digital phase detector is used. The control law is as follows.
Vout(k) = K1× count(k) + K2× (count(k) - count(k-1)) ......................(9)
For a LTI system the discrete time total open loop gain has the form given by equation 10.
Hol(z) = LPF(z)× Kw× Kd× ((k1 + k2)× z - k2)/( (z - a)× (z - 1)) ............(10)
Figure 14 shows a plot of motor speed, current and phase error for spin up. Since a constant phase error implies zero speed error, without a quantization limit cycle the steady state speed would be the commanded value. During the acceleration period the phase detector alias frequency can be seen on the phase error and motor current. When the phase detector is truncated the measure of velocity, given by count(k) - count(k-1), is zero. This is incorrect and a limitation of using the digital phase detector in a PD loop.
Figure 13 Demo3 - Fuzzy PD Block Diagram

Figure 14 Classical Phase Detector PD Control

Figure 13 shows a diagram of this method. The single FIU has two inputs and one output. The inputs are phase_err and delta phase_err. A gain and offset convert the output of the FIU, a digital count, to a voltage.
Vout(k) = K1× count/256 + K2 ....................................(11)
Figure 15 shows a plot of motor speed, current and phase error for spin up. The settle response is strongly dependent on the initial reference phase. The results in Figure 14 and 15 are the worst found in several simulation runs. Performance is about equal for both fuzzy and classical methods.
Figure 15 Fuzzy Phase Detector PD Control

Figure 16 Classical Phase and Tach Control

Figure 16 shows a diagram of this method. Both the phase error and velocity error are sampled at the motor fcom frequency. The control law is formed as a linear weighted sum of the two error signals.
count = K1× phase_err + K2× speed_err ......................................................(12)
For a LTI discrete time system the total open loop gain has the form given by equation 13.
Hol(z) = LPF(z)× Kl× (z + b)× (K2× z2 + 2× K1× T× z - k2)/((z -1)× (z - a)) ........(13)
The output is truncated to the integer range {-128,127} and translated to an analog output with equation 11. Figure 18 shows a plot of motor speed, current and phase error for spin up. During the acceleration period the phase detector alias frequency is seen on the phase error, but the velocity gain ensures maximum current. Also there is a limit cycle of about 15 microseconds peak to peak.
Figure 17 Fuzzy Phase and Tach Control

Figure 18 Demo4 Cassical Phase & Tach Control

Figure 17 shows a diagram of this method. The single FIU has three inputs and one output. The inputs are phase_err, delta phase_err and speed_err. The inputs are sampled every motor fcom period. A gain and offset convert the output of the FIU, a digital count, to a voltage given by equation (11). Figure 19 shows a plot of motor speed, current and phase error for a spin up condition. The overshoot is small in both methods, and the fuzzy system settled slightly slower but the limit cycle is only 5 microseconds peak to peak. During spin up the digital phase detector alias frequency is still present, but Rules are employed to give maximum acceleration until the speed error is small.
Figure 19 Demo4 Fuzzy Phase & Tach Control

Figure 20 Demo5 - Classical Sychronous Phase & Tach

The block diagram of this method is the same as Figure 16. However, in this method, an inner tachometer feedback loop samples at the motor fcom frequency while an outer phase loop samples once per motor revolution. The reference for this outer loop could be the Index pulse of another spindle, thus providing synchronized spindle motor control. The control law for this method is once again a weighted linear sum of the error signals as given by equation 12. Figure 20 shows a plot of motor speed, current and phase error for spin up.
The block diagram of this method is the same as Figure 17, except the phase error is updated only once per motor revolution. The single FIU has three inputs and one output. The inputs are phase_err, delta phase_err and speed_err. A gain and offset convert the output of the FIU, a digital count, to a voltage given by equation 11. Even though the phase error sample is updated once every eighteen speed error samples, the FIDE simulation is calculating the FIU for all inputs every fcom. The redundant samples would not be calculated in a real application.
Figure 21 Demo5 - Fuzzy Sychronous Phase & Tach

Figure 21 shows a plot of motor speed, current and phase error for spin up. The overshoot and limit cycle is smaller than the classical approach and the Rules ensure maximum acceleration during spin up.
The following table shows the size of each fuzzy model.
| Model | inputs | labels per Input |
outputs | labels per Output |
Rules | 68HC11 code bytes |
| Demo1 | 1 | 5 | 1 | 5 | 5 | 408 |
| Demo2 | 2 | 5 | 2 | 5 | 26 | 824 |
| Demo3 | 2 | 5 | 1 | 7 | 26 | 819 |
| Demo4 | 3 | 5 | 1 | 7 | 50 | 1213 |
| Demo5 | 3 | 5 | 1 | 7 | 78 | 1915 |
The number of code bytes for a 68HC11 microprocessor is for reference. The range of execution times on the above models are about 1.2 - 8 milliseconds with a 476 ns machine cycle time. The sample time, fcom period, of 940 microseconds is faster than even the Demo1 model can execute. The models were not optimized for minimum number of rules. Optimizing the rules is a very important step affecting the choice of hardware platform.
The following discussion develops the argument that with regard to input-to-output mapping a classical servo controller is a linear subset of fuzzy controllers. A continuous time plant can be described as a nonlinear differential equation in terms of the system states:
d x(t)/dt = f(x(t), u(t)) ......................(14a)
y(t) = g(x(t), u(t)) ............................(14b)
Where x represents a vector of the system states, {x1, x2 , ....., xn}, u is a vector of the control inputs, {u1, u2, ..., ui} and y is a vector of outputs, {y1, y2, ...ym}. For a linear time invariant (LTI) plant, or a linearized version, this can be simplified to :
d x(t)/dt = Ax(t) + Bu(t) ....................(15a)
y(t) = Cx(t) + Du(t) ..........................(15b)
For a LTI discrete time plant the analogous equations are:
x(k+1) = Fx(k) + Gu(k) ..................(16a)
y(k) = Cx(k) + Bu(k)...................... (16b)
It is well known from optimal control theory that a quadratic cost function defined by equation 17
minu J = S xTQx + uTRu .........(17)
for a LTI discrete time system has a stable solution given by a linear weighted sum of the system states:
u(k) = - Kx(k)................................. (18)
The vector of gains, K, is found by solving a discrete Riccati equation.
Note that equation 18 is another representation of the control law feedback used in all the classical control examples given earlier. It should be noted that the solution is only optimal for an LTI system and only in the sense that it minimizes J. This can be written in a general form for a multi-input multi-output controller as equation 19.
u(k) = - f(x(k)) ...............................(19)
Equation 19 can be viewed as hyperplanes in n-space, or control surfaces. The function f(x(k)) is a mapping of inputs to outputs. In a system with quantization and saturation f(x(k)) is nonlinear. Figure 22 and 23 show the control surface for the classical phase and tachometer feedback examples. In a fuzzy system the control law f(x(k)) can be made intentionally nonlinear to optimize different operating regions of the system.
Figure 22 - Demo4 Classical Control Surface

Figure 23 - Demo5 Classical Control Surface

The control law defined by equation 18 assumes all system states, x, are available for feedback. When this is not the case an estimator is used to reconstruct the states from the available outputs, y. Figure 24 shows the estimator block diagram. Then the control law is formed using the estimated states in equation 18. The control law and estimator can be combined into a single controller with inputs, y, and outputs u. Now the controller has memory and can be defined by equation 20.
u(k) = - f(y(k), x (k)) .....................(20)
Where x (k) are the internal states of the controller at sample time k. In the fuzzy PI example feedback of the FIU output to input created an internal state.

One method of fuzzy controller design is to use classical methods to define the control law using equations 16, 17, and 18. The gains, K, give a starting place to design the Membership Functions and Rules. Then based on the regions of nonlinearity, the Membership Functions or Rules can be modified. Specific Rules can be added to cover special conditions.
Several examples of classical servo control were compared with fuzzy control of a DC spindle motor. The plant and transducers have inherent nonlinearities that preclude applying linear stability theory, regardless of the control method.
Performance was measured in terms of spin up settle time and steady state limit cycle amplitude. The performance of the fuzzy system was equal to or better than the classical topology. It was shown that a classical and a fuzzy controller can both be described as a mapping of inputs to outputs with internal memory. It was shown that optimal control methods can be used to arrive at a vector of gains, K, which give a starting point at designing the fuzzy system control surfaces.
For Further Information Please Contact:
FuzzyNet http://www.aptronix.com/fuzzynet
Email: fuzzynet@aptronix.com
Weijing Zhang,
Applications Engineer.
Copyright © 1992 by Aptronix
Inc.
Revised: October 21, 1996.