Blog Signal Chain Basics

Tips and tricks for testing and debugging stepper motors

The first installment of this two-part series focused on debugging brushed-DC motor systems. Now the second installment will share some tips for stepper motor systems and provide general bench testing advice based on authors’ personal experience.

Let’s begin with setting up bench for stepper testing.

  1. Setting up bench for stepper testing

The first installment of this article series recommended two actions when setting up bench testing equipment for brushed-DC motors. The same recommendations also apply to stepper motors.

  • Get a current probe. As we’ll discuss later in the article, using a current probe can help debug sources of audible noise in stepper motors. Remember to degauss and zero the probe to ensure the correct current measurement.
  • Use a bench supply that can source enough current. The current limit on the bench supply may clamp the supply-rail voltage when trying to drive large motor currents. Be sure to select a supply and set the current limit high enough for the motor under test.
  1. Identifying stepper phases without a DMM

This tip comes from our now-retired colleague Rick Duncan. He was a genius at debugging motor drivers, and he taught us many of the concepts in this article.

When running a quick test on a bipolar stepper driver, let’s say that you find a random stepper motor in the lab. The motor datasheet may not be available, and the motor leads may not be marked. Using a digital multimeter (DMM) to measure resistance or check continuity is one way to identify which terminals belong to the same phase winding.

However, using Duncan’s shortcut, shorting two stepper leads belonging to the same phase winding will make the rotor difficult to spin by hand. In Figure 1, co-author Lockridge shorts the red and blue wires with the left hand while spinning the rotor of the stepper motor with the right hand. If the two leads belonging to different phase windings short together, the motor will be as easy to spin when the leads are not shorted.

Figure 1 Stepper motor being used for phase winding identification. Source: Texas Instruments

Table 1 summarizes the results of this procedure for each combination of motor leads shorted together.

Table 1 Test matrix compares Duncan’s trick using DMM measurements. Source: Texas Instruments

By checking which combinations of shorted wires make the motor difficult to spin, you can identify the phase windings without a DMM. In this case, the red and blue wires belong to one phase, and the green and black wires belong to the other phase.

This trick is also an excellent demonstration of two interesting concepts: Lenz’s law and detent torque. When the terminals of a phase winding are shorted, Lenz’s law causes the braking torque due to the back electromotive force (EMF) generating a current in the phase winding as the rotor spins. When the phases are not shorted, the motor detent torque feels like light pulses as the rotor turns. Detent torque is an attractive force created by the permanent magnet, which attracts the teeth on the rotor to the stator teeth (Figure 2).

Figure 2 Anatomy of a stepper motor highlights rotor and stator teeth. Source: Texas Instruments

  1. Familiarize with proper stepper motor current profiles

Figure 3 shows a typical waveform for the current in one phase winding of a hybrid bipolar stepper motor when using one-eighth microstepping. Most stepper drivers use a current regulation scheme to achieve microstepping for greater precision and lower noise when driving a stepper motor. Microstepping schemes approximate a sinusoid by regulating current at discrete step levels.

Figure 3 Scope shot of current shown in one phase of a stepper motor. Source: Texas Instruments

Stepper motors don’t experience inrush current at motor startup, nor does the current increase during a stall condition in the same way as a brushed-DC motor. That is because stepper motors don’t contain a mechanical commutator like brushed-DC motors, and the back EMF is sinusoidal because of the motor’s construction. Instead, stepper motors need electrical commutation by energizing the two-phase windings with periodic current waveforms that are 90 degrees different in their phase angles.

When using full stepping, the phase currents resemble square waves. When microstepping, the phase currents resemble sinusoids, as shown in Figure 3. Most integrated stepper drivers use current regulation schemes for both full stepping and microstepping.

  1. Current regulation schemes in stepper motors

Looking for distortions in the current waveform is the first step when debugging stepper motors. Many times, changing the decay mode or other settings can reduce audible noise and improve the quality of the current waveform. Figure 4, Figure 5 and Figure 6 show distorted stepper current waveforms compared to Figure 3.

Figure 4 Too much fast decay percentage in the current regulation scheme causes large ripple currents. Source: Texas Instruments

Figure 5 Significant back EMF distorts the waveform when the current decreases, using slow decay only. Source: Texas Instruments

Figure 6 The blanking time for slow decay is too long, so the motor coils charge faster than the driver can regulate the current. Source: Texas Instruments

Many factors can cause audible noise in stepper motors. Sometimes, the step rate may be at the resonant frequency of the mechanical system, which makes noise worse. Other factors may be caused by the current regulation scheme—also known as the decay mode—and the microstep size because smaller is quieter.

Figure 7 is a mind map to help you visualize how these factors may combine to produce acoustic noise in stepper motors. An application report titled “How to Reduce Audible Noise in Stepper Motors” addresses audible noise in greater detail.

Figure 7 A mind map helps engineers visualize major factors while debugging audible noise in stepper motors. Source: Texas Instruments

  1. Motor-driver fault reporting

Undervoltage lockout, overcurrent protection and overtemperature shutdown are common motor-driver protection features for both brushed-DC and stepper motor drivers. When debugging a motor system, these features may help indicate the cause of a particular issue.

  • Undervoltage lockout may trigger when the motor driver supply rail voltage drops from series impedance in the power supply or routing, not enough decoupling or bulk capacitance, bench supply clamping, or poorly designed power circuitry.
  • Overcurrent protection may trigger if there is a short between the motor-driver outputs, or from one of the outputs to the supply or ground.
  • Overtemperature protection may trigger if the ambient temperature is too high or when the motor driver drives large currents for long periods.

Many motor drivers have a fault-reporting pin to signal when a fault occurs. When debugging, you can probe this pin to trigger a screenshot on the oscilloscope. If the motor driver does not have a fault-reporting pin, use an oscilloscope to check the driver’s supply and output pins. To identify the fault type, compare the oscilloscope’s behavior to the motor driver’s datasheet description of its protection features. As mentioned in the first installment, be sure to check both voltages and currents.

Some drivers may have additional protection features such as overvoltage protection and open-load detection. The driver datasheet will describe the behavior of these features.

  1. Armet’s bench testing tips

Here’s some general advice from co-author Armet on what to do and what not to do when trying to spin a brushed-DC or stepper motor on the bench.

  • Motors that are not mounted to anything can vibrate heavily and “jerk” when the motor accelerates or deaccelerates quickly. This is an example of Newton’s third law; while the rotor accelerates in one direction, the stator will experience an equal-and-opposite reaction torque that accelerates it in the opposite direction. Place the motor on top of a foam pad or any other soft material to minimize noise from the motor vibrating on a hard surface. To eliminate any jerky motions, restrain the motor with tape, clamps or a vice.
  • Add tape to the motor shaft—if there is no other load on the motor—to easily determine the motor’s spinning direction.
  • Place the motor on a heat-absorbing material such as a heatsink when driving high-power motors that can become very hot after long, continuous use.
  • Avoid connecting or disconnecting the motor from the board connector when the motor-driver outputs are enabled. Doing so can lead to visible sparking and potential damage to both the board and the motor. You might even get a burnt finger (talking from personal, painful experience).
  • Avoid rotating the motor shaft while the motor is connected to an unpowered motor driver. The motor will behave as a generator, potentially damaging the motor driver or the power supply with high currents or voltages.

Further debugging

These tips should be helpful when you are debugging motor drivers in your systems. For more motor-driver debugging tips, please check out the Motor Drivers forum.

Editor’s Note: Authors dedicate this article to Rick Duncan, who mentored them in their early days as applications engineers in TI’s Motor Drives team.

James Lockridge is system engineer in TI’s Motor Drives team.

Pablo Armet is applications engineer in TI’s Motor Drives team.

Related Content

0 comments on “Tips and tricks for testing and debugging stepper motors

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.