 Hello, and welcome to this ST Microelectronics presentation on the basics of stepper motor operation and driving. In this presentation, we will discuss the two most common configurations for stepper motors and the required drive circuit for each. The basic drive sequences, full step, half step, and microstepping, drive topologies for steppers, and typical drive profiles. The basic configuration for the stepper motor has a permanent magnet on its rotor and coils on the stator. A rotating magnetic field is generated by applying alternating positive and negative currents to the stator coils. The most common configuration of a stepper motor in use today is a two-phase bipolar-driven motor. This motor needs an H-bridge to drive each of the two phases. The stepper is a synchronous machine, and the rotational speed is directly controlled by the rate at which the currents in the stator are changed. Stepper motors are well suited for low-torque applications that need precise position control, such as computer peripherals or numerically controlled machine tools. In these applications, steppers have several advantages. Since they have no brushes, they are high-reliability motors, whose life is essentially determined by the life of the bearings or bushings in the motor. The control loop is very cheap since the motor is driven open loop without any position or speed feedback elements. Since the motor is a synchronous machine, speed control is simple, and the motor configuration inherently gives good position control. There are two common configurations for stepper motors. The two-phase bipolar motor and the four-phase unipolar motor. In their simplest form, as shown in the figure, they are a permanent magnet on the rotor and two coils oriented at 90 degrees to each other on the stator. When driven, the current in each of the coils produce a magnetic vector that's summed together, and the permanent magnet on the rotor will align with this magnetic vector. Changing the polarity of the current will change the angle of the magnetic vector and thus generate the rotating magnetic field that will make the motor turn. For the bipolar motor, this is done by sequentially changing the polarity of the current in the two windings. For the unipolar motor, the coil is wound in a center-tapped configuration with the center typically connected to a positive supply voltage. Alternately, connecting the two end connections to ground will change the direction of the resulting magnetic vector. The circuit required to drive each of the configurations are shown here. The bipolar motor needs eight transistors connected in a dual H-bridge configuration to drive the motor, while the unipolar motor needs only four transistors connected to ground to drive the motor. Early applications of stepper motors often used the unipolar configuration since it required fewer transistors to drive and did not require a level shift to drive the upper transistors of an H-bridge. So, if the unipolar motor is much easier to drive, why would you use a bipolar stepper motor? The answer is that for the same motor frame size, a motor that is wound as a bipolar motor will be able to deliver about 40% more torque than the same frame wound as a unipolar motor. Basically, this is because of better usage of the copper in the motor. One of the factors that limit the amount of torque that can be produced is the dissipation in the coil and the maximum allowable temperature in the coil. The dissipation in the coil is proportional to the square of the current in the winding and the coil resistance, and the coil resistance is proportional to the number of turns, N. Torque, however, is proportional to the current times N. When you look at a unipolar motor with N turns in each half of the coil, the dissipation is proportional to I squared times N, and the torque is proportional to I times N. Driving the same coil as a bipolar motor, the current flows through both halves of the coil, so the torque is proportional to I times 2N, and the dissipation is proportional to I squared times 2N. If you set the maximum dissipation to be the same in each unit, you see that for the bipolar motor, you can only drive 70%, actually 1 over the square root of 2 of the current in the unipolar motor. However, that current flows through both halves of the coil and therefore produces 40% more torque. The improvement in performance that can be achieved using the bipolar motor makes it more advantageous than the unipolar motor. Integrated driver ICs have greatly simplified the design for the bipolar motor drive circuits since they integrate both the power transistors and all of the level shifting and gate drive circuitry into one easy to use IC. Typically we find that for low performance applications, for example the paper feed in a desktop inkjet printer, unipolar motors are still commonly used with very simple drive circuits. For higher performance applications, bipolar motors are typically used. Continuing the step sequence in the 1357 order causes the motor to rotate in the forward direction and reversing the order to 7531 will cause the motor to rotate in the reverse direction. This drive sequence is commonly referred to as full step since each change in the current moves the motor one step. For our simple motor that only has one pole pair on the rotor, there are four steps per revolution and one electrical cycle completes one revolution. Real stepper motors of course have many more steps per revolution. One common configuration has 7.5 degree steps which corresponds to 50 steps per revolution for a 12 pole pair motor. Such a motor would require 12 electrical cycles to complete one mechanical revolution. Another common configuration is 1.8 degrees per step with 200 steps per revolution and 25 pole pairs requiring 25 electrical cycles per revolution. Although other configurations are possible, these are the two most common. As we said earlier, the basic configuration of a stepper motor can be thought of as a magnet on the rotor and two coils on the stator oriented at 90 degrees. If we start by energizing both coils with the same magnitude of current, the resulting magnetic vector will be at 45 degrees and the rotator will move to a line with this vector as shown in state 1 on the slide. By reversing the direction of current flow in the first coil, as shown in state 3, the magnetic vector moves 90 degrees and the rotor will follow. Reversing the direction of current in the second coil will then move the rotor to state 5. The same behavior from state 5 to state 7. Continuing the step sequence in the 1, 3, 5, 7 order causes the motor to rotate in the forward direction and reversing the order to 7, 5, 3, 1 will cause the motor to rotate in the reverse direction. This drive sequence is commonly referred to as full step since each change in the current moves the motor one step. For our simple motor that only has one pole pair on the rotor, there are four steps per revolution and one electrical cycle completes one revolution. Real stepper motors of course have many more steps per revolution. One common configuration has 7.5 degree steps which corresponds to 50 steps per revolution for a 12 pole pair motor. Such a motor would require 12 electrical cycles to complete one mechanical revolution. Another common configuration is 1.8 degrees per step with 200 steps per revolution and 25 pole pairs requiring 25 electrical cycles per revolution. Although other configurations are possible, these are the two most common. The idealized current wave form for the two coil currents are square waves shifted 90 degrees in phase. Of course we know that the slope of the current changes will be limited by the inductance and as we will see later can have a dramatic effect on the performance of the motor. If the step sequence is reversed, one of the two current wave forms will be shifted 180 degrees as the motor rotates the reverse direction. You may have observed that only oddly numbered states were used in the previous sequence. One may ask why there are not even numbered states. The answer is that there actually are some states halfway between the full step positions that the motor can easily be driven to. These positions are obtained by simply turning off the current in one coil before turning it on in the opposite direction. States 2, 4, 6 and 8 have current in one winding and no current in the other. Since these positions are halfway between the full step positions, they are referred to as half steps. The drive sequence to operate the motor in half step then has 8 states per electrical cycle. The advantage is that you can easily double the number of steps per revolution, so a 1.8 degree per step motor now gives 0.9 degrees of resolution. An idealized half step sequence of current in the two windings is shown here. The sequence is characterized by the current being positive for 3 steps, 0 for 1 step, negative for 3 steps and 0 for 1 step. The two coil currents are, as in the previous slide, shifted 90 degrees with respect to each other and reversing the sequence would shift one of the two current waveforms by 180 degrees. This simple sequence is generated by switching the currents on or off and controlling the direction of current flow in the coils so that the magnitude of a current when it is on is always the same. If you look at the sequence above, you see that for every other step, the current in one of the two windings is 0. Since the magnitude of the resulting magnetic vector is equal to the vector sum of the vectors generated by the two coils, the magnitude when both coils are energized will be larger by a factor square root of 2 than when only one of the two coils is energized. This variation leads to a ripple in the torque since the torque is proportional to the magnitude of the magnetic vector. It is possible to compensate for the torque ripple by increasing the current in the one winding that is on during the half step so that the magnitude of the magnetic vector is the same as it would be if both of the windings were energized. If we increase the current in the one on coil by the square root of 2, then we will produce the same magnitude of vector when the one coil is on as is produced when the two coils are driven by the same current. The current waveforms shown here have been modified to use this technique to control the current and reduce the torque ripple. As we will see later, this can easily be done with some of the control ICs by simply changing a reference for the motor current. Now that we have discussed the basic drive sequences for stepper motors, we will look at some common driver topologies for steppers. The simplest drive topology is to drive the motor with the rated voltage and simply switch the coils in sequence as we have seen in the full step or half step sequences. The figure here represents such a drive topology. The circuit has been simplified with the single transistor representing one of the transistors of a unipolar drive or the composite of two transistors in the bridge of a bipolar drive. When the phase is energized, the current will increase exponentially until it reaches a value that is equal to the supply voltage divided by the motor resistance, Rc. The time constant of the exponential is L divided by R, which gives rise to the name L over R drive. This drive configuration is very simple, requires no additional components beyond those required to control the current sequence and operates from a single supply voltage. However, it is a relatively low performance in terms of the speed torque profile. One of the reasons the performance is limited is due to the inductive properties of the coils that limit the rate of change of current. If we consider a typical five volts one amp stepper motor, it will have a five ohm resistance. When the coil is energized, the current increases exponentially until it reaches its full value of one amp. As we see in the figure, this can be relatively slow. When we are driving the motor in full step, each time we make a step, the current will reverse direction and the rise time will be limited by the motor inductance. Here we see the step command on the top trace and the corresponding motor phase current in the lower trace. When the step time is longer than the LR time constant of the motor, the current reaches the expected peak value during each step and we get the expected torque produced by the motor. As we increase the speed and the step time decreases, we reach a point where the current just reaches the desired peak during each step. When the step rate is increased further, the motor current may no longer reach the expected value in each step, as we see here. With less time in each step and the current rise limited by the inductance of the motor, we see that the peak current reached during each step is less than the peak value at the slower speed. Increasing the speed a bit more further reduces the peak current. Further increases in speed lead to lower peak currents. When we reach this point, the motor has most likely already stalled if it has any load on it. Since the torque is proportional to the current in the motor, the torque will decrease as the peak current decreases. An earlier slide showed the speed torque curve with a downward slope at increasing speed. This reduction in the peak current at higher speed is one of the contributing factors. As you can easily see from the figures, if the time constant of the current could be decreased, you could expect better performance from the motor. One way to reduce the time constant while maintaining the same peak current is shown here. By placing a resistor in series with the motor winding and increasing the drive voltage, you can achieve the same motor current, however the time constant, which is l over r, is decreased. This drive technique called l over nr was very common in early line printer applications that needed a faster response from the stepper motor. Going back to our example motor, if we increase the supply to 25 volts and add an external 20 ohm resistance, we still get 1 amp current, but the rise time is significantly reduced. Here we compare the typical 5 volt 1 amp motor driven from 5 volts in the l over r configuration and a motor driven in the l over nr configuration using a series resistance equal to four times the motor coil resistance and five times the drive voltage or 25 volts. We see that the rise time is significantly reduced, so we would expect to be able to operate at higher speed. However, the additional dissipation in the added external resistance is not acceptable in today's applications. What is needed is a drive that gives a faster rise time without the dissipation of the l over nr drive. Just as switching regulators have replaced linear regulators for power supplies, switching techniques can be applied to the motor drive as well. When driving a motor we already have a large inductance to work with, so the only additional components needed are the circuit to sense and regulate the current in the motor winding. Common techniques that work well for stepper motors are shown here. In these circuits the comparator senses the coil current by sensing the voltage across the sense resistor and compares it to a reference input. In the fixed frequency implementation when the current exceeds the set value the comparator will reset the flip flop and turn off the transistor allowing the current to decay. The oscillator periodically sets the flip flop causing the cycle to repeat implementing a fixed frequency pulse width modulation or PWM to regulate the peak current. In the constant off-time implementation the comparator triggers a monostable that turns the output off for a fixed period of time each time the peak current of the motor reaches the threshold set by the reference input. Although we commonly refer to this as PWM it is really a fixed off-time frequency modulation since the off-time is fixed and the on-time varies to regulate the current. Both of these currents have been implemented in control ICs for stepper motors. In most applications either technique may be used and there will not be any perceivable difference in the operation of the motor. In some applications particularly when the duty cycle can exceed 50 percent the constant off-time approach offers some advantages in stability of the chopping. Using the chopper controlled current drive to drive the stepper motor allows a very fast current rise and good efficiency in the drive. Comparing the current waveform to the previous example we see a slight improvement in the rise time compared to the L over N R configuration. The example shows the same motor we had earlier operating at five times the rated voltage 25 volts with a chopper current control set to control a peak current of one amp. Obviously there are a lot of advantages to using the chopper drive that improve the performance and give a very good efficiency. The disadvantages of complexity and additional circuitry have mostly been overcome by integrated motor drivers that include all of the control circuits and in many cases also the power transistors on a single monolithic IC. Although some low-end applications are still done using a simple L over R drive and a unipolar motor most applications today use chopper drive with integrated driver ICs to drive bipolar stepper motors. When discussing the drive topologies in the previous section the power stage was simplified to a single transistor in the examples. For a bipolar motor the power stage is actually an H bridge driving each coil and we have some options on how we apply the chopping control to the bridge. The selection made will have an effect on the ripple current and in some cases the performance we get from the motor. We will now look at the chopping modes we can have with an H bridge. The diagram on the left shows the current path during the on time of the PWM. One of the upper transistors and the lower transistor on the opposite side of the bridge are turned on so that current flows through the coil. We know that when we turn off one or both of these transistors the inductive property of the coil will tend to keep the current flowing so the output will fly back so that current flows through the clamp diode or diodes and continues to flow in the coil until it reaches zero or we turn the transistor on again. If we turn off only the lower transistor the current will flow through the upper transistor that is on the coil and the opposite diode on the upper side as shown in the center diagram. This is typically called slow decay mode or phase chopping. Since the rate of change of current in a coil is proportional to the voltage across the coil as given by the equation v equals ldi over dt we know that the current will decay slowly since the voltage across the coil is only the forward diode drop plus the drop across the one transistor. If we turn off both the lower and upper transistors as shown in the figure on the right then the current flows through two diodes the coil and back to the supply. This is typically called fast decay mode or enable chopping. In this case the current will decay much faster since the voltage across the coil is equal to the supply voltage plus the forward drop of the two diodes. In this figure you can see a comparison between fast and slow decay modes of operation. Two things are important to notice first the ripple current is much higher in the fast decay mode second the current decays or decreases much faster in the fast decay mode. For most applications that are operated in full step or half step sequences the slow decay mode is probably a better choice since it gives less ripple in the current. Many times it will also give less dissipation in the driver but this is not always the case. The fast decay has an advantage if the current must decay rapidly which is required in some applications. We have been talking about full step or half step operation. In this case the positioning is limited to the four or eight positions per electrical cycle that are naturally achieved by controlling the phase relationship of the currents without changing the magnitude. For applications that require higher resolution in positioning it is possible to drive a step promoter to positions between the full and half step positions. This is generally referred to as microstepping. Remember that the rotor is a permanent magnet that will attempt to align with the magnetic vector produced by the two coils on the stator. For full step the two coils are energized with equal currents producing a magnetic vector aligned at 45 degrees. For the half step positions only one coil is energized and the magnetic vector is either horizontal or vertical. These two cases are shown in the diagram as the half and full step positions. For microstepping we want to move the rotor to a position between the full step and half step positions. We can align the vector to different positions if we independently control the currents in the two windings. For example if one phase were energized with a current equal to twice the current in the second coil then the magnetic vector would be along an angle of 30 degrees as shown by the third vector in the diagram. In the limit for any angle on the circle the coils could be driven by a current proportional to the sine and cosine of the desired angle. In this way it is theoretically possible to position the rotor at any desired angle. Of course there are some mechanical issues and positioning of the two coils will give a lower limit to what is achievable. We have already seen the current controlled drive circuit where we have the ability to set the coil current by setting the reference voltage. Using the two chopping current controls and setting the reference for each using a DAC it is pretty easy to generate the desired currents in each of the two coils. Here you can see the actual operating waveforms implemented with an L6208 for a microstepping drive. Channels two and three, the green and purple traces, are the output of the DAC for the two coils. Channel four, the magenta trace, shows the current in the winding corresponding to the reference voltage on channel two. Channel one shows the step clock input that controls the phase relationship of the bridge. In this example the sine wave is synthesized using 16 microsteps per step dividing each 90 degrees into 16 5.63 degree microsteps. This implementation uses an 8-bit DAC actually an RC filter on a PWM output from a microcontroller to generate the two reference voltages. As a rule of thumb you need two additional bits in the DAC above the number of microsteps to generate an acceptable sine wave. For the 16 microsteps here a 6-bit DAC would be sufficient. With an 8-bit DAC you could generate an acceptable approximation for the two sine waves for a 64 microstep application. Typically you can achieve 1 16th to 1 32nd microstepping with most motors. How well the motor will follow the microstepping waveform depends on the construction of the motor. This is a good time in the presentation to discuss a couple of anomalies that can occur especially when using the peak detection current controls due to microstepping. In this type of control there are two phenomena that have a significant influence on the current waveform and specifically the ability to control the current so that it matches the desired sinusoidal waveform. These are the minimum current that the circuit can regulate and limitations in the decay rate of the current introduced by the slow decay mode of chopping. The first anomaly that will affect the microstepping drive or the holding current that can be controlled is the minimum current that the chopping drive can regulate. For any peak detect chopping control like the control shown earlier there is a minimum duty cycle that can be achieved due to limitations in the control circuit. The minimum on time may be set by several factors. One factor is the propagation delay through the loop. This includes the delay through the comparator, the propagation delay through the logic, and the turnoff delay time through the base or gate drive circuit and the power transistor. Basically it is the delay from the time the voltage across the sense resistor exceeds the reference voltage at the input to the comparator until the power transistor can be turned off. In some controls like the L297 and L6506 the oscillator basically sets a minimum on time which is the width of the sink pulse that is clocking the RS flip-flop. Some control ICs have a blanking time during which the output of the comparator is ignored. This is done intentionally to mask the switching noise but effectively increase the minimum on time. For a fixed off time control the off time set by the monostable and thus the minimum on time and fixed off time establish a minimum duty cycle. For fixed frequency control the period is set by the oscillator and the minimum on time effectively sets the duty cycle directly. In either case the result is that there is a minimum duty cycle that the control circuit can regulate. In operation the motor current is compared to a reference iREF. In the circuit implementation the current is represented by the voltage across the sense resistor and the reference is really the vREF applied to the comparator. We expect that as we reduce the reference the duty cycle will decrease and the current will also decrease proportionally. Ideally following a linear transfer curve like the dashed blue line. As the reference is decreased the peak current detected will decrease and the output PWM will also reduce until we reach the minimum duty cycle that the circuit can regulate. Below this point a further reduction of the reference will not result in a further reduction in the current. When the reference is decreased further the minimum duty cycle is still applied to the output therefore no more reduction in regulated current is possible. This introduces a non-linearity in the transfer function as shown by the orange line. If a value between zero and the minimum current is commanded the circuit will basically respond with the minimum current. In full step and half step applications this will limit the minimum current that can be delivered if we try to reduce the current to a lower value for a holding torque. In microstepping this means that it is not possible to get zero current simply by setting Vref to zero volts. Of course if we were to use a fast decay the minimum current would be a bit lower. Also there is a discontinuity in the transfer function when the current in the coil transitions from continuous to discontinuous. Looking at microstepping applications it is obvious that we cannot get zero current by simply applying a zero reference. The value of the minimum current may also affect how well we can match the sine wave we are trying to synthesize. Here we have the ideal waveforms for a microstepping drive running at a constant speed. The two phase currents are 90 degrees out of phase and the phase relationship determines the direction of rotation. If we apply the transfer function that we derived in the discussion on minimum current to the desired sine wave current for microstepping we see the effect of minimum current shown here in the orange and green. If the output of the DAC sets current near zero the circuit will respond with the minimum current. To get zero current we can disable the bridge and turn off all of the transistors. Without any drive the current will go to zero so we can get the zero points on our sine wave. Since we can get zero we only have to look at what effect the minimum current will have on the sine wave just before and just after the zero value. Luckily the first microstep after zero and the last one before zero is the largest step that we need to make so if the minimum current is less than the sine of the first microstep there should be no distortion in the sine wave. In the example the minimum current starts to affect the waveform at about 11 degrees so if the first microstep is more than 11 degrees there should be no distortion on the sine caused by the minimum current. In this case we could divide each quarter cycle into eight microsteps of 11.25 degrees each. These are the waveforms we saw earlier operating a stepper motor with one sixteenth microstepping. If you look closely near the zero current points on the current trace you can see a small amount of distortion that may be caused by the minimum current effect. Another anomaly that can affect microstepping is a result of the decay mode that is selected. Earlier we discussed the two different decay modes fast decay and slow decay. In the slow decay mode during the off time the current is recirculating around a path that is one on transistor and one diode or possibly one MOS conducting in the reverse direction. During this time the current decays rather slowly since the voltage across the coil is very small. Remember v equals l di over dt. In a microstepping application we are trying to produce a sine wave drive. However the slow decay rate may limit the ability to follow a fast changing waveform that we have on the downward slope of the sine curve. The green and orange traces represent the current waveform when the decay rate is limited by the slow decay and the inductance of the motor. Since the entire voltage is applied across the motor when energizing the inductance the di dt can be relatively fast. In that case the current can follow the rising slope of the sine wave but the fall time is limited by di dt. This figure shows an actual waveform from operating the l6208 in the slow decay mode using the practice spin system. The di over dt limit of the low decay is limiting the ability to follow the trailing edges of the sine wave. The current waveform looks much better if we change to fast decay. Since the voltage across the coil is larger the rate of change will be greater and you can now follow the desired current waveform. We do see an increase in the ripple current as we expect when changing to fast decay. Of course if the sine wave is slow enough it is possible to follow it well even with slow decay. Ideally we would like the motor to start at full speed and stop on command. However for most applications this is not possible. Think for a moment about how a brushed DC motor responds to an instantaneous step in the input voltage from zero to full voltage. It will naturally accelerate up to full speed and then run at full speed. We need to consider that the equivalent operation is for a stepper motor. For a stepper motor drive the designer must consider the speed torque performance of the motor and guarantee that the motor is always operating under the speed torque curve of the motor. If we exceed the available torque at a given speed the motor will stall and stop. This figure shows a typical speed torque curve that you might find for a stepper motor. Notice the downward slope at higher speeds. Although you might find this curve on a data sheet the real curve has some discontinuities. This is a more realistic speed torque curve. Notice that there are some speeds where the torque seems to drop to zero. This is due to the mechanical resonance points of the motor. A stepper is basically an underdamped machine. Each time it takes a step it overshoots and then settles into the final position. Depending on the damping in the load there may be some operating points that have a mechanical resonance that effectively drops the torque to zero at that speed. The designer must select operating points that are below the speed torque curve or the motor will lose steps and stall. A typical way of operating would be to select a line at around 75% on the torque curve and then be sure you operate on or below that line and did not operate on any of the mechanical resonant points. Obviously the designer must consider the desired operating speed and the available torque. In the diagram the green line may represent the desired operating speed. This may be dictated by a requirement to match a speed or to make a movement within a certain period of time. The available torque for our design point at that speed is shown on the vertical axis. However the torque required to start the motor moving may be much higher than that. The blue line represents the amount of torque needed to overcome the inertia and friction of the system to get the load moving. At this point the maximum speed is much less than the desired speed. Fortunately as the speed increases the load due to the inertia decreases and in most cases less torque is needed to keep the load moving than to accelerate or decelerate it. So as we get the motor moving less torque is typically needed and we can accelerate a bit faster. The simple solution is to create an acceleration and deceleration profile to start and stop the motor. For most applications this can be done with a simple linear ramp for acceleration and deceleration. The starting speed is set by the blue line in the previous slide and the maximum is set by the green line. The blue line in the slide shows a typical move speed profile. For each movement the step time is gradually reduced for each step starting from the time set to overcome the inertia of the load until the desired speed is achieved. The procedure is reversed to decelerate the motor gradually increasing the step time each step. Obviously the calculation for the move must subtract the number of steps it takes to accelerate and decelerate from the total number of steps to move to calculate the number of steps to run at a constant speed. For short moves the motor may not reach the full speed before it needs to start decelerating so the acceleration may have to be truncated as shown by the green line. The second derivative of speed is jerk. The discontinuities at the corners of this acceleration profile correspond to a change in the acceleration or jerk. In applications like moving jars of fluid the jerk may need to be reduced. This can be accomplished by rounding the corners at the top of the movement profile. In this session we have discussed the basics of stepper motor operation and the typical drive configurations for commonly available stepper motors. This block diagram shows a typical stepper motor drive system that implements the drive configuration we have discussed here. The three blocks needed to drive the stepper are the step time and phase generation which is typically done in a microcontroller, the PWM current control and the power bridge. Thank you for your attention. Please visit us at st.com to view the many motor control products and solutions available from ST. For more information please refer to www.st.com slash st motor control. Also you can watch the Power Spin E presentation. Thank you for your attention.