Stepping motor is widely used in control system. It can convert pulse signal into angular displacement, and can be used as electromagnetic brake wheel, electromagnetic differential, or angular displacement generator.

Sometimes the stepper motor removed from some old equipment (this kind of motor is generally not damaged) needs to be used for other purposes, and generally needs to design its own driver.

1. Working principle of stepping motor

The stepping motor is a four phase stepping motor, which is powered by unipolar DC power supply. As long as each phase winding of the stepping motor is electrified according to the appropriate time sequence, the stepping motor can rotate step by step. Figure 1 is the schematic diagram of the working principle of the four phase reactive stepping motor.


Fig. 1 stepping diagram of four phase stepping motor

At the beginning, switch sb is connected to the power supply, SA, SC and SD are disconnected, and the B-phase magnetic pole is aligned with the rotor 0 and 3 teeth. At the same time, the rotor 1 and 4 teeth are staggered with the C and d-phase winding magnetic poles, and the rotor 2 and 5 teeth are staggered with the D and A-phase winding magnetic poles.

When the switch SC is powered on and Sb, SA and SD are disconnected, the rotor will rotate due to the action of the magnetic line of the c-phase winding and the magnetic line between the No. 1 and No. 4 teeth, and the magnetic poles of the No. 1 and No. 4 teeth and the c-phase winding will be aligned. However, No.0 and No.3 teeth and phase A and B windings have staggered teeth, and No.2 and No.5 teeth and phase A and D windings have magnetic poles

The teeth are staggered. By analogy, if the four phase windings a, B, C and d supply power in turn, the rotor will rotate in the direction of a, B, C and D.

According to the different power on sequence, four phase stepping motor can be divided into three working modes: single four beat, double four beat and eight beat. The step angle of single four beat is equal to that of double four beat, but the rotation torque of single four beat is small. The step angle of the eight beat working mode is half of that of the single four beat and double four beat. Therefore, the eight beat working mode can not only maintain a high rotational torque, but also improve the control accuracy.

The power on sequence and waveform of single four beat, double four beat and eight beat mode are shown in Fig. 2. A, B and C respectively


Figure 2. Waveform diagram of stepper motor working sequence


Figure 3 Schematic diagram of stepping motor driver system

AT89C2051 outputs the control pulse from P1.4 to P1.7 of P1 port, reverses it through 74ls14, and then enters 9014. After 9014 amplification, it controls the photoelectric switch. After photoelectric isolation, the power tube TIP122 amplifies the pulse signal for voltage and current, and drives each phase winding of stepping motor. The stepper motor can rotate forward, reverse, accelerate, decelerate and stop with different pulse signals. L1 in the figure is one phase winding of stepping motor. AT89C2051 chooses crystal oscillator with frequency of 22mhz. The purpose of choosing higher crystal oscillator is to minimize the influence of AT89C2051 on upper computer pulse signal period under Mode 2.

RL1 ~ RL4 in Fig. 3 are the internal resistance of the winding, and the 50 Ω resistance is an external resistance, which plays the role of current limiting and is also an element to improve the loop time constant. D1 ~ D4 are freewheeling diodes, which make the back EMF generated by the motor winding fade through the freewheeling diodes (D1 ~ D4), thus protecting the power transistor TIP122 from damage.

A 200 μ f capacitor connected in parallel with a 50 Ω external resistor can improve the current pulse front of the stepper motor winding and the high frequency performance of the stepper motor. The 200 Ω resistor connected in series with the freewheeling diode can reduce the discharge time constant of the circuit, steepen the back edge of the current pulse in the winding, reduce the current drop time, and improve the high frequency performance.

2. Software design

According to different combinations of dialing switches KX and KY, the driver has three working modes to choose from

Mode 1 is interrupt mode: p3.5 (INT1) is step pulse input, P3.7 is positive and negative pulse input. The upper computer (PC or SCM) is only connected with the driver by two lines.

Mode 2 is serial communication mode: the upper computer (PC or SCM) sends the control command to the driver, and the driver completes the control process according to the control command.

Mode 3 is dial switch control mode: through different combinations of K1 ~ K5, the stepping motor is directly controlled.

When power on or press the reset key Kr, AT89C2051 first detects the status of dialing switches KX and KY, and then enters into different working modes according to different combinations of KX and Ky. The program flow chart and source program of mode 1 are given below.

In the programming, we should pay special attention to the processing of the stepper motor when reversing. In order to make the stepper motor smooth transition in commutation and avoid wrong step, the flag should be set in each step. Among them, each bit of 20h unit is the forward rotation flag bit of stepping motor, and each bit of 21h unit is the reverse rotation flag bit. In forward rotation, not only the forward rotation flag bit is assigned, but also the reverse rotation flag bit is assigned. In this way, when the stepper motor is reversing, the last position can be used as the starting point for reverse movement, avoiding the wrong step when the motor is reversing.

Fig. 4 program block diagram of mode 1


3. Stepping motor subdivision drive circuit

In order to control the phase current of stepper motor and achieve the purpose of subdividing the step angle of stepper motor, many kinds of subdividing driving circuits of stepper motor have been designed. With the development of microcomputer, especially the appearance of single chip computer, it is convenient for the subdivision drive of stepping motor. At present, stepping motor subdivision drive circuit is mostly controlled by single chip microcomputer. According to the required step angle, the MCU calculates the current value in each phase winding, and outputs it to the digital to analog converter (DPA). The DPA converts the digital value into the corresponding analog voltage, which is added to the power amplifier circuit of each phase through the ring distributor, and controls the power amplifier circuit to pass the corresponding current to each phase winding group, so as to realize the subdivision of the stepping motor. According to the working state of the final stage power amplifier, the stepping motor subdivision driving circuit controlled by single chip microcomputer can be divided into two types: amplification type and switch type (see Figure 5 below).

Figure 5 stepping motor subdivision drive circuit

  Editorial Reviews This paper introduces the driver designed for the stepper motor removed from an old type printer made in Japan. This paper first introduces the working principle of the stepping motor, and then introduces the software and hardware design of its driver.

Electronic enthusiast “automotive electronics special issue”, more quality content, download and read now

Special issue of automotive electronics

Leave a Reply

Your email address will not be published. Required fields are marked *