0 Introduction
A stepper motor is an electromechanical actuator that converts an electrical pulse signal into a corresponding angular displacement or linear displacement. By controlling the number of input pulses, frequency, and the connection sequence of each phase winding of the stepper motor, various required operating characteristics can be obtained. Especially when used with digital equipment, it has greater advantages, so it is widely used in digital control systems.
This paper introduces the digital control system of stepper motors by single chip microcomputer. In this control system, the controller is responsible for generating pulses and sending and receiving control commands. This paper introduces the design of the controller, especially the design of the pulse generating circuit in detail.
1 System Design
The block diagram of the stepper motor open-loop control system is shown in Figure 1. The system consists of four parts: stepper motor controller, stepper motor drive power supply, stepper motor and LED status display. This article focuses on the stepper motor controller, stepper motor drive power supply and LED status display.
Figure 1 Block diagram of stepper motor open-loop control system
1.1 Stepper Motor Controller
The stepper motor controller is mainly composed of a single-chip microcomputer, a crystal oscillator circuit, an 8K RAM and a photoelectric isolation circuit (see Figure 2).
Figure 2 Stepper motor controller components
(1) Crystal oscillator circuit
The clock signal of the microcontroller is usually obtained in two circuit forms: internal oscillation mode and external oscillation mode. The internal oscillation mode is formed by connecting a crystal oscillator (referred to as crystal oscillator) or a ceramic resonator to pins XTAL1 and XTAL2. Since there is a high-gain inverting amplifier inside the microcontroller, when an external crystal oscillator is connected, a self-excited oscillator is formed and an oscillating clock pulse is generated. The external circuit of the internal oscillation mode is shown in Figure 3. The values of C1 and C2 are selected as 30 pF in this system.
Figure 3 Internal oscillation circuit
(2) Photoelectric isolation circuit
The photoelectric isolation circuit composed of optical isolators is used to isolate the controller from the external drive circuit, so that changes in the external circuit will not affect or damage the control system, thereby improving the reliability of the system and enhancing the anti-interference ability. The most important parameter of the optical isolator is the current transfer ratio CTR, which is usually 0.2 to 0.9. When the input digital signal provides a certain current (5 to 10 mA), the optical isolator will output the amplified digital level.
When connecting the opto-isolator, pay attention to the signal positive and negative logic. The input and output ground wires of the opto-isolator must be separated from each other, and the input and output power supplies must be powered separately; if the same power supply is used, external interference signals may be transmitted to the system through the power supply.
(3) Storage module
The 89C51 microcontroller has only 128 Bytes of RAM on chip, but this system needs to store a lot of data, so it is necessary to expand the external RAM.
(4) Step pulse generation circuit
In the open-loop system of stepper motor using single-chip microcomputer, the frequency of CP pulse or commutation period of the control system actually controls the running speed of the stepper motor. The system can realize the speed control of stepper motor in two ways: one is delay and the other is timing.
The delay method is to call a delay subroutine after each commutation, and then execute commutation again after the delay is over. In this way, a certain frequency of CP pulses or commutation cycles can be issued repeatedly. The delay time of the delay subroutine and the time used by the commutation program are the period of the CP pulse. This method is simple, takes up few resources, and is completely implemented by software. Calling different subroutines can achieve different speeds of operation; but it takes up a long CPU time and cannot handle other tasks during operation, so it is only suitable for simpler control processes.
The timing method is to use the timer timing function in the single-chip system to generate a timing signal of any period, so as to conveniently control the period of the system output CP pulse. When the timer is started, the timer counts the system and its period from the initial value loaded; when the timer overflows, the timer generates an interrupt, and the system switches to execute the timing interrupt subroutine. The motor commutation subroutine is placed in the timing interrupt service program. The motor commutates once the timing interrupt is triggered, thereby realizing the speed control of the motor. Since there is a certain time interval from the timer loading and restarting to the timer applying for an interrupt, the timing time increases. In order to reduce this timing error and achieve accurate timing, the initial value of the reloaded count should be appropriately adjusted. The adjustment of the reloaded initial value mainly considers two factors: one is the time required for the interrupt response; the other is the time occupied by the reload initial value instruction, including other instruction factors in the interrupt service program before the reload initial value. After combining these two factors, the correction amount of the reloaded initial value of the count is taken as 8 machine cycles, that is, the timing time should be shortened by 8 machine cycles.
When the motor speed is controlled by the timer interrupt method, the timer load value is actually changed continuously. In the control process, the ideal speed increase and decrease curve is approached by the discrete method. In order to reduce the time of calculating the load value at each step, the load value required for the speed of each discrete point is solidified in the system ROM when the system is designed. The system uses the table lookup method to find the required load value during operation, which can greatly reduce the CPU time and improve the system response speed. The flow chart is shown in Figure 4.
Figure 4 Acceleration and deceleration control flow chart
1.2 Stepper Motor Drive Circuit
The stepper motor drive circuit is composed of the dedicated chips L297 and L298. The L297 single-chip stepper motor control integrated circuit is suitable for the control of bipolar two-phase stepper motors or four-phase unipolar stepper motors, and is combined with the H-bridge driver chip L298 to form a complete stepper motor fixed chopping frequency PWM constant current chopper driver.
The L297 stepper motor control integrated circuit generates a four-phase drive signal to control a bipolar two-phase stepper motor or a four-phase unipolar stepper motor. It can switch between three modes: half-step, two-phase excitation, and single-phase excitation. The outstanding feature of using L297 is that only three external input signals, clock, direction, and working mode, are required. At the same time, L297 automatically generates the motor excitation phase sequence, which reduces the burden of microprocessor control and programming. L297 has two packaging forms, DIP20 and SO20, and can be used to control integrated bridge drive circuits or drive circuits composed of discrete components.
L297 is mainly composed of a decoder, a PWM constant current chopper (2) with a fixed chopping frequency, and output logic control.
The L298 chip is a high voltage, high current, dual H-bridge power integrated circuit that can be used to drive inductive loads such as relay coils, DC motors, and stepper motors. The emitters of the lower arm transistors of each H-bridge are connected together, and the corresponding external terminals can be used to connect current detection resistors.
The stepper motor drive application circuit composed of L297 and L298 is shown in Figure 5. This circuit is a fixed chopping frequency constant current chopping drive mode, suitable for two-phase bipolar stepper motors or four-phase unipolar stepper motors, with a maximum voltage of 46 V and a current of up to 2 A per phase. Using two L298s and one L297 together can drive a two-phase stepper motor with higher power.
Figure 5 Stepper motor driver components
L297 has three working modes: half-step working mode, bidirectional excitation working mode and single excitation working mode. The phase sequence waveform of the bidirectional excitation working mode is shown in Figure 6.
Figure 6 Bidirectional excitation phase sequence waveform
When HALF / FULL of L297 is low level, if the decoder works in odd state (1, 3, 5, 7), it is bidirectional excitation working mode. In this mode, the output of the prohibition signal INH1 and INH2 is kept high level. If the decoder works in even state (2, 4, 6, 8), it is single-phase excitation mode; when HALF / FULL is high level, the decoder generates half-step working mode phase sequence, that is, 8-step Gray code timing sequence.
1. 3 LED operation status display
In this system, 74LS164 is used as the display driver with latch and serial connection, which can save I/O port resources, but SIO must be used, which makes it easy to control when sending data.
2 Conclusion
The open-loop control system of the stepper motor has the advantages of low cost, simplicity, and easy control. In this scheme, the load position has no feedback to the control circuit, so the stepper motor must respond correctly to each excitation change. If the excitation frequency is not selected properly, the motor cannot reach the new required position, and the actual load position will have a permanent error relative to the expected position of the controller, that is, "out of step" and "overshoot" phenomena will occur. Position feedback or position feedback can be used to determine the correct phase conversion to adapt to the rotor position, thereby greatly improving the performance of the stepper motor, so that more precise position control and high and stable speed can be obtained.
Previous article:Design of brushless DC motor control system based on LPC2141
Next article:Using Delta inverter to replace CT servo to apply constant tension control
Recommended ReadingLatest update time:2024-11-16 22:55
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Molex leverages SAP solutions to drive smart supply chain collaboration
- Pickering Launches New Future-Proof PXIe Single-Slot Controller for High-Performance Test and Measurement Applications
- CGD and Qorvo to jointly revolutionize motor control solutions
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Nidec Intelligent Motion is the first to launch an electric clutch ECU for two-wheeled vehicles
- Bosch and Tsinghua University renew cooperation agreement on artificial intelligence research to jointly promote the development of artificial intelligence in the industrial field
- GigaDevice unveils new MCU products, deeply unlocking industrial application scenarios with diversified products and solutions
- Advantech: Investing in Edge AI Innovation to Drive an Intelligent Future
- CGD and QORVO will revolutionize motor control solutions
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Ask for the ideas of the masters
- Purgatory Legend-FIFO Battle
- How bias circuit works!!!
- The best articles of Bluetooth in the past 10 years
- Program to replace Matlab results with EXCEL formulas
- C2000 ±0.1° Accurate Discrete Resolver Front-End Reference Design
- EEWORLD University Hall----Live Replay: ADI MEMS Sensors Open a New Era of Conditional State Monitoring
- Easily solve design challenges with MSP430 MCUs
- TI Logistics Robot CPU Board
- I would like to ask which one has better performance, thank you for your recommendation