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

**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 f_{com}. A digital tachometer and digital phase detector use the f

_{com}signal, which occurs nine times/revolution of the motor (N

_{p}=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.-sec_{2}, 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]/N_{p}) 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.

(v(t+dt)=(1-dt^{.}(Kv/Jm))^{.}v(t)+(gm^{.}Kt^{.}dt/Jm)^{.}v(t).

(v(kT+T=(1-T^{.}(Kv/Jm))^{.}v(kT)+(gm^{.}Kt^{.}T/Jm)^{.}v(kT).

^{.}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 f_{com}pulse with 1-msec resolution (t

_{i}). 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 T

_{t}and the average velocity over an f

_{com}period is w

_{avg}, then w

_{avg}(T

_{t}) is the average velocity over the time interval:

v_{avg}(T_{t})=2 x [pi]/(N_{p}xT_{t}).

This equation is nonlinear in the variable T_{t}. To linearize the equation, you can write a Taylor series around the reference velocity v_{ref} and the reference period T_{t}. 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

f(x,t)=f(x0,t)+f'(x0,t)(x-x0),

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

v_{avg}(T_{t})=v_{ref}-(v_{ref}/T_{ref})*(T_{t}-T_{ref}).

_{avg}(T

_{t}) is the average velocity over the period T

_{t}, you can express this equation in terms of the velocity at the beginning and the end of the period, as follows:

v_{avg}(k)=(1/2)^{.}(v(k)+v(k-1)).

(v(k)-v_{ref}+(v(k-1)-v_{ref})-2'(v_{ref}/T_{ref}) x t_{t}-T_{ref}).

_{ref}as v

_{e}and measuring the time interval in terms of t

_{i}reduces Eq 9 to

ve(k)+ve(k-1=-2^{.}(v_{ref}/T_{ref})xt_{i}xd(k),

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:

ve(z)+ve(z)/z=-2x(v_{ref}/T_{ref})x(T_{t}-t_{i}xd(z).

## D(z)=d(z)/ve(z)=-T_{ref}/(2xv_{ref}xt_{i}))x1+z)/z.

If the motor velocity is significantly different from the reference frequency (v_{ref}), 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:
Vint(k)=Vint(k-1+k_{i}^{.}xd_err(k);

Vout(k)=k_{p}^{.}xd_err(k)+Vint(k),

C(z)=Vout(z)/xd_err(z)=kp+ki^{.}z/(z-1).

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

(z-kp)/(kp+ki))/[z-(1-T^{.}Kv/Jm))^{.}(z-1)].

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+k_{i}/k_{p}).

The linearized model predicts closed-loop poles that are well-damped for small k_{i}/k_{p} 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, k_{i}=3/2048, and k_{p}=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

Vout=16*(error-128)/255+3

(v_new-128)/255+3.

## 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 | |
---|---|

Model | Fuzzy PI |

Inputs | 2 |

Labels/input | 5 |

Outputs | 2 |

Labels/output | 5 |

Rules | 17 |

68HC11code bytes | 717 |

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 f_{com} 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.

References

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

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 |

Hot technologies: Looking ahead to 2017

Industrial IoT to gain traction in 2017

Non-invasive blood glucose monitoring using near-infrared spectroscopy

Equations and Impacts of Setup and Hold Time

Understanding SSD over-provisioning

Embedded Systems Architecture, Device Drivers - Part 1: Interrupt Handling

Low power wide-area networking alternatives for the IoT

Memory Hierarchy Design - Part 1. Basics of Memory Hierarchies

## Almost Done

Please confirm the information below before signing in.

{* #socialRegistrationForm *} {* firstName *} {* lastName *} {* displayName *} {* emailAddress *} {* addressCountry *} {* companyName *} {* ednembJobfunction *} {* jobFunctionOther *} {* ednembIndustry *} {* industryOther *}