EDN -- 07.07.94 Weigh the benefits of fuzzy-logic vs classical control in a disk-drive spindl

-July 07, 1994

EDN logo

Design Feature:July 7, 1994

Weigh the benefits of fuzzy-logic vs classical control in a disk-drive spindle

Brian P Tremaine,
Seagate Technology

You can apply fuzzy- and classical-control techniques to any servo-control loop. Which technique you use depends heavily on the nonlinearities in a system.

A furor is raging over whether you should use fuzzy-logic or classical-control tools to analyze a complex servo-control system. Fuzzy-logic advocates claim it eliminates the need for a mathematical system description, while classical-control advocates claim fuzzy logic's lack of analysis tools makes it undesirable. To observe these extreme views, compare the classical- and fuzzy-control analysis of a disk-drive dc spindle motor. The comparison uses a C program, which simulates the plant and classical feedback-control signal.

The FIDE (fuzzy inference-development) program from Aptronix Inc compiles the plant program to simulate a fuzzy controller. The spindle-motor example shows that even a basic system can have nonlinearities, which preclude linear analysis. However, knowledge of the system equations can aid the design of a fuzzy controller.

The dc spindle motor, driver electronics, and digital transducers comprise the system's plant and are inherently nonlinear. The driver develops only positive torque, which is a common practice in disk-drive applications. Therefore, the motor depends only on coulomb friction to decelerate. The plant's nonlinearities include saturation of the error signal, torque control in only one quadrant, and quantization of the transducer signals from the output control voltage. Therefore, linear- analysis methods do not apply for either the classical or fuzzy set of control tools. This analysis compares the differences between a classical proportional plus integral (PI) controller and a fuzzy controller.

The plant model (Fig 1) is a dc 3-phase, 12-pole spindle motor along with the driver electronics. The output circuitry comprises three half-bridge drivers with current-sense feedback. The input to the driver is an analog voltage, which generates the spindle motor current through a current amplifier having a gain of gm (amps/volt). When the input voltage equals some reference voltage, the current command is zero, and the output stages are off. During this time, coulomb friction decelerates the motor. Maximum current drive occurs when the input voltage is at 0V. The motor resistance, supply voltage, and the back EMF from the motor limit the maximum current drive to the motor.

Simulator doesn't model current control

The current-control loop around the motor and the current amplifier typically have a bandwidth several orders of magnitude greater than the motor's velocity bandwidth. Therefore, the plant simulation doesn't include the dynamics of the current-control loop in Fig 1. Instead, the plant model calculates the maximum available current and drives the motor using a current source, which is equal to either the commanded current or the maximum available current, whichever is smaller.

The classical-control analysis applies linearization to the nonlinear plant to design a proportional PI controller. The linear model does not predict the correct simulated transient response. The simulated plant model calculates motor speed in rad/sec, position in rad, and a digital encoder pulse, called fcom. A digital tachometer and digital phase detector use the fcom signal, which occurs nine times/revolution of the motor (Np=9). The linearized transfer function of the motor and current driver in continuous time is:

H(s)=(gm.Kt/Jm)/(s+Kv/Jm), rad/sec.V,

where gm=0.5 A/V, transconductance; Kt=1.05 oz-in./A, torque constant; Kv=0.001 oz-in./sec, viscous constant; and Jm=752E-6 oz-in.-sec2, inertia.

The equation represents the transfer function from the input voltage to the motor's radial velocity output. Because the tachometer's outputs are discrete, the continuous-time representation is converted to discrete time using the z-transform. The transform involves an approximation because the sample interval is at a fixed motor rotation (2[pi]/Np) and not at a fixed sample time. As a practical matter, the discrete system is often analyzed assuming T is a fixed sample time. Although we make this approximation, linearizing the system and assuming a fixed sample time completely ignores the real system's nonlinearity. Stability of the linearized system does not ensure global stability of the real system. An appropriate Lyaponov function could determine a nonlinear system's degree of stability. Finding such a Lyaponov function is difficult, however.

You can derive a difference equation directly from Eq 1 by assuming a small time increment, as follows:


If dt=T and t=kT, then Eq 2 becomes


Noting that the z-transform of v(kT+T is v(z).z, the overall transfer function is

H(z)=gm.Kt.T/Jm)/(z-(1-T.Kv/Jm)), rad/sec.V.

Digital tachometer provides feedback

Regardless of whether the controller is classical or fuzzy, you must measure the spindle speed for feedback control. Fig 1 includes a block diagram labeled "digital tachometer"showing the measurement of the spindle speed, v(t). The output of this block is xd_err, a digital word representing speed error.

The digital tachometer counts the period of the fcom pulse with 1-msec resolution (ti). You subtract the final count from a reference count of 1880. The tachometer then truncates the count to fall within -128 to +127 counts to generate the xd_err signal. If the time interval is Tt and the average velocity over an fcom period is wavg, then wavg(Tt) is the average velocity over the time interval:

vavg(Tt)=2 x [pi]/(NpxTt).

This equation is nonlinear in the variable Tt. To linearize the equation, you can write a Taylor series around the reference velocity vref and the reference period Tt. You linearize a function using a Taylor series about an equilibrium point. If you linearize f(x,t) about the point x0, then the first two terms of the Taylor series are


where f' denotes the derivative with respect to x. Applying this to Eq 5 yields


Because vavg(Tt) is the average velocity over the period Tt, you can express this equation in terms of the velocity at the beginning and the end of the period, as follows:


Combining Eqs 7 and 8 yields

(v(k)-vref+(v(k-1)-vref)-2'(vref/Tref) x tt-Tref).

Denoting the difference between w and vref as ve and measuring the time interval in terms of ti reduces Eq 9 to


where d(k) is the digital count of the time interval.

The z-transform for Eq 10 is the transfer function of the digital tachometer, as follows:



If the motor velocity is significantly different from the reference frequency (vref), the Taylor series expansion is no longer accurate. In addition, if the velocity is low, the sample time is long, and the phase delay of D(z) is long.

The plant-transfer function in Eq 1 has a maximum phase delay of 90 degrees. Even when you represent Eq 1 in discrete form (Eq 4), the closed-loop bandwidth is sufficiently below the Nyquist frequency, 1/T, that the phase delay caused by sampling is small. Therefore, you can stabilize the plant using only proportional feedback from the tachometer. However, the speed error is not exactly zero. Offsets in the driver stage and motor running torque relative to the driver input requires a speed error to counteract the offsets.

To force the speed error to zero, classical feedback-control systems sum the speed error and the time integral of the speed error (PI) to generate the feedback-control law. The control-law calculation for a discrete time system follows:



where xd_err is the digital word representing speed error. Eq 13 is the difference equation for the digital integrator, and Eq 14 is the linear sum of the speed error and time integral of the speed error. You can combine Eqs 13 and 14 into a transfer function in the z-domain for the equivalent digital controller, C(z), as follows:


The open-loop gain of the linearized system is

H(z).C(z).D(z), Gol(z)=D(z).((kp+ki).gm Kt.T/Jm)


Substituting some of the system parameters into Eq 17 yields open-loop poles as z1=1, and z2=0.99. The digital tachometer produces a pole at z=0 and a zero at z=-1. The ratio of the integral gain to proportional gain determines the zero at z=1/(1+ki/kp).

The linearized model predicts closed-loop poles that are well-damped for small ki/kp and under-damped for large ki/kp. This result is in contrast to the simulation results (Fig 2) and highlights the fact that nonlinearities in a system can invalidate the use of linear methods.

Fig 2 shows a plot of the simulated spindle speed using a classical PI controller with a nonlinear plant. In Eqs 13 and 14, ki=3/2048, and kp=48/2048. The speed overshoots the target and slowly decays with a linear ramp to the target speed value. From time t=0 until Point 1, the speed error is negative, and the integrator continues to accumulate until it saturates. Not until the speed error begins to go positive does the integrator begin to come out of saturation. At Point 2 the integrator has recovered enough to allow the control voltage to command zero current. From Point 2 until Point 3 the only deceleration is due to coulomb friction. Beyond Point 3, the system settles to a steady state value.

Fuzzy control uses different control blocks

Fuzzy integral control analyzes the spindle motor using a fuzzy-inference unit (FIU) (Fig 3). This analysis block is analogous to the proportional plus integral control block of the classical method. Because an FIU has no memory, fuzzy control accomplishes the integral function by using the feedback from the FIU's output to its input. The FIU has the FIDE listing shown in Fig 4. The inputs to the FIU are the speed error (xd_err) and previous output integral count (V_old). The outputs of the FIU are proportional count (error) and integral count (V_new). Fig 5 shows a table representation of the FIU rules. The control law is a summation of both outputs


Fig 6 shows a plot of motor speed and current for spin-up from a dead stop. The steady state speed nearly equals the commanded speed, as in the integral controller. However, the fuzzy method improves transient response, decreases overshoot, and provides faster settling. A classical PI system involves a tradeoff between overshoot and settling time. The fuzzy-system rules and membership functions effectively implement "anti-windup" integral control. When xd_err is positive, (over speed) the integral term (v_new) is forced positive to zero the spindle-motor current immediately to cause deceleration.

Table 1 details the fuzzy model:

Table 1—The fuzzy model
ModelFuzzy PI
68HC11code bytes717

The execution time for the above model with a 68HC11 µP is about 1.25 msec using a 50-nsec bus cycle time. The execution time is sufficient for the sample time and fcom period of 1.88 msec. The model is optimized for the minimum number of rules, which is an important step affecting the choice of hardware. The initial pass of the FIU has 30 rules and 877 code bytes. Although this pass executes in 1.6 msec, there is little margin in processor bandwidth.

The output v_new is a function of xd_err and v_old. Because each input has five labels, you can define v_new as a 535 matrix, or 25 rules. The output, error, is a function of xd_err only. Because xd_err has five labels, five rules can define the output, error. Therefore, there are 30 rules for the the first pass. In the last row of Fig 5, when xd_err is Pos_Large, V_new is Pos_Large, regardless of v_old. This condition lets you replace five rules with one rule: "If xd_err is Pos_Large, then v_new is Pos_Large." Modifications such as these can reduce the number of rules from 30 to 17.

In comparing a classical PI servo-control loop with a fuzzy-control loop for a dc spindle motor, the plant and the tachometer have inherent nonlinearities that preclude applying linear stability theory, regardless of the control method. Knowledge of classical PI servo-control principles helps with the design of a fuzzy controller. The performance in terms of the spin-up settling time and the transient response is superior using the fuzzy system compared with the classical PI controller when there are severe nonlinearities.

The C source code for both the FIDE fuzzy modules and the plant model is available from the author. In addition to the PI controller, you can also use the Aptronix bulletin-board system to access source and executable simulation code for proportional control, PLL control, and dual-phase and tachometer loops for classical and fuzzy control.

Author's biography

Brian P Tremaine is a senior engineering director for Seagate Technology in Scotts Valley, CA. His job includes managing a group that is responsible for control-system design of actuator and spindle servos on 2.5- and 1.8-in. disk files. In his nine years with Seagate, he has helped to develop a host of disk-file products. Tremaine has BSEE and MSEE degrees from San Jose State University, San Jose, and an MBA from Golden Gate University, San Francisco. He is a registered professional engineer in California, and he is completing an engineer degree at Stanford University, Stanford, CA, this year. Tremaine is married and has two children.


  1. Kosko, B, Neural Networks and Fuzzy Systems: A Dynamical Systems Approach to Machine Intelligence, Prentice Hall, 1992.

  2. Franklin, G, D Powel, and M Workman, Digital Con- trol of Dynamic Systems, Second Edition, Addison Wesley, 1990.

| EDN Access | feedback | subscribe to EDN! |
| design features | design ideas | columnist |

Copyright c 1996 EDN Magazine. EDN is a registered trademark of Reed Properties Inc, used under license.

Loading comments...

Write a Comment

To comment please Log In