# A current control method for improving the running quality of stepping motor

Basics of Bipolar Stepper Motors

The bipolar stepper motor consists of two windings. In order to make the motor run smoothly, a sine wave with a phase difference of 90 degrees is continuously applied to the two coils, and the stepper motor starts to rotate.

Typically, stepper motors are not driven by analog linear amplifiers; they are driven by PWM current regulation, which converts a linear sine wave signal into discrete line segments. A sine wave can be divided into multiple segments, and as the number of segments increases, the waveform becomes closer to a sine wave. In practical applications, the number of segments is mostly from 4 to 2048 or more, and most stepper driver ICs use 4 to 64 segment subdivisions. In full-step driving, only one phase is energized at each moment, and the two-phase current is alternated and the current direction is switched, resulting in a total of four mechanical states of the stepping motor. Half-step driving is relatively more complicated than full-step driving. At the same time, both phases may need to be energized, as shown in Figure 1, which doubles the step resolution of the motor. For subdivision drive, the angle that the motor rotor takes one step will decrease as the number of subdivisions increases, and the motor rotates more and more smoothly. For example, a 32-segment subdivision sequence is called one-eighth step drive mode (see figure 1).

Figure 1: Current waveform for subdivision drive.

The Importance of Current Control Accuracy

The position of the bipolar stepper motor rotor depends on the amount of current flowing through the two coil windings. Usually, the main indicator for selecting a stepper motor is accurate mechanical positioning or precise mechanical system speed control. Therefore, the precise control of the winding current is very important for the smooth operation of the stepper motor.

In mechanical systems, two problems can lead to inaccurate current control:

In the case of low-speed operation or using a stepper motor for positioning control, the number of steps of each sub-segment motor is wrong, resulting in wrong positioning.

Under high-speed operation, the nonlinearity of the system will lead to short-term motor speed changes, resulting in unstable torque and increased motor noise and vibration.

PWM Control and Current Decay Mode (Decay Mode)

Most stepper motor driver ICs rely on the inductance characteristics of the stepper motor windings to achieve PWM current regulation. Through the H-bridge circuit composed of the power MOSFET corresponding to each winding, as the PWM control starts, the power supply voltage is applied to the motor winding, thereby generating the drive current. Once the current reaches the set value, the H-bridge switches control states so that the output current decays. After a certain fixed time, a new PWM cycle starts again, and the H-bridge generates coil current again.

This process is repeated to make the winding current rise and fall. Through current sampling and state control, the peak current value of each segment can be adjusted and controlled.

After the expected peak current is reached, there are two ways to control the current decay of the H-bridge drive windings:

The winding is short-circuited (the low-side or high-side MOSFETs are turned on at the same time), and the current decays slowly.

The H-bridge conducts reversely, or allows current to flow through the body diode of the MOSFET, and the current decays quickly.

These two current decay modes are called slow decay and fast decay (see Figure 2).

Figure 2: H-bridge working state.

Since the motor windings are inductive, the rate of change of current depends on the applied voltage and coil inductance. For a stepper motor to run fast, it is ideal to be able to control the drive current to vary within a short period of time. Unfortunately, the motion of the motor generates a voltage that is opposite to the applied voltage, opposing the tendency of the current to change, called “back EMF”. Therefore, the faster the motor rotates, the greater the back electromotive force. Under its action, the phase current of the motor decreases as the speed increases, resulting in a smaller torque. To alleviate these problems, either increase the drive voltage or reduce the motor winding inductance. Lowering the inductance means winding with fewer turns, requiring higher current to achieve the same field strength and torque.

Problems with traditional peak current control

Traditional stepper motor peak current control usually only detects the peak current through the coil. When the expected peak current is reached, the H-bridge switches on, causing the output current to decay (fast decay, slow decay, or a combination of the two) for a fixed amount of time, or until a PWM cycle ends. When the current decays, the driver IC cannot detect the output current, causing some problems.

Generally speaking, it is best to use slow decay, which can get smaller current ripple, and the average current can track the peak current more accurately. However, as the step rate increases, the slow decay cannot reduce the winding current in time to ensure accurate current regulation.

In order to prevent the switching current spike from being sampled, at the beginning of each PWM cycle, there is a very short time (blanking time) where the winding current is not sampled, and the current is uncontrolled at this time. This results in severe current waveform distortion and unstable motor operation (see Figure 3).

Figure 3: Current distortion in slow decay mode.

After the sine wave reaches the peak value, the current begins to decay and then increases, and the current continues to decay toward zero until the H-bridge works in a high-impedance state.

In order to avoid this situation, many stepper motor driver chips use slow decay mode when the current amplitude increases, and fast decay or mixed decay (combined fast decay and slow decay) mode when the current amplitude decreases. However, the average currents of these two decay modes are completely different, because the current ripple in the fast decay mode is relatively much larger. As a result, the average current values ​​in the two modes are very different, causing the motor to run erratically (see Figure 4).

Figure 4: Waveforms under conventional peak current control

As shown in the waveform in Figure 4, the motor step of the step after the peak current is different from that of the previous step, which will cause position error and change in instantaneous speed. When the current crosses zero, there will be the same problem because of the switching between the two decay modes.

Bidirectional Current Sampling

In the traditional stepping drive, an external detection resistor is connected between the lower tube source of each H-bridge and the ground, and only the forward voltage on the detection resistor is measured when the PWM is turned on. In slow decay mode, current circulates through the internal MOSFET and not through the sense resistor, so current cannot be measured. In fast decay mode, the current through the resistor reverses, resulting in a negative voltage. For the current power IC process, negative voltage is difficult to be handled by simple sampling.

Many stepper motor drive current regulation problems can be solved if we can monitor the winding current during the current decay period. However, it is difficult to achieve with an external sense resistor as mentioned above, a better option is to try internal current sensing. Internal current sensing allows monitoring of current at any time, such as PWM on-time, and during fast and slow decay. Although it increases the complexity of the driver IC, the internal current sensing greatly reduces the system cost because the external sampling resistor is not required. These resistors are very large and expensive, usually about the same price as a driver IC!

MP6500 stepper driver IC

MP6500 bipolar stepper motor driver chip, integrated with internal current detection, is a good substitute for the traditional low-cost peak current control bipolar stepper motor driver IC. The internal circuit block diagram of MP6500 is shown in Figure 5.

Figure 5: MP6500 circuit block diagram.

The MP6500 has a maximum drive current of 2.5A peak (depending on package and PCB design); supply voltage ranges from 4.5V to 35V. Support full-step, half-step, quarter-step, and eighth-step drive modes. No external current sense resistor is required, just a small, low-power resistor to ground to set the peak winding current.

The internal current detection relies on the accurate matching design of the power tube and related circuits, which can ensure that the winding current is always accurately sampled, thereby improving the running quality of the stepper motor.

Normally, MP6500 works in slow decay mode. However, when a fixed off-time expires and the slow decay ends, if the current winding current is still higher than the expected level, the fast decay mode is turned on to rapidly reduce the drive current to the desired value. This hybrid control mode makes the drive current drop to zero quickly, while keeping the average current as close to the set value as possible. When the step jumps, fast decay is used so that the current current is quickly adjusted to zero, as shown in Figure 6.

Figure 6: Automatic decay mode of MP6500 (when step jumps).

If the supply voltage is high, the inductance value is low, or the required peak current magnitude is low, the current is likely to be higher than the set value. Due to blanking time, each PWM cycle has a minimum on-time at which many conventional stepper motor drivers cannot control the winding current. If this happens, the MP6500 will continuously use fast decay mode to ensure that the winding current never exceeds the set value (see Figure 7).

Figure 7: MP6500 auto decay mode (at low current).

This adaptive decay mode has less variation in average current than using only the slow decay mode. Since the fast decay mode is only used to control the drive current below the set value, the error is much smaller than using the fast decay mode during the entire PWM off time.

The advantage of this control method is that for different motor and supply voltages, the user does not need to make any system adjustments, and the decay mode is fully automatic. For traditional stepper motor drives, for different applications, the decay mode and even the PWM turn-off time must be adjusted to obtain the best running quality.

Using this method of current regulation, the MP6500 can ensure that the average winding current is accurate and stable throughout the cycle (see Figure 8), significantly improving the quality of motor operation.

Figure 8: MP6500 output current waveform

Motor running quality measurement

It is often difficult to accurately quantify the running quality of stepper motors. Usually, relative position, noise and vibration are judged by human eyes, ears and hands. It is difficult for these methods to precisely measure the positional accuracy of each subdivision segment. For a stepping motor with a step angle of 1.8°, the rotation angle corresponding to every eighth step is 0.225°, which is very small. When the motor is moving, the easier test method is time domain measurement, and the positioning error will be converted into a change in speed. The change in speed over time can be measured with an oscilloscope. To make these measurements, the test equipment requires a high-resolution optical encoder and magnetic powder brakes assembled with the stepper motor bracket.

The stepper motor selected is a typical motor used for the XY displacement platform of small industrial equipment or 3D printers: a 1.8° step angle NEMA 23 stepper motor, an inductance of 2.5mh, and a rated current of 2.8A.

For running quality measurement, a frequency-to-voltage converter (Coco Research KAZ-723) is also required to process the output signal of the photoelectric encoder, which can be analyzed and processed on an oscilloscope and spectrum analyzer after being converted into a voltage signal. This voltage signal represents the constantly updated motor speed in real time.

The test equipment is shown in Figure 9 and Figure 10.

Figure 9: Motor test bench.

Figure 10: The kaz-723 frequency to voltage converter.

In order to detect the operation of the entire test system and understand the inherent defects of the motor and test device used, a sine wave current with a phase difference of 90 degrees is applied to the two coils of the motor. The two-phase current and the voltage signal representing the motor speed are shown in Figure 11.

The output of the frequency-to-voltage converter shows that the change in the instantaneous speed of the motor is periodic and synchronized with the drive current waveform. This speed change is most likely due to imperfections in the motor’s own magnetic field and mechanical construction, and may also be partly due to the encoder, test frame, or harmonic distortion components of the drive current.

Figure 11, then, is the ideal running result for this motor under this test setup, although we can further improve the running quality by pre-adjusting the drive waveform to compensate for problems caused by the motor structure.

Figure 11: Simulation of current-driven motor operation measurements.

Next, the motor was driven with a commercially available bipolar stepper driver under the same setup and test conditions, with conventional peak current control and the use of an external sense resistor. The driver uses a slow decay mode when the current increases, and a mixed decay mode when the current decreases.

The threshold setting of the mixed decay mode is optimized as much as possible, so that the working time of the slow decay mode is as long as possible, and at the same time, when the current amplitude decreases to zero, the desired ideal waveform can always be tracked. In this way, the PWM current ripple can be reduced as much as possible, that is, the variation of the speed can be reduced as much as possible.

As shown in Figure 12, with this conventional stepper driver chip, the change in speed is three times that of analog sine and cosine wave current drives. This means that motor noise, vibration, and positioning errors all increase.

Figure 12: Motor running quality under traditional control regulation scheme.

The MPS MP6500 stepping driver integrated chip adopts internal current sampling and the above-mentioned automatic decay current adjustment scheme, which can achieve better motor running quality. As shown in Figure 13, although the speed change is not as small as the result of the simulated sine and cosine wave current drive, it is much better than the traditional drive scheme, making the motor run more smoothly and quietly, and the positioning is more accurate.

Figure 13: Motor running quality driven by MP6500

high speed operation

As we can see in Figure 3, at very high step rates, conventional current control techniques do not control the winding current well, potentially resulting in severe current waveform distortion. As the speed of the motor continues to increase, the back electromotive force will become larger and larger. Under its action, the phase current decreases with the increase of the speed, and the time for the current to decrease also decreases, resulting in a smaller torque or even a stall. The MP6500’s improved adaptive current control mode allows the motor to run at higher speeds than conventional solutions.

Figure 14 shows the test results of the continuous increase of the motor speed under the same test system using the traditional current control mode (the horizontal axis is time, and the vertical axis is speed). When the stall occurs, the speed measurement is around 8V, which equates to 480RPM.

Figure 14: Speed-up test of traditional control mode.

Using the same settings and winding currents, as shown in Figure 15, the MP6500 can drive significantly higher speeds thanks to a better adaptive current regulation control scheme. When the stall occurs, the speed measurement is around 10V, which is equivalent to 600RPM.

Figure 15: Speed-up test of MP6500.

in conclusion

Compared with the traditional stepping motor driver chip, MP6500 adopts an advanced adaptive current control scheme, which can significantly improve the running quality of the stepping motor while keeping the total system cost unchanged or lower. Using the test equipment described in this paper, we can quantitatively test and verify the improvement and enhancement of the running quality under this scheme.

Author: Yoyokuo