Share this

Research on a Stepper Motor Driver and its Control System

2026-04-06 04:43:25 · · #1
Abstract: This paper studies and develops a stepper motor driver and its control system. The system uses a PC as the host computer and a microcontroller as the slave computer, enabling the host computer to reliably send processed control commands and parameters to the slave computer, ensuring that the slave computer can accurately and timely issue control signals to drive the stepper motor through the driver. Simultaneously, the host computer detects various status signals from the slave computer for diagnosis and processing. Keywords: Stepper motor; Control system; Driver; Communication circuit 1 Introduction A stepper motor, also known as a pulse motor, is an actuator in digital control. It developed alongside computer control systems, utilizing electrical pulse signals for control and converting these signals into corresponding angular or linear displacements. In a stepper motor control system, the motion controller acts as its central nervous system, directing its every movement. This paper takes the stepper motor as the controlled object, inheriting the advantages of traditional stepper motor control, and develops a high-performance stepper motor driver and control system. 2 System Overall Design Figure 1 shows the overall structure of the controller. The stepper motor controller is an important part of the stepper motor control system. The controller receives instructions from the host computer and sends control signals to each stepper motor according to the instructions. The drivers of each motor convert the control signals into electrical signals that directly drive the stepper motor, thus realizing the control of the stepper motor. The PC-based control system has abundant hardware and software resources and is highly flexible. Figure 1 shows the overall structure of the controller. There are many types of microcontrollers, including the PIC series, Motorola series, and Intel 8051 series microcontrollers. Each series of microcontrollers has its own strengths and weaknesses in terms of processing speed, stability, I/O capabilities, power consumption, feature completeness, and price. These diverse families of microcontrollers provide us with a wide range of choices. Intel's 51 series microcontrollers are characterized by powerful functions, low price, small size, and easy-to-use development tools, and have a large market share, making them a relatively universal and economical product. Therefore, the 40-pin ATMEL89C51 microcontroller was selected as the main control chip in this system. 3. Hardware Detailed Design 3.1 Communication Circuit Design Various interface application circuits can be easily designed using the EPP parallel port, and its design method is closer to that of the bus method. However, due to the limited number of signal lines used, data transmission must be divided into two cycles. The EPP port uses an 8-bit data/address bus for time-division multiplexing of data and address, resulting in relatively limited resources. Furthermore, the EPP port only has three control lines for data and address transmission: WRITE, DATASTB, and ADDSTB. Therefore, the read/write control signals for the entire system—read data, read address, write data, and write address—cannot be directly obtained from the EPP port. To solve this problem, a method of combining and decoding the data strobe lines, address strobe lines, and write signal lines was adopted in the design. The interface circuit is shown in Figure 2. Figure 2 Communication Interface Circuit 3.2 Driver and Opto-isolation Circuit Design Although all printer ports have 17 signal transmission lines, the performance of these signal lines differs, for example, output resistance and anti-interference capabilities vary. IEEE 488 describes two levels of printer performance standards: Level 1 and Level 2. The Level 2 standard can provide a much larger current than the original printer port or the Level 1 standard. Both EPP and ECP modes can provide the Level 2 standard. In the circuit design, the 8D bidirectional bus transmitter/receiver 74LS245 is used as the driver circuit. The 74LS245 plays a buffering and isolation role in the circuit, and also has certain protection and control functions. When E is active, the input/output direction of the 74LS245 is controlled by DIR. Therefore, if DIR is connected to a fixed TTL level, the 74LS245 is a unidirectional buffer. Generally, its bidirectional transmission function is used. For this purpose, DIR must be controllable, so that it becomes high or low level as needed, and combined with E to control the data transmission direction. Optical isolators have advantages such as small size, long life, no contacts, strong anti-interference capability, isolation between input and output, and unidirectional signal transmission. Optical isolators are used to isolate the controller from external drive circuits, preventing changes in external circuits from affecting or damaging the control system, thereby improving system reliability and enhancing anti-interference capabilities. The most important parameter of an optical isolator is the current transfer ratio (CTR), which is typically between 0.2 and 0.9. An optical isolator will only output an amplified digital level when a certain current (5-10mA) is provided by the input digital signal. When connecting optical isolators, pay attention to the positive and negative logic of the signal. The input and output ground wires of the optical isolator must be isolated from each other, and the input and output power supplies must be separate; otherwise, if the same power supply is used, external interference signals may enter the system through the power supply. 3.3 Reset Circuit Design Reset means putting the microcontroller and its system into a specific state before formal operation. Only from this state can subsequent operations be controlled, and the system can operate reliably. The power-on and reset circuit is shown in Figure 3: Figure 3 Reset Circuit There are three ways to generate a reset signal: external reset circuit power-on or manual reset, monitor timer overflow reset, and execution of the RST instruction. The reset signal generated by the monitor timer overflow and the reset signal generated by the execution of the RST instruction belong to the internal reset control logic of the 89C51, which requires the microcontroller to have started running the program. A more practical reset method is power-on reset. This method connects a suitable capacitor from the RESET pin to ground, requiring a capacitor of about 1 to 2 μF every 1 μs. When the circuit is powered on, the capacitor C forces the RESET pin to a low level, and then the internal pull-up device pulls the RESET pin to a high level. This circuit is only suitable for situations where VCC rises rapidly. When the system is powered off, the diode provides a rapid discharge path for the capacitor C, thus protecting the system and ensuring reliable reset during repeated power-on. 3.4 Storage Module and Oscillator Circuit Design Microcontroller application systems are relatively small, and the storage capacity is generally not large. Therefore, static RAM is mostly used, which is convenient to use and does not require refreshing. Commonly used chips include 6116 (2K), 6264 (8K), and 62256 (32K). Since the AT89C51 microcontroller only has 128 bytes of internal RAM, while this system requires storing a large amount of data, external RAM is needed. The system uses one AT89C51 6264 microcontroller. The AT89C51 microcontroller chip has an internal high-gain inverting amplifier used to construct an oscillator. Its input and output terminals are XTAL1 and XTAL2, which, together with an external crystal oscillator as a feedback element, form a self-excited oscillator. The external crystal, along with capacitors C1 and C2, form a parallel resonant circuit connected in the amplifier's feedback loop. The internal oscillator then self-oscillates. The values ​​of C1 and C2 affect the oscillator frequency, stability, and start-up speed. When using an external crystal, the values ​​of C1 and C2 are often chosen to be around 30pF; this system uses 30pF for C1 and C2. 3.5 Power Supply Module Design The design of the power supply is crucial for the stable and reliable operation of the control system. This system requires three power supplies: +5V, +12V, and -12V. To address this, an integrated voltage regulator circuit was designed, consisting of integrated voltage regulators 7805, 7812, and 7912. The 7805, 7812, and 7912 voltage regulators used in the circuit not only have input, output, and common terminals, but also incorporate overcurrent and overheat protection, as well as a safety protection circuit for the regulating transistor. They are easy to use, offer good protection, are safe and reliable, and have high output stability. This circuit provides a stable DC supply voltage to the system, a precise reference voltage source for the circuit, and an independent power supply for the isolation circuit during opto-isolation. The function of the integrated voltage regulator is to transform unstable DC voltage into stable DC voltage. The power supply circuit is shown in Figure 4. This circuit consists of a transformer, a bridge rectifier B1, a filter capacitor, and integrated voltage regulators 7805, 7812, and 7912. Its working principle is as follows: 220V AC power is stepped down by a transformer, and the output voltage is reduced to 24V AC power by the secondary coil. Then, after rectification by a bridge circuit, it becomes a fluctuating DC power supply. After high-pass and low-pass filtering, it is input to integrated voltage regulators 7805, 7812, and 7912, outputting +5V±5%, +12V±5%, and -12V±5% DC voltages to supply the microcontroller application system. Experiments have proven that this circuit has the characteristics of simple structure, economy, and practicality. Figure 4: Power Supply Circuit Schematic Diagram . 4. System Software Design To ensure the normal operation of various hardware devices in the control system and effectively achieve real-time control and management, in addition to designing a reasonable hardware circuit, high-quality software support is also essential. The system software design includes microcontroller application software and PC application software. The microcontroller software is written in MCS-51 assembly language, and the PC software is written in Delphi 7.0. The microcontroller program mainly implements functions such as position control, process control, signal processing, interpolation, and communication processing; the PC software mainly further processes the data, implementing functions such as human-machine interface, real-time dynamic position display, and curve display. Figure 5 shows the layered diagram of the system application software. This software system was successfully developed using Delphi 7.0 on the Windows 98 platform. The system software consists of many functional modules. The system software interface is user-friendly and easy to use, realizing motor motion control functions. The software has three windows: Simple Motion Window, Interpolation Motion Window, and Interface Test Window. Its software layered diagram is shown in Figure 5. The author's innovation: This paper designs and develops a stepper motor open-loop control system using computer technology, CNC technology, electronic technology, interface technology, and microcontroller control technology. The controller uses a microcontroller as the main body, forming a master-slave control structure with the PC. The controller can output a square wave signal with adjustable frequency, which can meet the frequency range of stepper motor operation. The system adopts a modular design method in both hardware and software. This makes the system easier to expand, has high portability, increases the system's flexibility and reliability, and has wide adaptability. References: [1] Zhang Xuhui. Development of Automatic Ultrasonic Detection System for Pipeline Butt Welds [D]. Xi'an: Department of Mechanical Engineering, Xi'an University of Science and Technology, 2002 [2] Wu Qiongshui, Zeng Libo, Lei Junfeng. Application of MAX7000S in Microcomputer Control System of Stepper Motor [J]. Electronic Technology. No.12, 2001.47-48 [3] Gao Junli, Lu Zhuoquan. Design of Integrated Control System for Stepper Motor [J]. Microcomputer Information, 2007, 4-1: 69-70
Read next

CATDOLL Dudu Soft Silicone Head

You can choose the skin tone, eye color, and wig, or upgrade to implanted hair. Soft silicone heads come with a functio...

Articles 2026-02-22