Jorge Zambada
Sr. Applications Engineer
Digital Signal Controller Div.
Microchip Technology Inc.
Chandler, Ariz.

Edited by Robert Repas

Sophisticated motor control is no longer the sole province of custom hardware and proprietary control techniques. Advances in powerful, low-cost digital-signal controllers (DSCs) let designers use advanced motor- control techniques. For example, power-factor correction (PFC) and field-oriented control (FOC) save energy and quiets rotating machinery.

Prior to the arrival of the digital- signal controllers, power factor correction and field-oriented control techniques required costly, custom-made applicationspecific ICs. Proprietary motorcontrol hardware was inflexible, lacking provisions for modifying it to better fit an application.

Older motor-control schemes relied on scalar motor control with power semiconductors. Scalar control varies a generated sinusoidal wave’s frequency along with its voltage. Feedback, when used, tracked only the coarsest and most rudimentary functions, such as motor speed. The control elements could not process data fast enough to measure direct parameters like instantaneous current in the motor windings.

Prior motor-control drives with advanced algorithms, such as those for field-oriented control, contained costly digital-signal processors (DSPs). The high-current MOSFETs and other powersemiconductor devices made the drives physically bulky.

Though the latest motor drives still need MOSFETs and IGBTs, they are much more compact and efficient. More significantly, new motor drives use the DSC’s built-in logic and control capacity, eliminating the expense and installation of additional components. This resulted in smaller, lessexpensive drives that consumed little electrical power, yet had the speed and processing power to perform more advanced control functions.

Permanent-magnet synchronous motors (PMSMs) with dynamic response react quickly to speed changes, such as switching between agitation and spin in front-loading washing machines. Sensorless FOC algorithms controlling PMSMs appear to provide such responses with greater efficiency than scalar control on standard induction motors. Controlling stator current by FOC also reduces torque ripple for quieter motor operation.

Digital-signal controllers contain interfaces tailored for motor control, such as pulse-width modulators (PWMs), analog-to-digital converters (ADCs), and quadrature- encoder inputs. Most of their instructions execute in a single clock cycle for fast response times. The combination permits software-based digital filters and improves event response times without the need for additional hardware.

Some analog-to-digital converters in DSCs convert input samples at rates up to 1 million samples/sec while handling four simultaneous inputs. The high sample rate is crucial for current sensing in motor controllers. The only additional component needs are inexpensive sensing resistors to measure motor-phase-winding currents.

Admittedly, DSCs are overkill in some low-end applications that do not require high performance. When compared to motor control with application-specific ICs and 8-bit MCUs with custom motor controls, DSCs have complex peripherals that would appear to make design cycles longer and raise costs. Engineers may feel forced to invest in high-level-language development tools, such as C compilers and other mathematical software libraries, adding to initial development costs. They may find it hard to justify these additional costs when simpler control techniques will suffice.

On the other hand, there are many areas where DSCs have major advantages over the “blackbox” ASIC approach. These include both sensored and sensorless motor control in appliances, fuel pumps and power steering in cars and trucks, and high-speed servos in automation and robotics. In all of these, motors need high-speed response under varying loads.

DSCs can shut down PWMs in case of catastrophic faults signaled via digital inputs. European customers can use a DSC-based active powerfactor correction (PFC) to meet that continent’s stringent energy regulations. The only additional component s ne ede d for PFC are an inductor, power switch, and a diode. ADCs on the DSC measure current and voltage from the dc power bus. Based on these inputs, the DSC adjusts the power switch through a PWM module via a PID control loop that keeps power factor close to unity. Without the already present DSC, PFC requires an extra ASIC or many additional components.

How FOC works
FOC of permanent-magnet synchronous motors starts by measuring two of three phase currents, ia and ib. Only two current sensors are needed as third phase current is calculated from ia + ib + ic = 0. The Clarke Transform converts three-phase currents onto a two-axis plot to create variables Iα and Iβ. As viewed from the perspective of the stator, Iα and Iβ are time-varying quadrature-current values.

The two-axis plot is rotated to align with the rotor flux using transformation angle θ. Angle θ is calculated during the last iteration of the control loop. This conversion provides id and iq variables from Iα and Iβ. The Park Transform aligns quadrature currents id and iq with the rotating plot. Both id and iq remain constant during steady-state conditions.

Id, iq and the reference values for each generate error signals. The id reference controls rotormagnetizing flux while the iq reference governs motor torque output. These error signals are fed to proportional-integral (PI) controllers whose outputs are sent to the motor as voltage vectors Vd and Vq.

Vd and Vq are rotated back into the stationary reference frame using the transformation angle to obtain quadrature voltage values, Vα and Vβ. Vα and Vβ are then mathematically transformed back into three phase-voltages Va, Vb, and Vc, which determine the new PWM duty-cycle.

The new coordinate transformation angle is then estimated using Vα, Vβ, Iα, and Iβ as inputs. The new commutation angle guides the FOC algorithm in placing the next voltage vector.

Of course, to determine the required phase voltages it’s necessary to know the current position of the rotor relative to the three phase windings. An encoder or resolver could supply that information, but at added cost and complexity. However, you can estimate the rotor position using motor currents and voltages.

The position estimator starts with a mathematical model to measure motor position indirectly with an observer. Motor position is estimated by assuming the PMSM model is the same as that of a dc motor. The model consists of a series circuit containing the winding resistance, R, winding inductance, L, and the back-EMF, e. Input voltage, vs, is obtained using:

vs = Ris + L(d/dt)is + es

Solving for the change in motor current, is, gives:

(d/dt)is = (1/L)(vs - es) - (R/L)is

In both equations, vs = input voltage and es = back-EMF vector.

Current observers indirectly measure back-EMF by ensuring the input to the motor and model are equal. When the motor and its model are fed the same input, the model’s closed-loop controller ensures the estimated value matches the measured value. A sliding-mode controller tracks the input reference and forces the error to zero, correcting the model to make it more accurate.

Depending on the error’s sign, the slide-mode controller applies positive or negative feedback gain, K, to get the estimated current to match measured current. Once estimated and measured currents match, and input voltages are the same for the motor and its model, the motor back-EMF is calculated by solving for es. The input currents and voltages then match between the model and actual motor, the model’s correction factor, z, can be filtered to determine the model’s back-EMF.

The FOC algorithm is made up of three operational states: motor stopped; open-loop FOC; and sensorless FOC. When the start button is pressed, the algorithm first enters the initialization state, where variables are set to initial values.

To accurately estimate rotor position, the motor must run at a minimum speed to return a useful back-EMF value. An open-loop start-up procedure helps get the motor up to minimum speed. At motor start-up, sinusoidal voltages from the DSC spin the rotor. Current components for torque (iq) and flux production (id) are manipulated by the FOC based on the model only because there is not enough back-EMF at this point. Current components id and iq are controlled during motor start-up to keep torque constant. The start-up procedure accelerates the rotor by using an internal ramp function to increment angle θ every control cycle until the motor reaches minimum speed.

Once at minimum speed, the speed controller is added to the execution thread and the algorithm switches over to sensorless FOC operation. Here the desired speed is continuously read from an external voltage reference to set motor rpm. Fault inputs, as well as the start/stop button, are monitored continuously. Any fault in the controller stops the motor and returns the algorithm to the “Motor Stopped” state.

Many vendors offer FOC algorithms for free. Usually the source code is downloadable from the Web or comes packaged with a motor-control development board. Graphical-user interfaces in some development software present operation feedback for quick analysis and let engineers quickly change program variables for testing.

Make Contact
Microchip Technology Inc.,
(480) 792-7200, microchip.com

 

The Data Monitor and Control Interface tool from Microchip Technology displays torque, flux, and speed under FOC. The DMCI shows application feedback graphically for quick analysis and lets engineers dynamically change program variables for testing.

 

A digital-signal controller (DSC) contains all logic and measurement functions on a single chip for field-oriented control of permanent-magnet synchronous motors.

A digital-signal controller (DSC) contains all logic and measurement functions on a single chip for field-oriented control of permanent-magnet synchronous motors.

 

An overview of the FOC algorithm shows the three-phase voltage values being used to obtain a PWM duty-cycle that generates the desired voltage vector.

An overview of the FOC algorithm shows the three-phase voltage values being used to obtain a PWM duty-cycle that generates the desired voltage vector.

 

This state-machine diagram details the three operating states of an FOC algorithm for a PMSM.

This state-machine diagram details the three operating states of an FOC algorithm for a PMSM.