Improving motor performance

Mark Patrick, Mouser Electronics


Smarter algorithms create a better motion-control system

The stepper motor is a popular choice for intelligent precision motion control. Unlike a standard DC motor, which is designed for continuous rotation, the stepper motor provides the ability to rotate around an axis one step at a time. This makes the motor ideal for applications that call for precise positioning and speed control. However, to ensure that the motor control remains precise at all operating points for the application, it is important to tune the motor to the controller.

A typical stepper comprises a stator, a rotor attached to a shaft and a number of coil windings that are used to generate magnetic fields at fixed positions around the stator. In a permanent-magnet stepper motor, the rotor uses a disk made of magnetic materials. The disk may have just two poles. A more complex disk, generally used in precision motors, may interlace many poles around the outside of the disk. A variable-reluctance stepper motor is, in contrast, entirely electromagnetic.

When power is removed from the motor, it will not resist turning by external forces.

In a permanent-magnet motor, when power is applied to the motor, the rotor will seek the most stable position it can find. The electromagnetic field generated in the coil will attract one pole of the magnet formed on the rotor and repulse the other. When the nearest opposite pole on the disk aligns itself with the electromagnetic field generated by the coil, the rotor will stop and remain fixed in this position while the field in the coil remains unchanged. If the current flow in this coil is removed and applied to another at a different position, the magnets will be pulled to the next stable position where the rotor can again come to a stop.

Typically, a variable-reluctance motor uses a number of coils in the stator, arranged opposing pairs. A three-phase motor will have three such pairs. Providing energy to each pair of coils in turn moves the metallic rotor from step to step.

Because of mechanical limitations, the rotor can rotate on demand only up to a certain maximum speed. The torque of the motor will typically be maximized at low speeds. As a result, motors are often used at low speeds to provide maximum control and torque.

Resolution can be increased through the use of microstepping. In normal operation, the current from one coil is not removed completely before activating the next. Instead, the current is reduced in one while the current in the other is increased. If this sharing of current is controlled across the two coils the situation creates smaller virtual steps than trying to drive the motor using discrete current transitions.

In principle, two sinusoidal signals, one shifted in phase by 90° from the other, can create smooth continuous motion. In practice, the waveforms are not entirely sinusoidal – the current level for the coil in each position has a discrete level. Microstepping in this way creates smoother motion and can help reduce noise and vibration in the motor compared to shifting between full steps. However, precise current control to the motor is important to maintain precise control, particularly at low speeds falls because it is possible for the motor to miss microsteps unexpectedly (see Figure 1).

Click image to enlarge

Figure 1: Pair of stepped sinusoidal waveforms for controlled microstepping

The specific current levels are normally generated using pulsewidth modulation (PWM) chopping techniques. A H-bridge of two pairs of power transistors delivers the chopped current to the motor coils. Typically, the drive current is normally interrupted when the chopped current reaches the threshold for that microstep. After this point, the current will begin to decay. The profile of that decay will depend on the operation of the H-bridge (see Figure 2).

Click image to enlarge

Figure 2a: H-bridge current flow for fast decay mode (Image courtesy of Texas Instruments)

Click image to enlarge

Figure 2b: H-bridge current flow for slow decay mode (Image courtesy of Texas Instruments)

With slow decay, current is recirculated using both low-side power transistors. The drawback of this mode is that the slow decay can limit the amount of current that needs to be regulated to drive the motor. Fast decay uses the H-bridge to reverse the voltage across the coil winding, which causes the current to fall off at a fast rate. However, this can lead to large ripple currents that hampers efficiency and may be unsuitable for large current levels that may be needed by the motor being driven (see Figure 3).

Click image to enlarge

Figure 3: Current decay in slow, fast and mixed modes (Image courtesy of Texas Instruments)

Mixed decay combines the two decay modes. It begins with a fast decay before switching, after a fixed time, to the slow decay mode. This does allow for most microstepping situations but demands the control algorithm be optimized for the specific motor being used. The tuning depends on the magnitude of load current, supply voltage and stepping rate. Usually, lower load currents call for a different mix of fast and slow decay compared to higher load currents.

Traditionally, the best scheme is picked by cycling through the fixed-decay ratios and observing the current profile on an oscilloscope for a given microstepping sequence. The key problem with fixed decay schemes is that they do not react to changes in conditions. Parameters can vary in operation, such as the back electromotive force (EMF) and the microstepping rate that affect current and voltage levels dynamically. 

Optimizing for a high step rate, which is usually achieved through the application of a higher ratio of fast to slow decay, can lead to excessive ripple in current when the motor is holding steps or moving slowly through them. If the system is battery powered, the voltage supplied by the cell will decline as its charge is depleted, which if not regulated will lead to different voltage conditions being applied to the motor. And, as the motor ages, the initial decay profile may prove to become increasingly unsuitable.

The answer is to adopt algorithms that adapt to changing conditions in the motor. The stepping commands and the PWM behavior can provide as guides to where to set the decay changeover point on a per-step basis. On each PWM cycle, the controller will switch the H-bridge over at a given point. Adaptive tuning remembers the timing of this switch and uses it to determine the fast-slow decay ratio for the following step.

By monitoring the step commands – taking notice of whether the motor is moving quickly or not – the percentage of fast decay can be increased and decreased according to the motor’s demand. As the motor slows down, the amount of fast decay can be scaled back.

Such algorithms can be incorporated into microcontroller firmware but are also available in off-the-shelf stepper-motor controllers such as the Texas Instruments DRV8846. The adaptive-decay scheme used in the DRV8846 compensates automatically for supply voltage, load inductance, load resistance, back EMF and the current magnitude.

Through the use of adaptive decay, the DRV8846 no longer needs the control pins that would normally be used to set the decay ratio, which helps save on package cost. Further, the algorithm is designed such that it uses slow decay as much as possible, which results in a more power-efficient design. This is because the current is flowing through the low-side power transistors only, which is typically more efficient than switching the H-bridge into a reverse configuration.

A strategy employed by another device with adaptive decay control, the STMicroelectronics L6472, is to monitor the PWM switchover signal on rising and falling steps to determine whether it happens before or after a set minimum on each microstep. If the target current threshold is reached before that minimum time, a fast decay is used in place of the normal slow decay up to a point determined by a programmed maximum fast-decay time. If two fast decays are encountered during a series of rising steps, the algorithm will continue to inject them until the motor stops or the sine wave zero is crossed.

On falling steps, the algorithm in the L6472 will, at first, use fast decay rather than slow to reach the target level as quickly as possible. But, to avoid strong ripple currents forming, the algorithm will adjust over time to increase the fast-decay threshold which will lead to moving into slow-decay mode unless the current demand changes enough to demand fast decay. The result is a continuous balancing of the fact and slow decay modes.

Thanks to more intelligent methods for applying current decay to stepper motor coils, it is possible to take advantage of the smoother motion profile of microstepping and ensure that the motor responds well to changes in voltage, operating conditions and even ageing.

Mouser Electronics