MENU

Improving current control for better stepper motor motion quality

Improving current control for better stepper motor motion quality

Technology News |
By eeNews Europe



Bipolar stepper motors are used in many applications, from driving paper through a printer to moving an XY stage in industrial equipment. Typically, the motors are driven and controlled by inexpensive and dedicated stepper motor driver ICs. Unfortunately, most of these ICs use a simple current control method that causes imperfections in the motor current waveforms and results in less-than-optimal motion quality. Implementing internal, bi-directional current sensing inside a stepper motor driver IC results in improved motion quality with lower system cost than legacy solutions.

Bipolar stepper motor basics
 
A bipolar stepper motor contains two windings. The motor is moved by driving varying currents sequentially through the two windings. To make the motor move smoothly, the two windings can be driven with sinusoidal currents that are 90° out of phase – sine and cosine.

Usually, steppers are not driven with analog linear amplifiers; they are driven using a PWM current-regulating driver with discrete current values that break the sine wave into straight segments.  This is called microstepping. The sine wave may be broken up into any number of segments, and the waveform approaches a true sine wave as the number of segments increases.  In practice, the number of segments varies from 4 to 2048 or more, with most IC stepper drivers implementing between 4 and 64 segments.  Since one sine wave generates four steps (mechanical states in a stepper motor), a 64-segment sequence is called a ⅛ step operation (see Figure 1).


Figure 1: Microstepping Current Waveforms

Why current-control accuracy is important

The position of a bipolar stepper motor’s rotor is dependent on the magnitude of the currents flowing thorough the two windings. Normally, if a stepper motor is being used, there is a requirement for accurate mechanical positioning or accurate speed control of some mechanical system. So it is only logical that the accuracy of the motion is determined in part by the accuracy of the winding currents being used to drive the motor.

There are two problems that inaccurate current control causes in the mechanical system:

  • At slow speeds or when a stepper motor is used in a positioning application, the motor steps a different amount at each microstep.  This causes an error in positioning.
  • At higher speeds, the nonlinearities cause short-term speed variations within a single rotation of the motor. This adds undesired components to the torque that increase noise and vibration of the motor.

PWM and decay modes

Most stepper motor driver ICs rely on the inductive nature of the stepper motor windings to implement PWM current regulation. Using an H-bridge arrangement of power MOSFETs for each winding, the supply voltage is applied to the winding at the beginning of a PWM cycle, causing the current to build through the inductance of the winding. Once the current reaches the desired level, the H-bridge changes state to reverse the current buildup.  After a fixed period of time, a new PWM cycle begins, and the H-bridge drives current through the winding again.  

This process is repeated, so the winding current goes up and down with the peak current programmed by a state machine and a DAC that sets the desired current for each segment.  When the state machine advances to the next segment, the regulated peak current changes accordingly.

After the desired peak current is reached, the H-bridge can drive the winding current down in one of two ways:

  • If the winding is short-circuited (by turning on both low-side or both high-side MOSFETs), the current will decay slowly.
  • If the H-bridge is reversed or if the current is allowed to re-circulate through the MOSFET body diodes, the current will decay quickly. 

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

Figure 2: H-Bridge States

Since the motor winding is an inductor, the rate at which the current changes is proportional to the applied voltage and its inductance. To move a stepper motor quickly, it is desirable to be able to drive the current changes in a very short period of time. Unfortunately, there is another factor that works against the changes in current. When the motor is in motion, a voltage is induced in opposition to the current – the back EMF.  This back EMF effectively reduces the voltage available to increase the current in the windings, so the faster the motor turns, the longer it takes to force a change in the current through a winding.

To mitigate these problems, either the driving voltage must be increased, or the motor inductance must be decreased.  Since a lower inductance means fewer turns of wire on the windings, it also means a higher current is needed to attain the same magnetic field to achieve the same torque.

The problem with conventional peak current control

Conventional peak current control stepper motor drivers rely on detecting peak current only while driving current through the winding.  After the peak current is reached, a decay mode (fast decay, slow decay, or a combination of the two) is entered either for a fixed period of time or until the end of a fixed PWM period.  During the decay time, the driver IC is blind to what the current is doing.  This can cause several problems.

In general, it is desirable to use slow decay since it causes much less current ripple and allows the average current to track more accurately the peak current.  However, as the step rate increases, slow decay is not able to lower the current through the winding fast enough to maintain accurate current regulation.

To prevent falsely sensing the current spike that occurs at the beginning of a PWM cycle due to winding capacitance, there is always a short blanking period during which the current level is ignored. The fact that the winding is always driven during this blanking time can cause the current to actually increase out of control. This results in severe current waveform distortions and poor motion quality (see Figure 3).
    

Figure 3: Current Distortion in Slow Decay Mode

After the peak of the sine wave, the current starts towards zero at first, then increases until the H-bridge is tri-stated during the zero-current segment.

To avoid this situation, many stepper motor driver ICs implement schemes where slow decay is used only as the current is driven away from zero and use fast or mixed decay (a combination of fast and slow decay) to drive the current towards zero.  However, the average current regulated with slow decay and fast decay is quite different due to the increased current ripple in fast decay mode.  This results in errors in the average current level and poorer motion quality (see Figure 4).

Figure 4: Conventional Current Regulation Waveform

In the waveform above, the motor will move more in the step after the peak current than in the step before the peak current. This results in a position error and instantaneous speed variation. A similar jump happens as the current waveform crosses zero.

Sensing bi-directional current

Conventional stepper drivers, which use an external sense resistor connected between the bottom of each H-bridge and ground, only measure the current during the PWM on time when the sense voltage is positive. During slow decay, the current recirculates through the H-bridge and does not pass through the sense resistor, so the current cannot be measured. During fast decay, the current through the resistor is reversed, generating a negative voltage. In most power IC processes, it is difficult or expensive to make use of this negative voltage.

Many of the current regulation problems in stepper motor drivers can be improved if we monitor the current during the decay period in addition to the PWM on time. However, this can be difficult when measuring current with an external sense resistor.

A better option is to sense the current though the H-bridge internally instead of using an external sense resistor. Internal current sensing allows for monitoring of the current at all times, such as during the PWM on time, as well as during both fast and slow decay.  Even though it adds complexity to the driver IC, internal current sensing can actually lower the system cost since external low-ohm sense resistors are not needed.  These resistors are physically large and quite expensive – two of these resistors can cost as much as the driver IC!

The MP6500 stepper driver IC

The MP6500 bipolar stepper motor driver with internal current sensing is designed to replace typical, inexpensive, peak-current-control, bipolar, stepper motor drivers. A block diagram of the MP6500 is shown in Figure 5.

Figure 5: MP6500 Block Diagram

The MP6500 can drive peak currents of up to 2.5A (depending on package and PCB design) at supply voltages ranging from 4.5V to 35V.  It supports step modes from full-step up to ⅛-step.

There are no external current sensing resistors. The peak motor winding current is set with a small, low-power, programming resistor connected to ground.

Internal current sensing relies on accurately matched FETs and associated circuitry.  Having the ability to always sense the winding current allows for a much more intelligent current regulation scheme. This is the key to improving stepper motor motion quality.

Normally, the MP6500 operates in slow decay mode. However, at the end of a fixed off time in slow decay, if the current is still above the desired level, fast decay is used to drive the current down to the desired regulation level, at which point slow decay is entered again for another fixed period of time.  This allows the current to be driven toward zero very quickly while keeping the average current close to the desired level.

As a result of a step-pulse input, fast decay is needed frequently when the current must be driven toward zero. The waveform below in Figure 6 shows how the MP6500 reacts to a step input that commands a decrease in current.

 

Figure 6: MP6500 Automatic Decay during Step Transition

In cases where the supply voltage is high, the inductance is low, or the desired current regulation level is very low, it is possible that the current will increase significantly above the desired regulation level. This occurs during the blanking time, which results in a minimum PWM on time at the beginning of the PWM cycle. This causes many legacy stepper motor drivers to lose control of the winding current. In the MP6500, if this occurs, fast decay cycles are used to drive the current below the desired level (see Figure 7).

Figure 7: MP6500 Auto-Decay at Low Current

There is still a small shift in the average current compared to regulation using only slow decay. Since fast decay is used only long enough to drive the current below the desired level, the error is much less than if fast decay were used for the entire PWM off time.

An advantage of this control method is that no user adjustments are needed for different motors or supply voltages—the decay function is fully automatic.  With conventional stepper motor drivers, the decay mode (and sometimes even the off time) needs to be tuned in each application to maximize the motion quality.

Using this current regulation method, the MP6500 regulates the average winding current quite accurately throughout the entire waveform (see Figure 8). This improved current control results in measurable improvements to motion quality.

Figure 8: MP6500 Current Regulation Waveform

Motion quality measurements

Assessments of stepper motor motion quality have often been less than scientific. Usually, the human eye, ear, and hand are used to judge relative position, noise, and vibration. While useful, these methods are difficult to quantify.

It is also difficult to make direct step-by-step measurements of position accuracy when microstepping. With a 1.8° stepper motor, a ⅛-step corresponds to 0.225° of rotation—a very small angle.  It is easier to make time-domain measurements while the motor is in motion.  Positioning errors are then manifested as a speed variation. This speed variation over time can be measured using an oscilloscope, as shown in the measurement plots that follow. To make these measurements, a test setup was constructed using a high-resolution optical encoder and magnetic particle brake coupled to a step motor on a test stand.

The stepper motor used was a typical 1.8° per-step NEMA 23 stepper motor with 2.5mH of inductance rated for 2.8A of current. This is a typical motor that would be used on an XY stage in small industrial equipment or a 3D printer.

To make measurements of the motion, a frequency-to-voltage converter (Coco Research KAZ-723) was used to process the output of the optical encoder with its output observed on an oscilloscope and FFT analyzer. This output is a voltage that is representative of the motor speed, updated at a very high rate

This setup is shown in the photos below.


Photo 1: Motor Test Stand


Photo 2: KAZ-723 F/V Converter

To check the setup and see what motion imperfections are inherent in the motor and measurement system, the stepper motor was driven with analog sine and cosine currents.  The phase currents and the output of the F/V are shown in Figure 9.

The F/V output shows an instantaneous speed variation that is periodic and synchronized with the drive waveform. This observed speed variation is most likely caused by the motor itself, arising from imperfections in the magnetic and mechanical construction of the motor. There may also be some contributions from the encoder or test stand mechanics, or harmonic distortions in the amplifier driving the currents.

Though it is likely possible to improve the motion quality by pre-distorting the drive waveforms to correct for the motor construction, this is the best motion quality we can expect from this particular motor in this test environment.

Figure 9: Analog Current Waveform Motion Quality

Using the same setup and identical test conditions, the motor was then driven by a popular bipolar stepper driver, which uses conventional peak current control, using external sense resistors. This driver uses slow decay when increasing the current and mixed decay when decreasing the current.

The mixed decay threshold was adjusted to stay in slow decay for as long as possible while still being able to track the desired waveform when driving toward zero. This resulted in the lowest PWM current ripple, as well as the lowest amount of measured speed variation.

Figure 10 shows that the speed variation when driven by this IC is nearly three times that when driven with the analog sine and cosine waveforms. That translates into increased noise and vibration of the motor, as well as positioning errors.

Figure 10: Conventional Driver Motion Quality

The MPS MP6500 stepper driver IC, which uses internal current sensing and the current regulation scheme described above, provides considerably better motion quality.  The speed variation, while not quite as small as it is when driven with an analog sine/cosine current waveform, was much lower than that attained with the conventional driver IC. That translates into a smoother, quieter operation and more accurate positioning.

Figure 11: MP6500 Motion Quality

High-Speed Stepping

As we saw in Figure 3, at very high step rates, normal current control techniques can fail to keep the winding current in control. As the motor turns faster and faster, the back EMF makes it more difficult to increase the current, and there is less time available in which to decrease the current. At some point, this results in the inability of the motor to generate torque, and a stall results.

Improved current control can allow a given motor to be operated at higher speeds.

Figure 12 shows the motor speed (as measured by the system described above) versus time during a speed ramp from near zero using a conventional stepper motor driver. A stall occurs when the speed measurement is at about 8V, which corresponds to around 480RPM.

Figure 12: Conventional Driver Speed Ramp

Using the same setup and winding current, the MP6500 shows the ability to drive to a significantly higher speed (see Figure 13). A stall occurs at a measurement voltage of about 10V, which corresponds to around 600RPM.  This is due to improved current regulation at high step rates.

Figure 13: MP6500 Speed Ramp

Conclusion

New and advanced stepper motor driver ICs like the MP6500 can provide improved stepper motor motion quality with the same or lower total system cost as conventional stepper motor drivers being used now.  The improved motion quality can be measured quantitatively with a test setup as described in this article.

If you enjoyed this article, you will like the following ones: don't miss them by subscribing to :    eeNews on Google News

Share:

Linked Articles
10s