Automatic Commutation of Stepper Motors
Introduction, Principle of Autocommutation
Stepper motors are mostly driven in open loop mode. Timing of the step pulses is defined by the controller, the motor is supposed to follow without loosing synchronism.
Stepper motors are in fact natural positioning devices which do not require position feedback. The drawback of their design are important iron losses when running at high speed. Therefore high torque stepper motors are mainly used for low speed positioning. However, the escap disc magnet stepper motor is an exception to this rule : its design is totally different from conventional stepper technologies and results in rather low iron losses. Therefore, if an optical encoder and a small circuit is added for automatic commutation, it is capable of fast incremental motion and can compete with a traditional DC servo or BLDC motor. This solution provides comparable performance at lower overall cost.
Automatic commutation requires knowledge of the rotor position. Hall sensors are very often used for control circuits, the sensor resolution may be quite low and only needs to indicate certain discrete rotor positions, depending on the desired commutation angle.
Figure 1 shows a motor model having two phases and one pair of poles. The encoder has two Hall sensors and one pair of poles, its resolution is 4 counts per rev.
With both phases energised, the target positions at electrical angles of 45°, 135°, 225° and 315°. (See Figure 2)
The magnetic encoder indicates the rotor position within an electrical angle of 90°. (See Figure 3)
Encoder Resolution Same As Motor Full Step Resolution: Influence of commutation angle
The angular position of the sensors versus back-EMF of the phase windings is set according to Figure 4.
The first circle (lower left) shows the four motor target positions and corresponding states of phase energization (example: A+ B+ means: IA = IB = +I0 ). The upper right circle shows the logic states of both encoder channels (example: 01 means a = 0, b = 1 ). α is the phase advance angle introduced between motor and sensor signals, its influence on motor performance will be seen later. Figure 5 shows the back-EMF of each phase and the corresponding sensor output signals over one electrical period, which for the model of Figure 1 equals one motor revolution.
Depending on the logic equation (relation between sensor signal status and phase energization) the motor can behave in different ways: as a positioner, a BLDC motor with phase advance α , a BLDC motor with phase advance 90+ α , or in an unstable oscillating mode. The table below gives examples of the motor working mode for various phase currents (hence rotor positions) if in each case the sensor is aligned to give the same signal state 01 (a = 0, b = 1, | α | < 45°)
|logic states vs phase currents||initial direction of rotation = CCW||initial direction of rotation = CW|
|01 for A+ B+||position mode||position mode|
|01 for A- B+||BLDC mode phase advance = α||oscillating mode|
|01 for A- B-||at low speed: oscillating mode, at high speed: BLDC mode, phase advance = 90° + α||at low speed: oscillating, at high speed: BLDC mode, phase advance = 90° - α|
|01 for A+ B-||oscillating mode||BLDC mode phase advance = α|
Motor Behavior Resulting from Various Sensor Positions for Logic State 01
Motor working with zero phase advance
With the sensor adjusted according to Figure 6, we have α = 0. Figure 7 illustrates the logic equations for sensor signals and phase currents as per Table 2, where a positive phase current is taken to be equivalent to logic 1 and a negative current equivalent to logic 0. Figure 8 shows the motor drive circuit required for zero phase advance.
|sensor ab||motor rotates||motor rotates|
|signal s tate||CCW||CW|
A = a
B = b
A = ¯a
B = ¯b
Relation between logic states and phase currents with logic equations
Motor working with 45° phase device
If the sensor remains adjusted as before, the logic equations need to be changed. If the sensor is rotated -45°, the same drive electronics can be used.
Motor working with 90° phase advance
With α = 0, the logic equations are:
for CCW rotation: A = ¯b , B = a
for CW rotation: A = ¯b , B = a
The motor can rotate in either direction, low speed torque is about nil, as commutation takes place at an unstable rotor position.
Note that this approach is also valid with only one phase energized.
Measurements were made with an escap® type P310-158-005 disc magnet stepper motor. Phase windings were connected in parallel, and an escap ® type D15 magnetic encoder was added.
The driver was a double bridge SGS 298 with a current limitation added to avoid overcurrent at low speed. Three different voltages (7, 12 and 24V) and phase advance angles were used. The results are shown in Figure 9 for angles of 0° and 45°.
Use of a sensor having the same resolution as the motor is relatively inexpensive. The 100 steps per rev. escap® motor type PP520 has built-in Hall sensors which are excited directly from the disc magnet of the motor rotor.
When using such a procedure of autocommutation, a torque constant with some third harmonics is preferable to a purely sinusoidal one, as torque ripple will be somewhat lower.
The limitation of such systems is the fact that for maximum torque the phase advance angle should be constantly adapted to the speed. In view of the short electrical time constant and low iron losses of small motors using the disc magnet technology, a phase advance of 45° seems to be an excellent compromise as illustrated in Figure 10.
High resolution encoder with a motor running in microstep mode: Motor working in half step mode
We now consider a motor working in half-step mode, with an encoder giving four counts per full step. (See Figure 11)
With a motor having a sinusoidal torque constant, the low speed commutation angle should be 90 + 22.5 = 112.5° ahead of the position of stable equilibrium. (See Figure 12)
With the rotor being in position 2 for example, the stator field should target position 7, and also as the rotor moves to "3". Once it is in position 4, a commutation is triggered which moves the stator field vector to position 9.
We can increase the phase advance by increments of 22.5° which correspond to the encoder resolution. With higher resolutions the phase advance may be adjusted more accurately. Obviously, with autocommutation, torque ripple depends on the motor torque function vs rotor position and on the way the phases are energized. The size of torque angle increments depends on encoder resolution.
Practical implementation: As a simple solution for autocommutation a stepper motor with encoder and a standard stepper driver are used. (See Figure 13) With this cost-effective system the encoder pulses, through an electronic interface, are fed to the clock input and trigger the full- or half-step commutations. Some precautions must be taken at system initialization and also when changing the phase advance.
At switch-on or after a reset, the circuit is in stepper mode with, say, phase A powered. In case of half-step mode, a logic signal at the Start input will generate 2 pulses at the maximum frequency the sequencer accepts, and consequently phase B is powered and the rotor starts turning.
The first encoder pulse is sent to the sequencer, the second one is suppressed, the third one is used again, and so forth. The motor runs with the optimum static phase angle of 112.5°, and we are using 1 out of every N pulses, with N being equal to 2 in our example.
If the phase advance should be increased by one encoder increment, the system uses the number "N- 1" pulse and then returns to the original rhythm. That way it has gained one pulse, or 22.5°, and now runs with 112.5 + 22.5 = 135°.
If the phase advance should be decreased instead, the process is similar but now uses the "N+1" pulse before going back to the original rhythm. That way it has lost one pulse and now runs with a phase advance of 112.5 - 22.5 = 90°.
The result is a motor running on a standard stepper driver but with automatic commutation, a convenient solution for spindle drives, pumps, mirror drives and so forth.
High resolution encoder with a motor running in microstep mode: Motor working in microstep mode
We now consider a motor working in microstep mode and making 4 microsteps per full step, with an encoder giving four counts per full step. (See Figure 14)
With a motor having a sinusoidal torque constant, the low speed commutation angle should be 90 + 11.25 = 101.25° ahead of the position of stable equilibrium. (See Figure 15)
If motor and encoder reso lution are the same, there are 2 options:
- Encoder pulses occur at positions of stable equilibrium: In this case the commutation angle is not optimum for low speed, and torque ripple will slightly increase. With the rotor in position 1, the stator field may target either "5" or "6", resulting in a phase advance of 90° or 112.5° instead of the ideal 101.25°. The error can be corrected by calculating the motor speed and, after detection of position 1, letting the rotor move approximately 11.25° before commutating the stator field to position 6.
- Encoder pulses differ from positions of stable equilibrium: In this case the encoder must be shifted by an angle of one half the motor resolution. In the example, a shift of 11.25° allows the detection of rotor positions of 11.25°, 33.75°, 56.25° and so forth, resulting in the optimum low speed commutation angle. When using an encoder of twice the resolution, giving 8 pulses per full step, the solution proposed above in the Motor Working in Half-Step Mode may be applied.
High resolution encoder with a motor running in microstep mode: Motor working in sine-cosine mode
This particular case makes it easy to obtain a torque motor.
TA = torque of phase A
TB = torque of phase B
k = torque constant
θ = rotor position
N = number of pole pairs
iA = current in phase A
iB = current in phase B
Then the torque equations are:
TA = -k iA sin(Nθ) and TB = k iB cos(Nθ)
Let the phase currents depend directly on rotor position:
iA = -I0 sin(Nθ) and iB = -I0 cos(Nθ)
The resulting motor torque is constant:
T = TA + TB = k I0 (sin²(Nθ) + cos²(Nθ)) = k I0
However, with a stepper motor this theoretical model is difficult to achieve, mainly for 2 reasons: - at high speed (>2000 steps/s), due to the electrical time constant and the high commutation frequencies, good current regulation is difficult to achieve unless the driver uses a high voltage and high chopper frequency. The resulting cost increase makes the autocommutated stepper less attractive in comparison to traditional DC servo type solutions. - the second reason is linked to the encoder. With the high number of pole pairs of the stepper motor it is difficult to generate two sinusoidal output signals in quadrature with low enough distortion.
This is illustrated by a test, where an escap® P850 stepper motor was equipped with an auxiliary magnet of the same number of pole pairs, rotating in front of analog Hall sensors. Their adjustment inside the motor was extremely difficult and signal distortion over one rev made it impossible to reduce torque fluctuations to less than 5%. In fact, at low speed a much better result was obtained using a true microstep drive mode.
We can see that between the various possibilities of driving stepper motors in a BLDC mode, the one using an encoder and a normal stepper driver is highly attractive in terms of cost and performance.
IMPLEMENTATION IN SPEED AND POSITION CONTROL
It was demonstrated that driving a stepper motor in BLDC mode is quite simple. This is attractive for about 70% of applications which do not require the execution of a speed profile. Now let us look at speed control of stepper motors with autocommutation.
Analog speed control: Similar to DC motors the speed of steppers driven in BLDC mode may be controlled using a encoder. (See Figure 16)
This type of control requires the separate linear adjustment of both phase currents, and a torque which is a linear function of current over the speed range considered. For high speed operation the latter requires a high drive voltage. The solution is only recommended if speed is controlled within a narrow range.
Digital speed control: This type is more complex but offers the advantage of taking into account the motor torque non- linearities. The speed is measured digitally and the speed loop coefficients are set for the speed range considered.
Such a speed control circuit was set up for the escap® PP520 motor. Each phase is powered by two PWM drivers which convert a reference voltage into phase current.
The current references come from two DACs; a microprocessor provides the digital values. The speed is calculated by measuring the time between encoder pulses. The phase advance and current amplitude for each phase are then controlled depending on the speed and the speed error. (See Figure 17)
With the Hall sensors used in the PP520 motor the control algorithm is simple as compared to an optical encoder because the two Hall signals identify 4 rotor positions per electrical period.
The microprocessor controls only two parameters which are the absolute values of each phase current. Their polarities depend directly on the logic state of the Hall outputs. (See Figure 18)
With the Hall sensors detecting the positions S1, S2, S3 and S4, the phase advance may be changed from 45° to 45+x° by imposing absolute current values of:
I1 = I0 cosx and I2 = I0 sinx
Each phase current is a function of the sensor output logic states.
Because of phase jitter between both sensor signals motor speed is determined by measuring the frequency of just one signal. However, at speeds below 500 rpm sampling time is insufficient and therefore results are better with the motor driven in normal open loop microstep mode rather than with closed loop operation.
Position control: Stepper motors being designed for open loop positioning, it makes little sense closing the loop and increase cost. Motors built for microstep operation have low detent torque and a perfectly sinusoidal torque function. When driven in microstep mode they easily provide the accuracy needed for many applications. If necessary, a final position error is corrected by adding a few microsteps, in stepper mode.
Stepper motors are often used for reasons of low cost and easy implementation in relatively simple applications.
New technologies like the disc magnet motor developed by Portescap allow use of steppers not only for positioning but for high speed motion as well. Due to low iron losses and low rotor inertia, they successfully compete against traditional brushless DC motors.
By adding an encoder with a simple electronic interface between the encoder and a standard stepper driver, these motors can be autocommutated in order to take advantage of their high dynamic possibilities. The results are competitive in every respect. With incremental motion the best solution is to drive the motor in microstep mode at low speed and in BLDC mode at high speed.
Design engineers should be aware of these new technologies, which lead to new ways of optimizing a entire system including motor, driver, and load.