Magnetic energy is the invisible force that makes motors go, but software decides where they go and how they get there. Software, in the form of digital current loops, fieldoriented control functions, and estimation algorithms, is as essential to motors these days as copper, iron, and steel.

Whether the goal is positioning or variable-speed control, the software engine of choice for motors is a special type of chip called a digital signal processor. Although DSPs have been around less than 15 years, these speedy devices have nailed down a preeminent spot in motor control, handily beating out standard microprocessors and microcontrollers.

DSPs have the edge in motor control not because they’re manufactured with more care or made of a better grade of silicon; they just happen to be “wired” differently. While general-purpose processors do a myriad of things reasonably well, DSPs are geared specifically for math, particularly vector and matrix manipulations. In a single 20-nsec clock cycle, a DSP can multiply two numbers and add the result to a running total. This simple sequence – the core of most motor control algorithms – could take dozens of clock cycles on a general-purpose microprocessor.

DSPs have architectural advantages as well, facilitating data transfer both internally and externally. When integrated with motor-based I/O circuits, such chips not only perform multiply-and-accumulate operations in a single clock cycle, they can also actuate a motor control signal – say a pulse-width modulation (PWM) output – in the same period of time. And that’s not all.

DSPs are usually fast enough to execute more than the average motor control algorithm between sampling periods. This opens up all sorts of possibilities from model-based sensorless and anticipatory control to diagnostics, load modeling, and adaptive control.

Why DSP?

Control algorithms commonly used in variable-speed drives consist largely of transfer functions and state-space equations readily expressed as a set of vector calculations. These operations execute efficiently on digital signal processors, architected for digital filters and vector mathematics

A standard fixed-point DSP core has three independent computational units – an arithmetic logic unit (ALU), a multiply- and-accumulate unit (MAC), and a shifter. Each connects to two data memory buses and a results bus, which carry information (input) from data memory, program memory, and the output registers of the units themselves. By integrating this architecture with motor control I/O, the control algorithm results can be written directly to a peripheral, such as a PWM output, in a single DSP cycle – all with a minimum of coding.

In review, the most important feature distinguishing a DSP from a standard microcontroller is the single-cycle multiply and accumulate (MAC) function. A DSP with a 20-MHz clock, for example, can perform a 16 X 16-bit multiply and a 32- bit accumulation in only 50 nsec. Such a manipulation, when combined with program and data memory reads, forms the core of a digital filter algorithm.

Digital signal processors are also well suited for real-time control. For starters, they’re equipped to handle a number of interrupts from external signal sources. They can also perform context switches in a single instruction cycle with the help of “shadow” registers – independent arithmetic registers – on each arithmetic unit. This eliminates the need to save register contents when servicing an interrupt or calling a subroutine, conserving both program memory code space and execution time.

What goes in must come out

Controlling a variable-speed drive takes more than digital signal processing circuits. It also requires special I/O circuits that interface to power and motion components. At the very least, these peripheral functions should include a pulsewidth modulation generator and an analog- to-digital conversion system. Other peripherals required for real-time embedded control include parallel I/O blocks, serial communication interfaces, and watchdog and event timers.

PWM outputs provide the greatest flexibility in motor control because most low to medium-power ac motor control applications employ three-phase IGBT or MOSFET inverters. The power device switching signals are usually fixed-frequency PWM timing signals, ranging from a few kHz to tens of kHz.

Continue on Page 2

One of the challenges with motor signal acquisition is that the signals (current and voltage) must be sampled in synch with the PWM frequency. This limits potential a/d conversion techniques to successive approximation, sigma-delta, and integrating. In general, the required resolution is about 8 or 9 bits.

In addition to motor I/O, control circuits for variable-speed drives may also include user interface functions, especially in embedded applications such as washing machines or photocopiers. This calls for some general-purpose interface ports, including serial ports and at least one parallel port for expansion and communication.

Get real

The power of integrating a DSP core with motor control peripherals is best demonstrated in the context of an application. Consider a permanent-magnet motor running under sensorless control.

Getting rid of sensors, particularly Hall sensors, minimizes environmental constraints as well as manufacturing errors. One of the problems with Hall sensors is the precision with which they must be placed inside the motor. Any angular misalignment can cause torque ripple and imprecision. Sensorless control eliminates such concerns.

It also saves money. Synchronous motors require the stator field to lock in on rotor position. In a servo drive – which ordinarily incorporates a position sensor such as a Hall sensor, resolver, or encoder – this isn’t difficult to accomplish nor does it add cost. But many variable-speed drive applications cannot absorb the expense of a shaft-mounted sensor and the associated wiring and interface electronics.

This is where the processing power of a DSP really comes in handy, eliminating the need for position feedback devices, while still retaining the efficiency advantages of a permanentmagnet motor.

Permanent-magnet motors can run open loop given accurate electrical and mechanical models of the motor and load. The only information required is the magnitude and frequency of the applied voltage. If the load increases, the load angle and stator current will increase proportionally. As long as the motor currents can produce sufficient load and accelerating torque to cover these increases, the rotor will stay in synch with the rotating stator field.

The control method employed here is essentially a constant V/Hz scheme. Voltage is determined from the steady state motor model based on set speed and measured winding current.

Another task that the DSP performs is to transform the measured stator currents to a rotating reference frame (locked to the stator field). The resulting active and reactive current components are used to further optimize system performance.

Reactive current, for example, is used to drive a feedback loop that adjusts stator voltage, compensating for motor modeling errors. Active current, on the other hand, is used to fold back the maximum speed of the motor in the event of overload.

Improvements in safety and efficiency are practically guaranteed with DSPs.

Suppose our motor drives a reciprocating compressor subject to load torque disturbances. If the torque variations are of sufficient magnitude, they can produce a once-per-revolution position ripple (error) that can seriously degrade efficiency. The solution – assuming the load disturbance is predictable – is to leverage the DSP’s speed to synthesize a feed-forward signal that compensates for torque variations and other disturbances.

Aengus Murray is Systems Engineering Director and Paul Kettle is Software Engineering Manager for the Embedded Control Systems Group of Analog Devices Inc., Norwood, Mass.