Motor Control: Different Approaches and Options Are Available

By Jon Gabay

Contributed By Electronic Products

Embedded systems that interface to motors vary in requirements and complexity. Simple applications merely engage and disengage power and perhaps reverse polarity to reverse motor direction. In practice, however, very few designs are that simple. Instead, speed, acceleration, motor position, and sensing of load and torque are more typical requirements of modern designs.

Motors are inductive by nature, and they may react to sudden loads being engaged, different drive waveforms being applied, and unexpected higher current draws for gear issues or jam situations (like a paper jam in a printer).

Motor control platforms and kits including both MCUs and drivers are available to spin a wide variety of motor types, including AC induction motors (ACIMs), brushless (BLDCs), stepper, permanent magnet (PMSMs), universal, switched reluctance, and more. It should be noted that external drivers will be needed in almost every case since, typically, an MCU’s I/O lines just do not have the drive.

For all of these reasons, motor control carries with it special requirements that many other embedded designs do not. This includes the peripherals on chip to drive, switch, and meter power levels to the motor. Peripherals are also needed to sense motor conditions. This article looks at ways microcontrollers can interface to motors for precise control and motor status extraction. All parts, datasheets, tutorials, reference designs, and development kits discussed can be found on Digi-Key’s website.

Useful features

A motor can be driven and controlled by virtually any microcontroller; I/O, timers, A/Ds, and D/As are pretty standard and it is understood that you will be using external circuitry to do the heavy lifting. The MCU senses and controls very well under normal conditions. However, there are some nice features that micros can offer for motor control that propel them a step above standard functionality.

For example, in many applications, motors will be driven that are subject to varying loads and stresses. Current and strain gauge sensors can be used to see what the motor is up against. A microcontroller that offers an integrated analog comparator that can generate an interrupt if a threshold level is exceeded can respond a lot faster than a general-purpose MCU that is polling every so often using an A/D stage.

Another point is that a fast and resolute A/D stage is especially useful for monitoring and verifying normal operating conditions. Similarly, a good D/A stage (or PWM’s) can be important to variable-voltage drive motors, whose torque and speed can be directed by changing the drive voltage. Fast interrupt response times and wakeup times can be critical, too.

Once you have a reliable and robust drive and sense mechanism in place, it now becomes a filtering process to find the best micro for the job.

Meeting motor control requirements

Knowing the special needs of motor control, several MCU manufacturers combine specific features and functions to create application-specific motor control micros or micros that take aim at motor applications. Take the Atmel AVR® family, and specifically, the ATXMEGA16D4-MHR, which features Advanced Waveform extension (AWeX) functionality embedded within its timer/counters. It enables low- and high-side outputs with dead-time insertions as well as fault protection to shut down the external drivers very quickly when fault detect parameters are reached.

The use of the internal clock allows up to four or eight times more timing resolution than a standard peripheral clock, also helping detect possible circuit-killing faults before they do damage. Another nice motor control feature is the ability to generate synchronized bit patterns across the port pins. This aids in the synchronizing of several motors, or individual motors with time-dependent drives. For example, a printer may want to enable its inkjets at a specific time after a motor has moved into a very specific location.

Atmel also uses this part in an application note¹ showing how a 12 V, three-phase, sensor-less, field-oriented control (FOC) 8 pole, permanent magnet motor can be driven and controlled using a low-cost processor and USB bridge (Figure 1). A product training module introduction to the XMEGA® family can be found on the Digi-Key website.

Dedicated AVR micro

Figure 1: The dedicated AVR micro makes it simple to program and control three-phase motors from USB ports.

Zilog is another manufacturer who targets motor control directly with their Z16FMC series using the ZNEO™ CPU. Consider, for instance, the 16-bit Z16FMC64AG20SG which features an integrated analog comparator, OP-AMP, 12-source A/D, and flexible PWM stages. The on-chip debugger helps development. Standard functions such as watchdog, fault detection, brownout detection, and two different types of resets give programmers tools to do active fault recovery and management. Vectored interrupts and prioritization are also useful to reduce response times.

A particularly nice feature is the off-state fault fallback for polarity control of PWM state logic (Figure 2). It uses a master timer to generate the modulator’s time base and six independent compare registers to set PWMs for each output. A programmable dead time is inserted to assure that power transistors and H-Bridge drivers are never simultaneously driven with an overlapping waveform.

Zilog offers a training module on Z16FMC Motor Control on Digi-Key’s website.

Zilog motor control MCU

Figure 2: To meet integration and motor-specific requirements, this PWM stage inside the Zilog motor control MCU contains dedicated state logic for differential three-phase driving along with fault protect and dead-time logic.

The peripheral approach

Several semiconductor companies offer peripheral-style controllers for specific types of motors. The IXYS IXDP630PI takes overall responsibility for three-phase sinusoidal commutated brushless, induction, or AC servo types of motors. This replaces six discrete ICs that would otherwise be needed to implement this in logic.

Its key function is to insert the needed dead time between active switching times to guard against overlapping driving waveforms that can cause short-circuit conditions in H-Bridge designs. While it is also true that much of this logic and functionality has migrated to the I/O sections of a microcontroller, discrete and dedicated motor control ICs are still used.

Parts like the Microchip MTD6505T-E/NA are interesting. Here an embedded and dedicated little MCU is housed on the chip that implements the three-phase motor-interface circuitry (Figure 3). The tiny DFN 10-pin package is small enough to mount right near the motor, and the micro can digitally control speed and direction. While a three-phase H-Bridge is inside, it will need to drive more meaty power elements for bigger motors.

A dedicated micro and the interface and control circuitry

Figure 3: A dedicated micro and the interface and control circuitry for a sinusoidal three-phase sensorless and brushless motor are compactly housed in a 3 x 3 mm 10-pin DFN package.

A step in the right direction

Stepper motors are commonly used and have special needs that dedicated MCUs can target as well. Steppers can be very small and low power like buried motors used in dashboard gauges, or very large and current hungry, like those used in X-Y table plasma cutters. Higher voltage is needed to deliver higher levels of power.

For these applications, take a closer look at the Allegro A4915METTR-T, which can run with motors up to 50 V. Designed for PWM-driven current control for three-phase brushless DC motors, it includes six high-current N-channel power MOSFETs, and features a brake control system within its state logic (Figure 4). For more information, Digi-Key and Allegro provide a Product Training Module entitled Stepper Motor Control Using the A49xx Family.

State-machine-based three-phase stepper controller (click for full-size)

Figure 4: With a built-in charge pump and a brake control system, the state-machine-based three-phase stepper controller is driven by a parallel bus from a host processor.

A note about protection

There are many types of motors with unique characteristics and needs. Motors can be driven with DC or AC, use brushes or be brush-less, and can be of the stepper motor or pancake variety. In addition, the amount of drive power can vary from microwatts to Megawatts.

In all cases, when driving motors, the inductive nature of the motor’s coil windings can introduce spikes and high-voltage glitches. As previously mentioned, you will most likely be using driver devices like power transistors, relays, and H-Bridges to actually deliver power to the coil windings with a low-level logic signal to control the drive. Even though this provides one level of isolation, the motor’s response can leak back to the power supply and possibly glitch the MCU. While micro I/O lines feature intrinsic protection, they can easily be overwhelmed.

Engineers have several options here. You can use surge suppression devices, thyristors, transient voltage suppressors, and even gas discharge tubes to squelch the higher-voltage fly-back spikes. Another approach is to use optoisolators for a galvanically-isolated control link for non-linear driven motors.

In summary

Motor control can be managed like a high-end peripheral function, as well as directly driven by a microcontroller. General-purpose MCUs can take advantage of specialized motor drives and control ICs. On the other hand, some integrated MCU package solutions contain the special hardware logic needed to drive motors, and can control them pretty well. The bottom line is this: while your needs may vary, solutions are readily available.

For more information on the parts discussed in this article, use the links provided to access product pages on the Digi-Key website.

  1. Atmel AVR1636: Configurable PMSM Sensorless Field Oriented Control using the XMEGA

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Jon Gabay

About this publisher

Electronic Products

Electronic Products magazine and serves engineers and engineering managers responsible for designing electronic equipment and systems.