# How to Add Encoder to Stepper Motor

Nov 04, 2021

## 1. Working Principle of Stepper Motor

When the current flows through the stator winding, the stator winding produces a vector magnetic field. The magnetic field will drive the rotor to rotate an angle, so that the direction of magnetic fields of the rotor is consistent with that of the stator.

When the vector magnetic field of the stator rotates an angle, the rotor also rotates at an angle with this magnetic field. Every input of an electric pulse leads the motor to rotate at an angle to advance one step. The angular displacement of the output is proportional to the number of pulses input, and the speed is proportional to the pulse frequency.

Changing the order in which the winding is energized will reverse the motor. So the control of pulses’ number, frequency and the power on sequence of each phase winding of the motor affect the rotation of the stepper motor.

The internal of common types of motors are iron core and winding coil. If the winding is with a resistance, there will be electric loss which is proportional to the square of resistance and current. This is what we often call copper loss. If the current is not a standard DC or sine wave, it will also produce harmonic loss.
There is hysteresis eddy current effect in the iron core, producing loss in alternating magnetic field. The size of the iron core is related to material, current, frequency and voltage, which is called iron loss.

Copper loss and iron loss are reflected in the form of heat, affecting the efficiency of the motor. The stepper motor generally pursues positioning accuracy and torque output with low efficiency, large current, and high harmonic composition. And the frequency of alternating current changes with the speed. Therefore, the heating condition is common in stepper motor, especially compared with AC motor.

## 2. Three Types of Circuit Diagrams of Stepper Motor

Figure 2: Circuit diagram of driving system of stepper motor

RL1 ~ RL4 shown in Figure 1 are winding internal resistor, while 50 Ω Resistor is an external resistor, which can limit the current and improve the time constant of the circuit. D1 ~ D4 are freewheeling diode, through which the back EMF generated by the motor winding fades, thus protecting the power transistor TIP122 from damage.

50 Ω external resistor is connected in parallel with a 200 μ F capacitor, which can improve the current pulse front of the stepper motor winding and improve the high frequency performance of the stepper motor. 200 Ω resistor in series with freewheeling diode can reduce the discharge time constant of the circuit. It makes the back edge of the current pulse in the winding steeper, and reduces the current drop time. Besides, the resistor improves the performance of high frequency.

The driving circuit of bipolar stepper motor is shown in the figure 2. The two groups of phases are driven by eight transistors. Bipolar drive circuit can drive 4 - wire or 6 - wire stepper motor at the same time. 4 - wire stepper motor can only use bipolar drive circuit, which greatly reduces the cost of mass production application.

The number of transistors in the drive circuit of bipolar stepper motor is twice that of unipolar drive circuit. The four lower transistors are usually directly driven by the microcontroller, while the upper transistors need the upper drive circuit with higher cost. The transistor of bipolar drive circuit only bears the motor voltage, so it doesn't need clamp circuit which is in unipolar drive circuit.

Figure 3: Driving circuit diagram of bipolar stepper motor

Stepper motor shall not be directly connected to AC or DC power supply, but must be used with specific stepper motor drive, as shown in Figure 3. It is composed of pulse generation control unit, power drive unit, protection unit, etc. The two units pulse generation control unit and feedback and protection unit can be controlled by microcomputer. The drive unit is directly coupled with the stepper motor, which could also be understood as the power interface of microcomputer controller for the stepper motor.

Figure 4: Drive controller of stepper motor

Figure 5: Stepper motor drive system with constant current

## 3. Whether You Should Add an Encoder to Stepper Motor

You should add the encoder on the back shaft of the dual shaft stepper motor.

The stepper motor is the original executive part, while the encoder belongs to the feedback system. The encoder that is controlled by PLC is used with the stepper motor. According to the principle, PLC sends pulse instruction to the stepper driver, and the driver makes the stepper motor run by providing corresponding current to it.

When encoder detects that the stepper motor is running to the position to be reached, it will send feedback signal to the PLC, and then the PLC stops sending pulse signal to stepper driver. When there is no electric current in stepper motor, it will stop running immediately. Actually, the encoder will constantly send the current position to the PLC that compares the feedback value with the target value and adjusts the rotation angle of the rotor.

Definitely, whether the stepper motor stops at the expected position depends on the brake device of the motor. The general feed accuracy can be satisfied when the motor is running at low speed.

Another method is to calculate the pulse number required for the feed of stepper motor, and use PLC programming to run pulses. When the stepper motor stops, the encoder will send the motor position back in order to form a semi closed-loop control. In addition, the PLC program can set the motor to slow down its feed when it is fast to the position, which can meet the positioning accuracy.

Figure 6: Rotor and stator in the encoder

## 4. How to Add An Encoder to Stepper Motor

Because the stepper motor can not respond in real time, there must be a process of acceleration and deceleration.

For instance, stepper motor with harmonic reducer whose reduction ratio is 100:1, and the step angle is 0.0072 °is required to be added an encoder to prevent step loss.

In principle, a motor can be installed at one end of the leading screw and the encoder installed at the other end. But this method will be affected by the accuracy of the reducer, which may lead to misjudgment of step loss. The encoder is better to be added to the back shaft of the dual shaft motor. This is common in servo motor, unless you are using it specially or the use is limited by conditions (there is no double output shaft). In general, it is sufficient to process 2500 lines, and it will be a waste to process excessive lines.

Figure 7: Fanuc Encoder A860-0304-T001

On the other hand, the resolution of the encoder and stepper motor resolution is about the same. If the subdivision on the drive is very high, and only the step loss is needed to be detected, the resolution of the encoder should be consistent with or slightly higher than that of motor before subdivision.

## 5. Why Adding Encoder to Motor Stepper

The stepper motor is a device which can be controlled accurately, but it is open-loop, and the encoder is needed to realize closed-loop feedback control. The added encoder also measures step loss and rotation or moving speed for dynamic speed control.

For this statement, it is important that the encoder is required to realize closed-loop feedback. In actual use, it’s the poor wire connection of the stepper motor that will occasionally cause the stepper motor to fail to work normally. However, it is not necessary to control the speed through the encoder, because the speed control can be realized by controlling the pulse frequency of the stepper motor.

 Nov 28, 2021 - Nov 25, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 04, 2021 - Nov 03, 2021 - Nov 03, 2021 - Nov 02, 2021 - Nov 02, 2021 -

38 more news from OKmarts Industrial Parts Mall »

 Nov 28, 2021 - Nov 28, 2021 - Nov 25, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 - Nov 24, 2021 -

See electronics manufacturing industry news »

How to Add Encoder to Stepper Motor news release has been viewed 64 times