Design of a Driver of Two-phase Hybrid Stepper Motor Based on THB6064H

Stepper motor is a kind of motor which can change electric pulse signal into angular displacement or linear displacement, usually; it must have a driver in order to work effectively. A driver of two-phase hybrid stepper motor based on THB6064H and single-chip of STC89C52 is designed and proposed. The driver is with the function of driving the motor to start and stop, forward and reversal, adjusting the speed of the motor and realizing the step angle subdivided control. Moreover, the maximum output current of the proposed driver achieves 5 amperes which can drive 57 series stepper motor well. Touch keys are used to input the preset data and controlling instructions of the motor, and a 1602LCD display is also adopted to show the basic parameters of the stepper motor in operation.


Introduction
Stepper motor must have a driver in order to work effectively, a schematic diagram of stepper motor controlling system is shown as figure 1.
The major function of control circuit is to produce pulse signals and it can be designed by using the separate components, PLC or single-chip [1][2]. The pulse signals are distributed to pulse distribution circuit and then to corresponding motor winding according to the order of electricity after amplify. Usually, in the case of PLC or single-chip design, the pulse distribution circuit is not required and the function of pulse distribution can be achieved by programming.
The reduction of step angle can effectively improve the control accuracy as well as the output torque of the motor, and the subdivision driving technique has been received extensive attention both in industry and academic these years [3][4]. The basic idea of subdivision drive is change the current magnitude and direction of each winding gradually, so that the magnetic field inside the motor can be change and the rotor can rotates according to step of the magnetic field formed by winding and the subdivided control is realized.
In this paper, a driver of steeper motor is designed based on the chip of THB6064H and a STC89C52 microcontroller is also adopted to design the control circuit. The driver is designed to control themotor to start and stop, forward and reversal, and adjust the speed and subdivide the step angles of the motor .Besides, the maximum output current of the proposal driver achieves 5 amperes which can drive 57 series stepper motor well. The subdivision drive function is designed into 8 modes as 1/2 -1/64 and meets the requirements of application fields. Moreover, the design is compact, low cost and high reliability.

System design scheme and requirements
The proposed driver includes a control circuit and a drive circuit, and the control circuit includes a SCM minimum system, I/O, touch keys and LCD display. The drive circuits consists THB6064H chip and its peripheral circuit. The system diagram is shown as figure 2.
As the control core of the system, the function of the SCM STC89C52 are : (1) Produce the control pulse signal such as the start and stop, forward and reversal, adjust the speed and subdivision signals,(2) Accept the control information from the keyboard to realize the real-time control of the motor,(3) Accept the information from the keyboard and complete the preset of the control information,(4) Be responsible for the checking of the subdivision mode from the drive circuit,(5) Be responsible for the real-time display of the speed, steering, subdivision and other parameters of the motor. The function of drive circuit includes:(1) Deal with the control signal from the control circuit, then drive the stepper motor to corresponding forward and reversal turning,(2)To achieve 1/2, 1/8, 1/10, 1/16, 1/20, 1/32, 1/40, 1/64 subdivision mode through three switches.

.Brief introduction of THB6064H
THB6064H is a professional two-phase stepper motor driver chip produced by Toshiba Cooperation [5][6], in which subdivision, attenuation mode setting, circuit regulation, CMOS power amplifier and other circuits are integrated inside. With a simple peripheral circuit, THB6064H can be used to design high performance driver with multi-subdivision and high current output.

.Drive circuit
The drive circuit is consists of THB6064H chip and its peripheral circuit, photoelectric isolation circuit, reset and decay mode selection circuit, power supply circuit, +5V circuit and subdivision selection circuit. THB6064H and its peripheral circuits are shown as figure 3. Pin18 is the enable terminal; when it is in low level, the drive circuit is set to standby mode, and all the logic is reset and the driver output is 0. When the pin 18 is in high level, the THB6064H chip is starting to work. Pin 21 is the Pin 22 (CW/CCW) is for the forward and reversal control of the stepper motor, when it is in low level, the motor is forward, otherwise, the motor reverse. Pin 1is the overload alarm output, when the motor is overload, Pin 1outputs a low level and lights the LED3, otherwise, the green LED2 lights which indicates the motor is well operation.

.Control circuit
As shown in figure 4, the control circuit includes STC89C52 microcontroller, crystal oscillator circuit, keyboard circuit, 1602LCD display circuit [7], etc. STC89C52 is low power consumption, high performance CMOS microcontroller. The main frequency of the system is 12MHz, and the program memory is selected. The I/O port is assigned as follows:

Test results
The hardware is fabricated and the software is programmed, the driver is tested and the results are reported as follows:

Effect of subdivision
The THB6064H is set at different subdivision mode through 3-bits switches, the operation state of the motor is observed , the results shows that the speed of the motor reduce regularly and smoothly with an increasing subdivision mode. Then fixed the speed of the motor at 60 rev/min first and set the subdivision mode at 1/2,then toggle the 3-bits switches in turn and measured the speed of the motor by stopwatch, the measured result and the LCD display data are contrasted as Table 1,which means the subdivision function of the design works well.

Winding current
Test method : A 0.1Ω/3W resistor is connected in series between the output of the driver and the motor winding, then measure the resistor's voltage waveform by an oscilloscope, obviously ,the waveform of the resistor's voltage is the same as the waveform of the motor winding current.
Test content: Set the speed of the motor at 100 rev / min and subdivision on 1/2 and 1/8 mode ,respectively, then observe the waveform of the resistor's voltage on oscilloscope, which represent the winding output current waveform of the driver, the results are shown at figure 5a-5b.
One can observed from the screen of oscilloscope that at the 1/2 subdivision mode, there are four steps between the peaks and valleys of the waveform of the output current, which means a step angle is subdivided into 2 subdivision step angle. Correspondingly, there are 16 steps between the peaks and valleys of the waveform of the output current when the subdivision mode is 1/8.Moreover, the waveform of the output current approaches sinusoidal wave when the subdivision increases. Obviously, the test results meet the theoretical expectation.

Conclusion
A driver of two-phase hybrid stepper motor based on THB6064H and single-chip of STC89C52 is designed and proposed .The driver can provide with basic control functions such as drive the motor to start and stop, forward and reversal, adjust the speed of the motor and realizes step angles subdivided control, furthermore, a maximum output current of 5 amperes is also realized. Besides, the proposed design is compact, ease of fabrication, low cost, high reliability and good practicability.